merge wtih crew-stable
authorMartin Geisler <mg@lazybytes.net>
Sat, 04 Jul 2009 12:25:10 +0200
changeset 9022 a6225ac2a656
parent 9020 609b803dd252 (diff)
parent 9021 2ccb527c7b1a (current diff)
child 9023 cd92a6968f70
merge wtih crew-stable
--- a/hgext/color.py	Sat Jul 04 12:12:36 2009 +0200
+++ b/hgext/color.py	Sat Jul 04 12:25:10 2009 +0200
@@ -146,9 +146,9 @@
     for patch in patches:
         patchname = patch
         if opts['summary']:
-            patchname = patchname.split(': ')[0]
+            patchname = patchname.split(': ', 1)[0]
         if ui.verbose:
-            patchname = patchname.split(' ', 2)[-1]
+            patchname = patchname.lstrip().split(' ', 2)[-1]
 
         if opts['missing']:
             effects = _patch_effects['missing']
@@ -158,7 +158,9 @@
             effects = _patch_effects['applied']
         else:
             effects = _patch_effects['unapplied']
-        ui.write(render_effects(patch, effects) + '\n')
+
+        patch = patch.replace(patchname, render_effects(patchname, effects), 1)
+        ui.write(patch + '\n')
     return retval
 
 _patch_effects = { 'applied': ['blue', 'bold', 'underline'],
--- a/hgext/convert/subversion.py	Sat Jul 04 12:12:36 2009 +0200
+++ b/hgext/convert/subversion.py	Sat Jul 04 12:25:10 2009 +0200
@@ -2,7 +2,6 @@
 #
 # Copyright(C) 2007 Daniel Holth et al
 
-import locale
 import os
 import re
 import sys
--- a/hgext/keyword.py	Sat Jul 04 12:12:36 2009 +0200
+++ b/hgext/keyword.py	Sat Jul 04 12:25:10 2009 +0200
@@ -495,7 +495,8 @@
                 release(lock, wlock)
 
     # monkeypatches
-    def kwpatchfile_init(orig, self, ui, fname, opener, missing=False, eol=None):
+    def kwpatchfile_init(orig, self, ui, fname, opener,
+                         missing=False, eol=None):
         '''Monkeypatch/wrap patch.patchfile.__init__ to avoid
         rejects or conflicts due to expanded keywords in working dir.'''
         orig(self, ui, fname, opener, missing, eol)
--- a/hgext/mq.py	Sat Jul 04 12:12:36 2009 +0200
+++ b/hgext/mq.py	Sat Jul 04 12:25:10 2009 +0200
@@ -1343,19 +1343,24 @@
 
     def qseries(self, repo, missing=None, start=0, length=None, status=None,
                 summary=False):
-        def displayname(patchname):
+        def displayname(pfx, patchname):
             if summary:
                 ph = patchheader(self.join(patchname))
                 msg = ph.message
                 msg = msg and ': ' + msg[0] or ': '
             else:
                 msg = ''
-            return '%s%s' % (patchname, msg)
+            msg = "%s%s%s" % (pfx, patchname, msg)
+            if self.ui.interactive():
+                msg = util.ellipsis(msg, util.termwidth())
+            self.ui.write(msg + '\n')
 
         applied = set([p.name for p in self.applied])
         if length is None:
             length = len(self.series) - start
         if not missing:
+            if self.ui.verbose:
+                idxwidth = len(str(start+length - 1))
             for i in xrange(start, start+length):
                 patch = self.series[i]
                 if patch in applied:
@@ -1366,10 +1371,10 @@
                     stat = 'G'
                 pfx = ''
                 if self.ui.verbose:
-                    pfx = '%d %s ' % (i, stat)
+                    pfx = '%*d %s ' % (idxwidth, i, stat)
                 elif status and status != stat:
                     continue
-                self.ui.write('%s%s\n' % (pfx, displayname(patch)))
+                displayname(pfx, patch)
         else:
             msng_list = []
             for root, dirs, files in os.walk(self.path):
@@ -1383,7 +1388,7 @@
                         msng_list.append(fl)
             for x in sorted(msng_list):
                 pfx = self.ui.verbose and ('D ') or ''
-                self.ui.write("%s%s\n" % (pfx, displayname(x)))
+                displayname(pfx, x)
 
     def issaveline(self, l):
         if l.name == '.hg.patches.save.line':
--- a/hgext/share.py	Sat Jul 04 12:12:36 2009 +0200
+++ b/hgext/share.py	Sat Jul 04 12:25:10 2009 +0200
@@ -5,7 +5,6 @@
 
 '''share a common history between several working directories'''
 
-import os
 from mercurial.i18n import _
 from mercurial import hg, commands
 
--- a/mercurial/commands.py	Sat Jul 04 12:12:36 2009 +0200
+++ b/mercurial/commands.py	Sat Jul 04 12:25:10 2009 +0200
@@ -396,8 +396,8 @@
         while size <= changesets:
             tests, size = tests + 1, size * 2
         rev = repo.changelog.rev(node)
-        ui.write(_("Testing changeset %s:%s "
-                   "(%s changesets remaining, ~%s tests)\n")
+        ui.write(_("Testing changeset %d:%s "
+                   "(%d changesets remaining, ~%d tests)\n")
                  % (rev, short(node), changesets, tests))
         if not noupdate:
             cmdutil.bail_if_changed(repo)
--- a/mercurial/extensions.py	Sat Jul 04 12:12:36 2009 +0200
+++ b/mercurial/extensions.py	Sat Jul 04 12:25:10 2009 +0200
@@ -166,10 +166,6 @@
 
 def enabled():
     '''return a dict of {name: desc} of extensions, and the max name length'''
-
-    if not enabled:
-        return {}, 0
-
     exts = {}
     maxlength = 0
     exthelps = []
--- a/tests/test-hook	Sat Jul 04 12:12:36 2009 +0200
+++ b/tests/test-hook	Sat Jul 04 12:25:10 2009 +0200
@@ -230,4 +230,22 @@
 
 hg showconfig hooks | sed -e 's/ at .*>/>/'
 
+echo '# test python hook configured with python:[file]:[hook] syntax'
+cd ..
+mkdir d
+cd d
+hg init repo
+mkdir hooks
+
+cd hooks
+cat > testhooks.py <<EOF
+def testhook(**args):
+    print 'hook works'
+EOF
+echo '[hooks]' > ../repo/.hg/hgrc
+echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc
+
+cd ../repo
+hg commit
+
 exit 0
--- a/tests/test-hook.out	Sat Jul 04 12:12:36 2009 +0200
+++ b/tests/test-hook.out	Sat Jul 04 12:25:10 2009 +0200
@@ -160,3 +160,6 @@
 Automatically installed hook
 committed changeset 1:52998019f6252a2b893452765fcb0a47351a5708
 hooks.commit.auto=<function autohook>
+# test python hook configured with python:[file]:[hook] syntax
+hook works
+nothing changed