bookmarks: ensure current bookmark is updated when specified with -r . stable
authorBrodie Rao <brodie@bitheap.org>
Wed, 14 Jul 2010 11:02:20 -0400
branchstable
changeset 11561 e5aaaef91a27
parent 11555 d8d0fc3988ca
child 11562 efbc09fdefd8
bookmarks: ensure current bookmark is updated when specified with -r . "hg bookmark -r . foo" should be equivalent to "hg bookmark foo".
hgext/bookmarks.py
tests/test-bookmarks-current
tests/test-bookmarks-current.out
--- a/hgext/bookmarks.py	Thu Jul 01 19:23:26 2010 -0500
+++ b/hgext/bookmarks.py	Wed Jul 14 11:02:20 2010 -0400
@@ -146,7 +146,7 @@
             marks[mark] = repo.lookup(rev)
         else:
             marks[mark] = repo.changectx('.').node()
-            setcurrent(repo, mark)
+        setcurrent(repo, mark)
         write(repo)
         return
 
--- a/tests/test-bookmarks-current	Thu Jul 01 19:23:26 2010 -0500
+++ b/tests/test-bookmarks-current	Wed Jul 14 11:02:20 2010 -0400
@@ -57,3 +57,8 @@
 echo % update to tip
 hg update tip
 
+echo % set bookmark Y using -r .
+hg bookmark -r . Y
+
+echo % list bookmarks
+hg bookmark
--- a/tests/test-bookmarks-current.out	Thu Jul 01 19:23:26 2010 -0500
+++ b/tests/test-bookmarks-current.out	Wed Jul 14 11:02:20 2010 -0400
@@ -25,3 +25,6 @@
 no bookmarks set
 % update to tip
 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+% set bookmark Y using -r .
+% list bookmarks
+ * Y                         0:719295282060