diff tests/test-log.out @ 10960:ca739acf1a98

commands: add more robust support for 'hg log -b' (issue2078) Fixes issue2078 and adds tests to cover various 'hg log -b' uses. This change adds a localrepo.lookupbranch(key, remote=None) function. This will look up the branch of the revision with the given key. The algorithm works like this: * If a remote repo is given and KEY is the name of a branch in that repo, return KEY. * If no remote repo is given and KEY is the name of a branch in the local repo object, return KEY. * Otherwise look up the revision with the identifier KEY in the local repo and return its branch. This change also makes 'hg log -b' use this new functionality and adds a few tests for it.
author Steve Losh <steve@stevelosh.com>
date Mon, 12 Apr 2010 19:33:25 -0400
parents 0d5f139b23c1
children 51d0387523c6
line wrap: on
line diff
--- a/tests/test-log.out	Mon Apr 19 16:47:44 2010 -0500
+++ b/tests/test-log.out	Mon Apr 12 19:33:25 2010 -0400
@@ -360,6 +360,22 @@
 summary:     commit on test
 
 % log -b dummy
+abort: unknown revision 'dummy'!
+% log -b .
+changeset:   3:f5d8de11c2e2
+branch:      test
+tag:         tip
+parent:      1:d32277701ccb
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     commit on test
+
+changeset:   1:d32277701ccb
+branch:      test
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     commit on test
+
 % log -b default -b test
 changeset:   3:f5d8de11c2e2
 branch:      test
@@ -386,3 +402,56 @@
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     commit on default
 
+% log -b default -b .
+changeset:   3:f5d8de11c2e2
+branch:      test
+tag:         tip
+parent:      1:d32277701ccb
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     commit on test
+
+changeset:   2:c3a4f03cc9a7
+parent:      0:24427303d56f
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     commit on default
+
+changeset:   1:d32277701ccb
+branch:      test
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     commit on test
+
+changeset:   0:24427303d56f
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     commit on default
+
+% log -b . -b test
+changeset:   3:f5d8de11c2e2
+branch:      test
+tag:         tip
+parent:      1:d32277701ccb
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     commit on test
+
+changeset:   1:d32277701ccb
+branch:      test
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     commit on test
+
+% log -b 2
+changeset:   2:c3a4f03cc9a7
+parent:      0:24427303d56f
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     commit on default
+
+changeset:   0:24427303d56f
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+summary:     commit on default
+