changeset 3830:4e488ccc8120

Merge with crew
author Matt Mackall <mpm@selenic.com>
date Fri, 08 Dec 2006 15:05:39 -0600
parents 531c116b2028 (current diff) ed5a9b27bedc (diff)
children 63f8f74ac4a8
files mercurial/commands.py
diffstat 8 files changed, 68 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Fri Dec 08 14:55:45 2006 -0600
+++ b/hgext/mq.py	Fri Dec 08 15:05:39 2006 -0600
@@ -2043,13 +2043,10 @@
 
             return tagscache
 
-        def branchtags(self):
-            if self.branchcache != None:
-                return self.branchcache
-
+        def _branchtags(self):
             q = self.mq
             if not q.applied:
-                return super(mqrepo, self).branchtags()
+                return super(mqrepo, self)._branchtags()
 
             self.branchcache = {} # avoid recursion in changectx
             cl = self.changelog
@@ -2069,8 +2066,7 @@
             # update the cache up to the tip
             self._updatebranchcache(partial, start, cl.count())
 
-            self.branchcache = partial
-            return self.branchcache
+            return partial
 
     if repo.local():
         repo.__class__ = mqrepo
--- a/mercurial/cmdutil.py	Fri Dec 08 14:55:45 2006 -0600
+++ b/mercurial/cmdutil.py	Fri Dec 08 15:05:39 2006 -0600
@@ -18,7 +18,7 @@
     be None, meaning use working dir.'''
 
     def revfix(repo, val, defval):
-        if not val and val != 0:
+        if not val and val != 0 and defval is not None:
             val = defval
         return repo.lookup(val)
 
@@ -261,6 +261,7 @@
         self.ui.write(_("changeset:   %d:%s\n") % (rev, hexfunc(changenode)))
 
         if branch:
+            branch = util.tolocal(branch)
             self.ui.write(_("branch:      %s\n") % branch)
         for tag in self.repo.nodetags(changenode):
             self.ui.write(_("tag:         %s\n") % tag)
@@ -404,6 +405,7 @@
         def showbranches(**args):
             branch = changes[5].get("branch")
             if branch:
+                branch = util.tolocal(branch)
                 return showlist('branch', [branch], plural='branches', **args)
             # add old style branches if requested
             if self.brinfo:
--- a/mercurial/commands.py	Fri Dec 08 14:55:45 2006 -0600
+++ b/mercurial/commands.py	Fri Dec 08 15:05:39 2006 -0600
@@ -2437,10 +2437,7 @@
 ]
 
 table = {
-    "^add":
-        (add,
-         walkopts + dryrunopts,
-         _('hg add [OPTION]... [FILE]...')),
+    "^add": (add, walkopts + dryrunopts, _('hg add [OPTION]... [FILE]...')),
     "addremove":
         (addremove,
          [('s', 'similarity', '',
@@ -2534,15 +2531,15 @@
     "debugcheckstate": (debugcheckstate, [], _('debugcheckstate')),
     "debugsetparents": (debugsetparents, [], _('debugsetparents REV1 [REV2]')),
     "debugstate": (debugstate, [], _('debugstate')),
-    "debugdate": (debugdate,
-                  [('e','extended', None, _('try extended date formats'))],
-                  _('debugdata [-e] DATE [RANGE]')),
+    "debugdate":
+        (debugdate,
+         [('e', 'extended', None, _('try extended date formats'))],
+         _('debugdate [-e] DATE [RANGE]')),
     "debugdata": (debugdata, [], _('debugdata FILE REV')),
     "debugindex": (debugindex, [], _('debugindex FILE')),
     "debugindexdot": (debugindexdot, [], _('debugindexdot FILE')),
     "debugrename": (debugrename, [], _('debugrename FILE [REV]')),
-    "debugwalk":
-        (debugwalk, walkopts, _('debugwalk [OPTION]... [FILE]...')),
+    "debugwalk": (debugwalk, walkopts, _('debugwalk [OPTION]... [FILE]...')),
     "^diff":
         (diff,
          [('r', 'rev', [], _('revision')),
--- a/mercurial/localrepo.py	Fri Dec 08 14:55:45 2006 -0600
+++ b/mercurial/localrepo.py	Fri Dec 08 15:05:39 2006 -0600
@@ -312,12 +312,7 @@
                 self.nodetagscache.setdefault(n, []).append(t)
         return self.nodetagscache.get(node, [])
 
-    def branchtags(self):
-        if self.branchcache != None:
-            return self.branchcache
-
-        self.branchcache = {} # avoid recursion in changectx
-
+    def _branchtags(self):
         partial, last, lrev = self._readbranchcache()
 
         tiprev = self.changelog.count() - 1
@@ -325,6 +320,15 @@
             self._updatebranchcache(partial, lrev+1, tiprev+1)
             self._writebranchcache(partial, self.changelog.tip(), tiprev)
 
+        return partial
+
+    def branchtags(self):
+        if self.branchcache is not None:
+            return self.branchcache
+
+        self.branchcache = {} # avoid recursion in changectx
+        partial = self._branchtags()
+
         # the branch cache is stored on disk as UTF-8, but in the local
         # charset internally
         for k, v in partial.items():
--- a/tests/test-diffdir	Fri Dec 08 14:55:45 2006 -0600
+++ b/tests/test-diffdir	Fri Dec 08 15:05:39 2006 -0600
@@ -13,3 +13,8 @@
 
 echo foo > a
 hg diff --nodates
+
+hg diff -r ""
+hg diff -r tip -r ""
+
+true
--- a/tests/test-diffdir.out	Fri Dec 08 14:55:45 2006 -0600
+++ b/tests/test-diffdir.out	Fri Dec 08 15:05:39 2006 -0600
@@ -18,3 +18,5 @@
 +++ b/b
 @@ -0,0 +1,1 @@
 +123
+abort: Ambiguous identifier!
+abort: Ambiguous identifier!
--- a/tests/test-encoding	Fri Dec 08 14:55:45 2006 -0600
+++ b/tests/test-encoding	Fri Dec 08 15:05:39 2006 -0600
@@ -25,6 +25,9 @@
 HGENCODING=utf-8 hg ci -l utf-8 -d "0 0"
 
 HGENCODING=latin-1 hg tag -d "0 0" `cat latin-1-tag`
+cp latin-1-tag .hg/branch
+HGENCODING=latin-1 hg ci -d "0 0" -m 'latin1 branch'
+rm .hg/branch
 
 echo % ascii
 hg --encoding ascii log
@@ -38,3 +41,9 @@
 HGENCODING=latin-1 hg tags
 echo % utf-8
 HGENCODING=utf-8 hg tags
+echo % ascii
+HGENCODING=ascii hg branches
+echo % latin-1
+HGENCODING=latin-1 hg branches
+echo % utf-8
+HGENCODING=utf-8 hg branches
--- a/tests/test-encoding.out	Fri Dec 08 14:55:45 2006 -0600
+++ b/tests/test-encoding.out	Fri Dec 08 15:05:39 2006 -0600
@@ -15,8 +15,14 @@
 rollback completed
 % these should work
 % ascii
+changeset:   4:d8a5d9eaf41e
+branch:      ?
+tag:         tip
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     latin1 branch
+
 changeset:   3:5edfc7acb541
-tag:         tip
 user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     Added tag ? for changeset 91878608adb3
@@ -38,8 +44,14 @@
 summary:     latin-1 e': ?
 
 % latin-1
+changeset:   4:d8a5d9eaf41e
+branch:      é
+tag:         tip
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     latin1 branch
+
 changeset:   3:5edfc7acb541
-tag:         tip
 user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     Added tag é for changeset 91878608adb3
@@ -61,8 +73,14 @@
 summary:     latin-1 e': é
 
 % utf-8
+changeset:   4:d8a5d9eaf41e
+branch:      é
+tag:         tip
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     latin1 branch
+
 changeset:   3:5edfc7acb541
-tag:         tip
 user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     Added tag é for changeset 91878608adb3
@@ -84,11 +102,17 @@
 summary:     latin-1 e': é
 
 % ascii
-tip                                3:5edfc7acb541
+tip                                4:d8a5d9eaf41e
 ?                                  2:91878608adb3
 % latin-1
-tip                                3:5edfc7acb541
+tip                                4:d8a5d9eaf41e
 é                                  2:91878608adb3
 % utf-8
-tip                                3:5edfc7acb541
+tip                                4:d8a5d9eaf41e
 é                                  2:91878608adb3
+% ascii
+?                              4:d8a5d9eaf41e
+% latin-1
+é                              4:d8a5d9eaf41e
+% utf-8
+é                              4:d8a5d9eaf41e