changeset 2966:fb493241d7f6

Only show long hashes with --debug, not --verbose
author Matt Mackall <mpm@selenic.com>
date Sun, 20 Aug 2006 22:51:56 -0500
parents 96d034d02d61
children eef469259745
files mercurial/commands.py tests/test-command-template.out tests/test-copy.out tests/test-filebranch.out tests/test-globalopts.out tests/test-log.out tests/test-tags tests/test-tags.out tests/test-up-local-change.out
diffstat 9 files changed, 46 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Aug 20 21:59:51 2006 -0500
+++ b/mercurial/commands.py	Sun Aug 20 22:51:56 2006 -0500
@@ -403,17 +403,15 @@
         changes = log.read(changenode)
         date = util.datestr(changes[2])
 
-        parents = [(log.rev(p), self.ui.verbose and hex(p) or short(p))
-                   for p in log.parents(changenode)
+        hexfunc = self.ui.debugflag and hex or short
+
+        parents = [(log.rev(p), hexfunc(p)) for p in log.parents(changenode)
                    if self.ui.debugflag or p != nullid]
         if (not self.ui.debugflag and len(parents) == 1 and
             parents[0][0] == rev-1):
             parents = []
 
-        if self.ui.verbose:
-            self.ui.write(_("changeset:   %d:%s\n") % (rev, hex(changenode)))
-        else:
-            self.ui.write(_("changeset:   %d:%s\n") % (rev, short(changenode)))
+        self.ui.write(_("changeset:   %d:%s\n") % (rev, hexfunc(changenode)))
 
         for tag in self.repo.nodetags(changenode):
             self.ui.status(_("tag:         %s\n") % tag)
@@ -1610,7 +1608,7 @@
         ui.write(_("unknown\n"))
         return
 
-    hexfunc = ui.verbose and hex or short
+    hexfunc = ui.debugflag and hex or short
     modified, added, removed, deleted = repo.status()[:4]
     output = ["%s%s" %
               ('+'.join([hexfunc(parent) for parent in parents]),
@@ -2618,9 +2616,10 @@
 
     l = repo.tagslist()
     l.reverse()
+    hexfunc = ui.debugflag and hex or short
     for t, n in l:
         try:
-            r = "%5d:%s" % (repo.changelog.rev(n), hex(n))
+            r = "%5d:%s" % (repo.changelog.rev(n), hexfunc(n))
         except KeyError:
             r = "    ?:?"
         if ui.quiet:
--- a/tests/test-command-template.out	Sun Aug 20 21:59:51 2006 -0500
+++ b/tests/test-command-template.out	Sun Aug 20 22:51:56 2006 -0500
@@ -1,4 +1,20 @@
 # default style is like normal output
+1c1
+< changeset:   3:10e46f2dcbf4
+---
+> changeset:   3:10e46f2dcbf4823578cf180f33ecf0b957964c47
+10c10
+< changeset:   2:97054abb4ab8
+---
+> changeset:   2:97054abb4ab824450e9164180baf491ae0078465
+18c18
+< changeset:   1:b608e9d1a3f0
+---
+> changeset:   1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965
+29c29
+< changeset:   0:1e4e1b8f71e0
+---
+> changeset:   0:1e4e1b8f71e05681d422154f5421e385fec3454f
 18a19
 > files:       
 29a31
--- a/tests/test-copy.out	Sun Aug 20 21:59:51 2006 -0500
+++ b/tests/test-copy.out	Sun Aug 20 22:51:56 2006 -0500
@@ -2,7 +2,7 @@
 b
  b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
 we should see two history entries
-changeset:   1:386a3cc01532710ca78aed9a54fa2f459c04f29c
+changeset:   1:386a3cc01532
 tag:         tip
 user:        test
 date:        Mon Jan 12 13:46:40 1970 +0000
@@ -11,7 +11,7 @@
 2
 
 
-changeset:   0:33aaa84a386bd609094aeb21a97c09436c482ef1
+changeset:   0:33aaa84a386b
 user:        test
 date:        Mon Jan 12 13:46:40 1970 +0000
 files:       a
--- a/tests/test-filebranch.out	Sun Aug 20 21:59:51 2006 -0500
+++ b/tests/test-filebranch.out	Sun Aug 20 22:51:56 2006 -0500
@@ -31,10 +31,10 @@
      2       150      71      2       2 a6aef98656b7 c36078bec30d 000000000000
      3       221      72      3       3 0c2cc6fc80e2 182b283965f1 a6aef98656b7
 log should show foo and quux changed
-changeset:   3:0c2cc6fc80e2d4ee289bb658dbbe9ad932380fe9
+changeset:   3:0c2cc6fc80e2
 tag:         tip
-parent:      1:182b283965f1069c0112784e30e7755ad1c0dd52
-parent:      2:a6aef98656b71154cae9d87408abe6d0218c8045
+parent:      1:182b283965f1
+parent:      2:a6aef98656b7
 user:        test
 date:        Mon Jan 12 13:46:40 1970 +0000
 files:       foo quux
--- a/tests/test-globalopts.out	Sun Aug 20 21:59:51 2006 -0500
+++ b/tests/test-globalopts.out	Sun Aug 20 22:51:56 2006 -0500
@@ -47,7 +47,7 @@
 0:8580ff50825a
 1:b6c483daf290
 %% -v/--verbose
-changeset:   1:b6c483daf2907ce5825c0bb50f5716226281cc1a
+changeset:   1:b6c483daf290
 tag:         tip
 user:        test
 date:        Thu Jan 01 00:00:01 1970 +0000
@@ -56,7 +56,7 @@
 b
 
 
-changeset:   0:8580ff50825a50c8f716709acdf8de0deddcd6ab
+changeset:   0:8580ff50825a
 user:        test
 date:        Thu Jan 01 00:00:01 1970 +0000
 files:       a
@@ -64,7 +64,7 @@
 a
 
 
-changeset:   0:b6c483daf2907ce5825c0bb50f5716226281cc1a
+changeset:   0:b6c483daf290
 tag:         tip
 user:        test
 date:        Thu Jan 01 00:00:01 1970 +0000
--- a/tests/test-log.out	Sun Aug 20 21:59:51 2006 -0500
+++ b/tests/test-log.out	Sun Aug 20 22:51:56 2006 -0500
@@ -34,7 +34,7 @@
 summary:     a
 
 % one rename
-changeset:   0:8580ff50825a50c8f716709acdf8de0deddcd6ab
+changeset:   0:8580ff50825a
 user:        test
 date:        Thu Jan 01 00:00:01 1970 +0000
 files:       a
@@ -43,7 +43,7 @@
 
 
 % many renames
-changeset:   4:8c1c8408f7371319750ea2d4fa7969828effbcf4
+changeset:   4:8c1c8408f737
 tag:         tip
 user:        test
 date:        Thu Jan 01 00:00:05 1970 +0000
@@ -52,7 +52,7 @@
 e
 
 
-changeset:   2:21fba396af4c801f9717de6c415b6cc9620437e8
+changeset:   2:21fba396af4c
 user:        test
 date:        Thu Jan 01 00:00:03 1970 +0000
 files:       b dir/b
@@ -60,7 +60,7 @@
 c
 
 
-changeset:   1:c0296dabce9bf0cd3fdd608de26693c91cd6bbf4
+changeset:   1:c0296dabce9b
 user:        test
 date:        Thu Jan 01 00:00:02 1970 +0000
 files:       b
@@ -68,7 +68,7 @@
 b
 
 
-changeset:   0:8580ff50825a50c8f716709acdf8de0deddcd6ab
+changeset:   0:8580ff50825a
 user:        test
 date:        Thu Jan 01 00:00:01 1970 +0000
 files:       a
--- a/tests/test-tags	Sun Aug 20 21:59:51 2006 -0500
+++ b/tests/test-tags	Sun Aug 20 22:51:56 2006 -0500
@@ -9,7 +9,7 @@
 hg commit -m "test" -d "1000000 0"
 hg co
 hg identify
-T=`hg tip -v | head -n 1 | cut -d : -f 3`
+T=`hg tip --debug | head -n 1 | cut -d : -f 3`
 echo "$T first" > .hgtags
 cat .hgtags
 hg add .hgtags
--- a/tests/test-tags.out	Sun Aug 20 21:59:51 2006 -0500
+++ b/tests/test-tags.out	Sun Aug 20 22:51:56 2006 -0500
@@ -2,22 +2,22 @@
 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 0acdaf898367 tip
 0acdaf8983679e0aac16e811534eb49d7ee1f2b4 first
-tip                                1:8a3ca90d111dc784e6575d373105be12570e8776
-first                              0:0acdaf8983679e0aac16e811534eb49d7ee1f2b4
+tip                                1:8a3ca90d111d
+first                              0:0acdaf898367
 8a3ca90d111d tip
 M a
 8a3ca90d111d+ tip
 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 0acdaf898367+ first
-0acdaf8983679e0aac16e811534eb49d7ee1f2b4+ first
+0acdaf898367+ first
 M a
 8216907a933d tip
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 8216907a933d+8a3ca90d111d+ tip
 M .hgtags
-tip                                6:c6af9d771a81bb9c7f267ec03491224a9f8ba1cd
-first                              0:0acdaf8983679e0aac16e811534eb49d7ee1f2b4
+tip                                6:c6af9d771a81
+first                              0:0acdaf898367
 .hgtags (rev 7:39bba1bbbc4c), line 2: cannot parse entry
 .hgtags (rev 7:39bba1bbbc4c), line 4: node 'foo' is not well formed
 localtags, line 1: tag 'invalid' refers to unknown node
@@ -26,8 +26,8 @@
 .hgtags (rev 7:39bba1bbbc4c), line 4: node 'foo' is not well formed
 .hgtags (rev 8:4ca6f1b1a68c), line 2: node 'x' is not well formed
 localtags, line 1: tag 'invalid' refers to unknown node
-tip                                8:4ca6f1b1a68c77be687a03aaeb1614671ba59b20
-first                              0:0acdaf8983679e0aac16e811534eb49d7ee1f2b4
+tip                                8:4ca6f1b1a68c
+first                              0:0acdaf898367
 changeset:   8:4ca6f1b1a68c
 .hgtags (rev 7:39bba1bbbc4c), line 2: cannot parse entry
 .hgtags (rev 7:39bba1bbbc4c), line 4: node 'foo' is not well formed
--- a/tests/test-up-local-change.out	Sun Aug 20 21:59:51 2006 -0500
+++ b/tests/test-up-local-change.out	Sun Aug 20 22:51:56 2006 -0500
@@ -64,7 +64,7 @@
 date:        Mon Jan 12 13:46:40 1970 +0000
 summary:     2
 
-changeset:   1:802f095af299cde27a85b2f056aef3829870956c
+changeset:   1:802f095af299
 tag:         tip
 user:        test
 date:        Mon Jan 12 13:46:40 1970 +0000
@@ -73,7 +73,7 @@
 2
 
 
-changeset:   0:33aaa84a386bd609094aeb21a97c09436c482ef1
+changeset:   0:33aaa84a386b
 user:        test
 date:        Mon Jan 12 13:46:40 1970 +0000
 files:       a