Hello community,
here is the log from the commit of package stgit
checked in at Tue Apr 3 21:46:25 CEST 2007.
--------
--- stgit/stgit.changes 2007-02-07 18:42:07.000000000 +0100
+++ /mounts/work_src_done/STABLE/stgit/stgit.changes 2007-04-02 18:52:46.000000000 +0200
@@ -1,0 +2,15 @@
+Mon Apr 2 18:52:01 CEST 2007 - tiwai@suse.de
+
+- updated to verison 0.12.1:
+ * Allow StGIT to run when there is no user information
+ configured
+ * Use 'git-pull' rather than 'git-fetch' by default
+ * Fix the 'mail' command to parse multiple-lines address
+ headers
+ * Fix the alias check in the 'stg mail --bcc' command
+ * Add '--merged' option to rebase
+ * Add '--url' option to 'import' to import a file directly
+ from the network
+ * Add '--author' option to 'series'
+
+-------------------------------------------------------------------
Old:
----
stgit-0.12.tar.bz2
New:
----
stgit-0.12.1.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ stgit.spec ++++++
--- /var/tmp/diff_new_pack.q24280/_old 2007-04-03 21:45:57.000000000 +0200
+++ /var/tmp/diff_new_pack.q24280/_new 2007-04-03 21:45:57.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package stgit (Version 0.12)
+# spec file for package stgit (Version 0.12.1)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -13,7 +13,7 @@
Name: stgit
BuildRequires: python-devel
Summary: Stacked GIT - Source Code Management Tool
-Version: 0.12
+Version: 0.12.1
Release: 1
License: GNU General Public License (GPL)
Group: Development/Tools/Version Control
@@ -55,7 +55,19 @@
%{py_sitedir}/*
%{_datadir}/stgit
-%changelog -n stgit
+%changelog
+* Mon Apr 02 2007 - tiwai@suse.de
+- updated to verison 0.12.1:
+ * Allow StGIT to run when there is no user information
+ configured
+ * Use 'git-pull' rather than 'git-fetch' by default
+ * Fix the 'mail' command to parse multiple-lines address
+ headers
+ * Fix the alias check in the 'stg mail --bcc' command
+ * Add '--merged' option to rebase
+ * Add '--url' option to 'import' to import a file directly
+ from the network
+ * Add '--author' option to 'series'
* Wed Feb 07 2007 - tiwai@suse.de
- updated to version 0.12:
* New 'rebase' command to change the base of an StGIT stack
++++++ stgit-0.12.tar.bz2 -> stgit-0.12.1.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/ChangeLog new/stgit-0.12.1/ChangeLog
--- old/stgit-0.12/ChangeLog 2007-02-07 00:04:45.000000000 +0100
+++ new/stgit-0.12.1/ChangeLog 2007-02-23 23:35:14.000000000 +0100
@@ -1,3 +1,196 @@
+commit 7b4c40e6e5e019c5e079d8331bee4842af21019a
+Author: Catalin Marinas
+Date: Fri Feb 23 22:19:06 2007 +0000
+
+ Release 0.12.1
+
+ Signed-off-by: Catalin Marinas
+
+commit 8f3aad92f63a76c43c6411776942811a69706cfc
+Author: Sam Vilain
+Date: Fri Feb 23 22:09:06 2007 +0000
+
+ Some minor debian packaging fixes
+
+commit 7441f9614f4f4840c5473b54993312ace26bb897
+Author: Catalin Marinas
+Date: Sat Feb 3 22:21:57 2007 +0000
+
+ Use 'git-pull' rather than 'git-fetch' by default
+
+ Signed-off-by: Catalin Marinas
+
+commit b6c95ada87ed57ef78f4a02987606e498cd4e04d
+Author: Yann Dirson
+Date: Tue Feb 20 01:14:19 2007 +0100
+
+ Keep track of safe base changes.
+
+
+
+
+ Signed-off-by: Yann Dirson
+
+commit 09340f5f9daadc37204f8e13e668af7c02fc1814
+Author: Yann Dirson
+Date: Tue Feb 20 01:14:13 2007 +0100
+
+ Various cleanups for clarity.
+
+
+
+
+ Signed-off-by: Yann Dirson
+
+commit ba66e579c03a92dd8a3bc27ceb951fd2dc40723e
+Author: Yann Dirson
+Date: Tue Feb 20 01:14:08 2007 +0100
+
+ Move stack-base querying into Series class.
+
+
+
+
+ Signed-off-by: Yann Dirson
+
+commit a9f3a9fc26bfad2168af83997e088247acccb1ee
+Author: Yann Dirson
+Date: Tue Feb 20 01:14:03 2007 +0100
+
+ Factorize rebasing behaviour.
+
+
+
+
+ Signed-off-by: Yann Dirson
+
+commit 178426c492a38c81eeac55b90dca5aa3b8a23492
+Author: Yann Dirson
+Date: Mon Feb 19 23:22:54 2007 +0100
+
+ Support for pre-1.5 git in stgit tests.
+
+
+ Support for older Git versions was broken in
+ 5cd9e87faa0a116ce2b378be6a5c89d5f20629f1 (post 0.12).
+
+ Signed-off-by: Yann Dirson
+
+commit d650d6ed4c969d0d5127544e5236f83e21608ca5
+Author: Catalin Marinas
+Date: Wed Feb 21 18:30:30 2007 +0000
+
+ Fix the mail command to parse longer address headers
+
+ If an address header is split over multiple lines, the old code was
+ only parsing the first line, missing the other addresses.
+
+ Signed-off-by: Catalin Marinas
+
+commit f06cd2d17cc81b077f494d56b8515ebea38770f7
+Author: Catalin Marinas
+Date: Wed Feb 21 18:30:30 2007 +0000
+
+ Fix the alias check in the mail --bcc command
+
+ A check for an empty alias was performed if autobcc wasn't set in the
+ config file.
+
+ Signed-off-by: Catalin Marinas
+
+commit dc4e5946dfd10fd8f6251257c52161615f7c1841
+Author: Catalin Marinas
+Date: Wed Feb 21 18:30:30 2007 +0000
+
+ Display whether the patch is empty after refresh
+
+ Signed-off-by: Catalin Marinas
+
+commit fd1c0cfca390f57dd37024b677de9b707916a8d5
+Author: Catalin Marinas
+Date: Sat Feb 17 23:57:39 2007 +0000
+
+ Fix import to allow --name and --strip for most import types
+
+ Originally, those options were only valid for a basic file import but
+ not for e-mail or url. This patch also replaces invalid characters in
+ the patch name with dashes.
+
+ Signed-off-by: Catalin Marinas
+
+commit 575c575ea43be1145e79e1cc5d66c2a102d94f7f
+Author: Clark Williams
+Date: Sat Feb 17 14:42:27 2007 -0600
+
+ URL import for stgit
+
+ Signed-off-by: Clark Williams
+ Signed-off-by: Catalin Marinas
+
+commit 54fac8e67115d98b4addcd4e7c9bfe9f39820b09
+Author: Catalin Marinas
+Date: Fri Feb 16 22:42:35 2007 +0000
+
+ Add --author option to series
+
+ This is similar to the --description option, only that the author name
+ is displayed instead.
+
+ Signed-off-by: Catalin Marinas
+
+commit 457c30933ccdf2fff533073544392a84ce6190ab
+Author: Catalin Marinas
+Date: Fri Feb 16 22:42:35 2007 +0000
+
+ Allow importing mbox files from stdin
+
+ The UnixMailbox does not support reading from stdin as it uses seek()
+ (at least on Python 2.3). This patch reads the stdin into a StringIO
+ object.
+
+ Signed-off-by: Catalin Marinas
+
+commit 5cd9e87faa0a116ce2b378be6a5c89d5f20629f1
+Author: Catalin Marinas
+Date: Tue Feb 13 22:26:37 2007 +0000
+
+ Fix the behaviour when there is no user information configured
+
+ If there is no user.name or user.email set in the gitconfig files,
+ just use the defaults rather than failing.
+
+ Signed-off-by: Catalin Marinas
+
+commit b2017c38acfed9c26ec5bbcb2b23784ca0a15cc8
+Author: Catalin Marinas
+Date: Tue Feb 13 22:26:36 2007 +0000
+
+ Make StGIT aware of the STGIT_DEBUG_LEVEL environment variable
+
+ For now, setting this environment variable will make StGIT dump the
+ backtrace in case of a failure.
+
+ Signed-off-by: Catalin Marinas
+
+commit 78340ff10ec8fe964a6d9b3d2ad8b7d3edd717cc
+Author: Yann Dirson
+Date: Tue Feb 13 22:26:36 2007 +0000
+
+ Use canonical command name in help message.
+
+ Let's expand shortcut command names in help messages, in all 3 forms
+ ("help foo", "--help foo" and "foo --help").
+
+ Signed-off-by: Yann Dirson
+
+commit d12efe4418029cb713b46875779cbc9a4aa16166
+Author: Yann Dirson
+Date: Tue Feb 13 22:26:36 2007 +0000
+
+ Add --merged option to rebase.
+
+ Signed-off-by: Yann Dirson
+
commit ebc429e7b7e596a12e8255fadc397123893cec73
Author: Catalin Marinas
Date: Tue Feb 6 22:48:03 2007 +0000
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/examples/gitconfig new/stgit-0.12.1/examples/gitconfig
--- old/stgit-0.12/examples/gitconfig 2007-02-07 00:00:41.000000000 +0100
+++ new/stgit-0.12.1/examples/gitconfig 2007-02-23 23:22:28.000000000 +0100
@@ -35,12 +35,11 @@
# GIT pull command (should take the same arguments as
# git-fetch or git-pull). By default:
- #pullcmd = git-fetch
- #pull-does-rebase = yes
- # Alternative (old behaviour), less intuitive but maybe useful
- # for some workflows:
#pullcmd = git-pull
#pull-does-rebase = no
+ # Alternative (StGIT does the rebasing):
+ #pullcmd = git-fetch
+ #pull-does-rebase = yes
# The three-way merge tool. Note that the 'output' file contains the
# same data as 'branch1'. This is useful for tools that do not take an
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/PKG-INFO new/stgit-0.12.1/PKG-INFO
--- old/stgit-0.12/PKG-INFO 2007-02-07 00:04:45.000000000 +0100
+++ new/stgit-0.12.1/PKG-INFO 2007-02-23 23:35:16.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: stgit
-Version: 0.12
+Version: 0.12.1
Summary: Stacked GIT
Home-page: http://www.procode.org/stgit/
Author: Catalin Marinas
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/stgit/commands/common.py new/stgit-0.12.1/stgit/commands/common.py
--- old/stgit-0.12/stgit/commands/common.py 2007-02-01 23:53:20.000000000 +0100
+++ new/stgit-0.12.1/stgit/commands/common.py 2007-02-23 23:22:28.000000000 +0100
@@ -101,7 +101,7 @@
elif patch_id == 'log':
return series.get_patch(patch).get_log()
if patch == 'base' and patch_id == None:
- return read_string(series.get_base_file())
+ return series.get_base()
except RevParseException:
pass
return git.rev_parse(rev + '^{commit}')
@@ -308,6 +308,8 @@
the aliases in the config files.
"""
def __address_or_alias(addr):
+ if not addr:
+ return None
if addr.find('@') >= 0:
# it's an e-mail address
return addr
@@ -315,12 +317,11 @@
if alias:
# it's an alias
return alias
-
raise CmdException, 'unknown e-mail alias: %s' % addr
addr_list = [__address_or_alias(addr.strip())
for addr in addr_str.split(',')]
- return ', '.join(addr_list)
+ return ', '.join([addr for addr in addr_list if addr])
def patch_name_from_msg(msg):
"""Return a string to be used as a patch name. This is generated
@@ -346,3 +347,28 @@
suffix += 1
patchname = '%s-%d' % (patchname, suffix)
return patchname
+
+def prepare_rebase():
+ # pop all patches
+ applied = crt_series.get_applied()
+ if len(applied) > 0:
+ print 'Popping all applied patches...',
+ sys.stdout.flush()
+ crt_series.pop_patch(applied[0])
+ print 'done'
+ return applied
+
+def rebase(target):
+ if target == git.get_head():
+ print 'Already at "%s", no need for rebasing.' % target
+ return
+
+ print 'Rebasing to "%s"...' % target
+ git.reset(tree_id = git_id(target))
+
+def post_rebase(applied, nopush, merged):
+ # memorize that we rebased to here
+ crt_series._set_field('orig-base', git.get_head())
+ # push the patches back
+ if not nopush:
+ push_patches(applied, merged)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/stgit/commands/imprt.py new/stgit-0.12.1/stgit/commands/imprt.py
--- old/stgit-0.12/stgit/commands/imprt.py 2007-01-25 23:49:37.000000000 +0100
+++ new/stgit-0.12.1/stgit/commands/imprt.py 2007-02-21 23:36:40.000000000 +0100
@@ -18,6 +18,7 @@
import sys, os, re, email
from email.Header import decode_header, make_header
from mailbox import UnixMailbox
+from StringIO import StringIO
from optparse import OptionParser, make_option
from stgit.commands.common import *
@@ -26,7 +27,7 @@
help = 'import a GNU diff file as a new patch'
-usage = """%prog [options] [<file>]
+usage = """%prog [options] [<file>|<url>]
Create a new patch and apply the given GNU diff file (or the standard
input). By default, the file name is used as the patch name but this
@@ -52,6 +53,9 @@
make_option('-s', '--series',
help = 'import a series of patches',
action = 'store_true'),
+ make_option('-u', '--url',
+ help = 'import a patch from a URL',
+ action = 'store_true'),
make_option('-n', '--name',
help = 'use NAME as the patch name'),
make_option('-t', '--strip',
@@ -224,17 +228,29 @@
# Just return None
return (descr, authname, authemail, authdate, diff)
-def __create_patch(patch, message, author_name, author_email,
+def __create_patch(filename, message, author_name, author_email,
author_date, diff, options):
"""Create a new patch on the stack
"""
- if not diff:
- raise CmdException, 'No diff found inside the patch'
+ if options.name:
+ patch = options.name
+ elif filename:
+ patch = os.path.basename(filename)
+ else:
+ patch = ''
+ if options.strip:
+ patch = __strip_patch_name(patch)
if not patch:
patch = make_patch_name(message, crt_series.patch_exists,
alternative = not (options.ignore
or options.replace))
+ else:
+ # fix possible invalid characters in the patch name
+ patch = re.sub('[^\w.]+', '-', patch).strip('-')
+
+ if not diff:
+ raise CmdException, 'No diff found inside the patch'
if options.ignore and patch in crt_series.get_applied():
print 'Ignoring already applied patch "%s"' % patch
@@ -284,7 +300,7 @@
print 'done'
-def __import_file(patch, filename, options):
+def __import_file(filename, options, patch = None):
"""Import a patch from a file or standard input
"""
if filename:
@@ -306,7 +322,12 @@
if filename:
f.close()
- __create_patch(patch, message, author_name, author_email,
+ if patch:
+ pname = patch
+ else:
+ pname = filename
+
+ __create_patch(pname, message, author_name, author_email,
author_date, diff, options)
def __import_series(filename, options):
@@ -326,12 +347,9 @@
if not patch:
continue
patchfile = os.path.join(patchdir, patch)
-
- if options.strip:
- patch = __strip_patch_name(patch)
patch = __replace_slashes_with_dashes(patch);
- __import_file(patch, patchfile, options)
+ __import_file(patchfile, options, patch)
if filename:
f.close()
@@ -342,7 +360,7 @@
if filename:
f = file(filename, 'rb')
else:
- f = sys.stdin
+ f = StringIO(sys.stdin.read())
try:
mbox = UnixMailbox(f, email.message_from_file)
@@ -355,8 +373,21 @@
__create_patch(None, message, author_name, author_email,
author_date, diff, options)
- if filename:
- f.close()
+ f.close()
+
+def __import_url(url, options):
+ """Import a patch from a URL
+ """
+ import urllib
+ import tempfile
+
+ if not url:
+ parser.error('URL argument required')
+
+ patch = os.path.basename(urllib.unquote(url))
+ filename = os.path.join(tempfile.gettempdir(), patch)
+ urllib.urlretrieve(url, filename)
+ __import_file(filename, options)
def func(parser, options, args):
"""Import a GNU diff file as a new patch
@@ -377,16 +408,9 @@
__import_series(filename, options)
elif options.mbox:
__import_mbox(filename, options)
+ elif options.url:
+ __import_url(filename, options)
else:
- if options.name:
- patch = options.name
- elif filename:
- patch = os.path.basename(filename)
- else:
- patch = ''
- if options.strip:
- patch = __strip_patch_name(patch)
-
- __import_file(patch, filename, options)
+ __import_file(filename, options)
print_crt_patch()
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/stgit/commands/mail.py new/stgit-0.12.1/stgit/commands/mail.py
--- old/stgit-0.12/stgit/commands/mail.py 2007-02-05 23:43:36.000000000 +0100
+++ new/stgit-0.12.1/stgit/commands/mail.py 2007-02-21 23:36:40.000000000 +0100
@@ -141,25 +141,19 @@
return address_or_alias(sender)
-def __parse_addresses(addresses):
+def __parse_addresses(msg):
"""Return a two elements tuple: (from, [to])
"""
- def __addr_list(addrs):
- m = re.search('[^@\s<,]+@[^>\s,]+', addrs);
- if (m == None):
- return []
- return [ m.group() ] + __addr_list(addrs[m.end():])
-
- from_addr_list = []
- to_addr_list = []
- for line in addresses.split('\n'):
- if re.match('from:\s+', line, re.I):
- from_addr_list += __addr_list(line)
- elif re.match('(to|cc|bcc):\s+', line, re.I):
- to_addr_list += __addr_list(line)
+ def __addr_list(msg, header):
+ return [name_addr[1] for name_addr in
+ email.Utils.getaddresses(msg.get_all(header, []))]
+ from_addr_list = __addr_list(msg, 'From')
if len(from_addr_list) == 0:
raise CmdException, 'No "From" address'
+
+ to_addr_list = __addr_list(msg, 'To') + __addr_list(msg, 'Cc') \
+ + __addr_list(msg, 'Bcc')
if len(to_addr_list) == 0:
raise CmdException, 'No "To/Cc/Bcc" addresses'
@@ -359,9 +353,7 @@
__build_extra_headers(msg, msg_id, options.refid)
__encode_message(msg)
- msg_string = msg.as_string(options.mbox)
-
- return msg_string.strip('\n')
+ return msg
def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options):
"""Build the message to be sent via SMTP
@@ -461,9 +453,7 @@
__build_extra_headers(msg, msg_id, ref_id)
__encode_message(msg)
- msg_string = msg.as_string(options.mbox)
-
- return msg_string.strip('\n')
+ return msg
def func(parser, options, args):
"""Send the patches by e-mail using the patchmail.tmpl file as
@@ -514,18 +504,19 @@
msg = __build_cover(tmpl, total_nr, msg_id, options)
from_addr, to_addr_list = __parse_addresses(msg)
+ msg_string = msg.as_string(options.mbox)
+
# subsequent e-mails are seen as replies to the first one
if not options.noreply:
ref_id = msg_id
if options.mbox:
- print msg
- print
+ print msg_string
else:
print 'Sending the cover message...',
sys.stdout.flush()
- __send_message(smtpserver, from_addr, to_addr_list, msg, sleep,
- smtpuser, smtppassword)
+ __send_message(smtpserver, from_addr, to_addr_list, msg_string,
+ sleep, smtpuser, smtppassword)
print 'done'
# send the patches
@@ -542,16 +533,17 @@
options)
from_addr, to_addr_list = __parse_addresses(msg)
+ msg_string = msg.as_string(options.mbox)
+
# subsequent e-mails are seen as replies to the first one
if not options.noreply and not ref_id:
ref_id = msg_id
if options.mbox:
- print msg
- print
+ print msg_string
else:
print 'Sending patch "%s"...' % p,
sys.stdout.flush()
- __send_message(smtpserver, from_addr, to_addr_list, msg, sleep,
- smtpuser, smtppassword)
+ __send_message(smtpserver, from_addr, to_addr_list, msg_string,
+ sleep, smtpuser, smtppassword)
print 'done'
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/stgit/commands/pull.py new/stgit-0.12.1/stgit/commands/pull.py
--- old/stgit-0.12/stgit/commands/pull.py 2007-02-04 23:27:10.000000000 +0100
+++ new/stgit-0.12.1/stgit/commands/pull.py 2007-02-23 23:22:28.000000000 +0100
@@ -61,27 +61,15 @@
check_conflicts()
check_head_top_equal()
- # pop all patches
- applied = crt_series.get_applied()
- if len(applied) > 0:
- print 'Popping all applied patches...',
- sys.stdout.flush()
- crt_series.pop_patch(applied[0])
- print 'done'
+ applied = prepare_rebase()
# pull the remote changes
print 'Pulling from "%s"...' % repository
git.fetch(repository)
if (config.get('stgit.pull-does-rebase') == 'yes'):
- fetch_head = git.fetch_head()
- if fetch_head != git.get_head():
- print 'rebasing to "%s"...' % fetch_head
- git.reset(tree_id = fetch_head)
- print 'done'
+ rebase(git.fetch_head())
- # push the patches back
- if not options.nopush:
- push_patches(applied, options.merged)
+ post_rebase(applied, options.nopush, options.merged)
# maybe tidy up
if config.get('stgit.keepoptimized') == 'yes':
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/stgit/commands/rebase.py new/stgit-0.12.1/stgit/commands/rebase.py
--- old/stgit-0.12/stgit/commands/rebase.py 2007-01-25 23:49:37.000000000 +0100
+++ new/stgit-0.12.1/stgit/commands/rebase.py 2007-02-23 23:22:28.000000000 +0100
@@ -31,6 +31,9 @@
options = [make_option('-n', '--nopush',
help = 'do not push the patches back after rebasing',
+ action = 'store_true'),
+ make_option('-m', '--merged',
+ help = 'check for patches merged upstream',
action = 'store_true')]
def func(parser, options, args):
@@ -46,19 +49,8 @@
check_conflicts()
check_head_top_equal()
- # pop all patches
- applied = crt_series.get_applied()
- if len(applied) > 0:
- print 'Popping all applied patches...',
- sys.stdout.flush()
- crt_series.pop_patch(applied[0])
- print 'done'
-
- print 'Rebasing to "%s"...' % args[0]
- git.reset(tree_id = git_id(args[0]))
-
- # push the patches back
- if not options.nopush:
- push_patches(applied)
+ applied = prepare_rebase()
+ rebase(args[0])
+ post_rebase(applied, options.nopush, options.merged)
print_crt_patch()
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/stgit/commands/refresh.py new/stgit-0.12.1/stgit/commands/refresh.py
--- old/stgit-0.12/stgit/commands/refresh.py 2007-02-01 23:53:20.000000000 +0100
+++ new/stgit-0.12.1/stgit/commands/refresh.py 2007-02-21 23:36:40.000000000 +0100
@@ -144,7 +144,10 @@
committer_email = options.commemail,
backup = True, sign_str = sign_str)
- print 'done'
+ if crt_series.empty_patch(patch):
+ print 'done (empty patch)'
+ else:
+ print 'done'
if options.patch:
between.reverse()
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/stgit/commands/series.py new/stgit-0.12.1/stgit/commands/series.py
--- old/stgit-0.12/stgit/commands/series.py 2007-02-01 23:53:20.000000000 +0100
+++ new/stgit-0.12.1/stgit/commands/series.py 2007-02-21 23:36:40.000000000 +0100
@@ -50,6 +50,9 @@
make_option('-d', '--description',
help = 'show a short description for each patch',
action = 'store_true'),
+ make_option('--author',
+ help = 'show the author name for each patch',
+ action = 'store_true'),
make_option('-e', '--empty',
help = 'check whether patches are empty '
'(much slower)',
@@ -76,6 +79,12 @@
descr_lines = descr.split('\n')
return descr_lines[0].rstrip()
+def __get_author(patch):
+ """Extract and return a patch's short description
+ """
+ p = crt_series.get_patch(patch)
+ return p.get_authname();
+
def __print_patch(patch, hidden, branch_str, prefix, empty_prefix, length,
options):
"""Print a patch name, description and various markers.
@@ -89,9 +98,13 @@
if not options.noprefix and patch in hidden:
patch_str += '*'
+ if options.description or options.author:
+ patch_str = patch_str.ljust(length)
+
if options.description:
- print prefix + patch_str.ljust(length) + ' | ' \
- + __get_description(patch)
+ print prefix + patch_str + ' | ' + __get_description(patch)
+ elif options.author:
+ print prefix + patch_str + ' | ' + __get_author(patch)
else:
print prefix + patch_str
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/stgit/config.py new/stgit-0.12.1/stgit/config.py
--- old/stgit-0.12/stgit/config.py 2007-02-04 23:27:10.000000000 +0100
+++ new/stgit-0.12.1/stgit/config.py 2007-02-23 23:22:28.000000000 +0100
@@ -29,8 +29,8 @@
'stgit.autoresolved': 'no',
'stgit.smtpserver': 'localhost:25',
'stgit.smtpdelay': '5',
- 'stgit.pullcmd': 'git-fetch',
- 'stgit.pull-does-rebase': 'yes',
+ 'stgit.pullcmd': 'git-pull',
+ 'stgit.pull-does-rebase': 'no',
'stgit.merger': 'diff3 -L current -L ancestor -L patched -m -E ' \
'"%(branch1)s" "%(ancestor)s" "%(branch2)s" > "%(output)s"',
'stgit.autoimerge': 'no',
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/stgit/git.py new/stgit-0.12.1/stgit/git.py
--- old/stgit-0.12/stgit/git.py 2007-02-05 23:18:29.000000000 +0100
+++ new/stgit-0.12.1/stgit/git.py 2007-02-23 23:22:28.000000000 +0100
@@ -39,6 +39,7 @@
"""An author, committer, etc."""
def __init__(self, name = None, email = None, date = '',
desc = None):
+ self.name = self.email = self.date = None
if name or email or date:
assert not desc
self.name = name
@@ -452,10 +453,7 @@
if not __user:
name=config.get('user.name')
email=config.get('user.email')
- if name and email:
- __user = Person(name, email)
- else:
- raise GitException, 'unknown user details'
+ __user = Person(name, email)
return __user;
def author():
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/stgit/main.py new/stgit-0.12.1/stgit/main.py
--- old/stgit-0.12/stgit/main.py 2007-01-26 23:32:14.000000000 +0100
+++ new/stgit-0.12.1/stgit/main.py 2007-02-21 23:36:40.000000000 +0100
@@ -29,27 +29,31 @@
class Commands(dict):
"""Commands class. It performs on-demand module loading
"""
+ def canonical_cmd(self, key):
+ """Return the canonical name for a possibly-shortenned
+ command name.
+ """
+ candidates = [cmd for cmd in self.keys() if cmd.startswith(key)]
+
+ if not candidates:
+ print >> sys.stderr, 'Unknown command: %s' % key
+ print >> sys.stderr, ' Try "%s help" for a list of ' \
+ 'supported commands' % prog
+ sys.exit(1)
+ elif len(candidates) > 1:
+ print >> sys.stderr, 'Ambiguous command: %s' % key
+ print >> sys.stderr, ' Candidates are: %s' \
+ % ', '.join(candidates)
+ sys.exit(1)
+
+ return candidates[0]
+
def __getitem__(self, key):
"""Return the command python module name based.
"""
global prog
- cmd_mod = self.get(key)
- if not cmd_mod:
- candidates = [cmd for cmd in self.keys() if cmd.startswith(key)]
-
- if not candidates:
- print >> sys.stderr, 'Unknown command: %s' % key
- print >> sys.stderr, ' Try "%s help" for a list of ' \
- 'supported commands' % prog
- sys.exit(1)
- elif len(candidates) > 1:
- print >> sys.stderr, 'Ambiguous command: %s' % key
- print >> sys.stderr, ' Candidates are: %s' \
- % ', '.join(candidates)
- sys.exit(1)
-
- cmd_mod = self.get(candidates[0])
+ cmd_mod = self.get(key) or self.get(self.canonical_cmd(key))
__import__('stgit.commands.' + cmd_mod)
return getattr(stgit.commands, cmd_mod)
@@ -202,15 +206,15 @@
cmd = sys.argv[1]
if cmd in ['-h', '--help']:
- if len(sys.argv) >= 3 and sys.argv[2] in commands:
- cmd = sys.argv[2]
+ if len(sys.argv) >= 3:
+ cmd = commands.canonical_cmd(sys.argv[2])
sys.argv[2] = '--help'
else:
print_help()
sys.exit(0)
if cmd == 'help':
if len(sys.argv) == 3 and not sys.argv[2] in ['-h', '--help']:
- cmd = sys.argv[2]
+ cmd = commands.canonical_cmd(sys.argv[2])
if not cmd in commands:
print >> sys.stderr, '%s help: "%s" command unknown' \
% (prog, cmd)
@@ -236,7 +240,7 @@
sys.exit(0)
# re-build the command line arguments
- sys.argv[0] += ' %s' % cmd
+ sys.argv[0] += ' %s' % commands.canonical_cmd(cmd)
del(sys.argv[1])
command = commands[cmd]
@@ -254,6 +258,14 @@
from stgit.gitmergeonefile import GitMergeException
try:
+ debug_level = int(os.environ['STGIT_DEBUG_LEVEL'])
+ except KeyError:
+ debug_level = 0
+ except ValueError:
+ print >> sys.stderr, 'Invalid STGIT_DEBUG_LEVEL environment variable'
+ sys.exit(1)
+
+ try:
config_setup()
# 'clone' doesn't expect an already initialised GIT tree. A Series
@@ -269,7 +281,10 @@
except (IOError, ParsingError, NoSectionError, CmdException,
StackException, GitException, GitMergeException), err:
print >> sys.stderr, '%s %s: %s' % (prog, cmd, err)
- sys.exit(2)
+ if debug_level:
+ raise
+ else:
+ sys.exit(2)
except KeyboardInterrupt:
sys.exit(1)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/stgit/stack.py new/stgit-0.12.1/stgit/stack.py
--- old/stgit-0.12/stgit/stack.py 2007-02-05 23:18:29.000000000 +0100
+++ new/stgit-0.12.1/stgit/stack.py 2007-02-23 23:22:28.000000000 +0100
@@ -394,6 +394,9 @@
self.__begin_stack_check()
return self.__base_file
+ def get_base(self):
+ return read_string(self.get_base_file())
+
def get_protected(self):
return os.path.isfile(os.path.join(self._dir(), 'protected'))
@@ -515,8 +518,6 @@
def init(self, create_at=False, parent_remote=None, parent_branch=None):
"""Initialises the stgit series
"""
- bases_dir = os.path.join(self.__base_dir, 'refs', 'bases')
-
if os.path.exists(self.__patch_dir):
raise StackException, self.__patch_dir + ' already exists'
if os.path.exists(self.__refs_dir):
@@ -531,7 +532,7 @@
self.set_parent(parent_remote, parent_branch)
- create_dirs(bases_dir)
+ create_dirs(os.path.join(self.__base_dir, 'refs', 'bases'))
self.create_empty_field('applied')
self.create_empty_field('unapplied')
@@ -539,6 +540,7 @@
os.makedirs(os.path.join(self._dir(), 'patches'))
os.makedirs(self.__refs_dir)
self.__begin_stack_check()
+ self._set_field('orig-base', git.get_head())
def convert(self):
"""Either convert to use a separate patch directory, or
@@ -609,7 +611,7 @@
"""
try:
# allow cloning of branches not under StGIT control
- base = read_string(self.get_base_file())
+ base = self.get_base()
except:
base = git.get_head()
Series(target_series).init(create_at = base)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/stgit-0.12/stgit/version.py new/stgit-0.12.1/stgit/version.py
--- old/stgit-0.12/stgit/version.py 2007-02-07 00:00:41.000000000 +0100
+++ new/stgit-0.12.1/stgit/version.py 2007-02-23 23:22:28.000000000 +0100
@@ -1 +1 @@
-version = '0.12'
+version = '0.12.1'
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org