diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -403,17 +403,15 @@ class changeset_printer(object): 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 @@ def identify(ui, repo): 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 @@ def tags(ui, repo): 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: diff --git a/tests/test-command-template.out b/tests/test-command-template.out --- a/tests/test-command-template.out +++ b/tests/test-command-template.out @@ -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 diff --git a/tests/test-copy.out b/tests/test-copy.out --- a/tests/test-copy.out +++ b/tests/test-copy.out @@ -2,7 +2,7 @@ A b 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 @@ description: 2 -changeset: 0:33aaa84a386bd609094aeb21a97c09436c482ef1 +changeset: 0:33aaa84a386b user: test date: Mon Jan 12 13:46:40 1970 +0000 files: a diff --git a/tests/test-filebranch.out b/tests/test-filebranch.out --- a/tests/test-filebranch.out +++ b/tests/test-filebranch.out @@ -31,10 +31,10 @@ main: we should have a merge here 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 diff --git a/tests/test-globalopts.out b/tests/test-globalopts.out --- a/tests/test-globalopts.out +++ b/tests/test-globalopts.out @@ -47,7 +47,7 @@ 0:b6c483daf290 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 @@ description: b -changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab +changeset: 0:8580ff50825a user: test date: Thu Jan 01 00:00:01 1970 +0000 files: a @@ -64,7 +64,7 @@ description: a -changeset: 0:b6c483daf2907ce5825c0bb50f5716226281cc1a +changeset: 0:b6c483daf290 tag: tip user: test date: Thu Jan 01 00:00:01 1970 +0000 diff --git a/tests/test-log.out b/tests/test-log.out --- a/tests/test-log.out +++ b/tests/test-log.out @@ -34,7 +34,7 @@ date: Thu Jan 01 00:00:01 1970 +0 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 @@ a % 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 @@ description: 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 @@ description: c -changeset: 1:c0296dabce9bf0cd3fdd608de26693c91cd6bbf4 +changeset: 1:c0296dabce9b user: test date: Thu Jan 01 00:00:02 1970 +0000 files: b @@ -68,7 +68,7 @@ description: b -changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab +changeset: 0:8580ff50825a user: test date: Thu Jan 01 00:00:01 1970 +0000 files: a diff --git a/tests/test-tags b/tests/test-tags --- a/tests/test-tags +++ b/tests/test-tags @@ -9,7 +9,7 @@ hg add a 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 diff --git a/tests/test-tags.out b/tests/test-tags.out --- a/tests/test-tags.out +++ b/tests/test-tags.out @@ -2,22 +2,22 @@ unknown 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 @@ 1 files updated, 0 files merged, 0 files .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 diff --git a/tests/test-up-local-change.out b/tests/test-up-local-change.out --- a/tests/test-up-local-change.out +++ b/tests/test-up-local-change.out @@ -64,7 +64,7 @@ user: test 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 @@ description: 2 -changeset: 0:33aaa84a386bd609094aeb21a97c09436c482ef1 +changeset: 0:33aaa84a386b user: test date: Mon Jan 12 13:46:40 1970 +0000 files: a