# HG changeset patch # User David Soria Parra # Date 1235863801 -3600 # Node ID f420eafe59cdd14aa882d725eeb99f119bf37388 # Parent bcd364b247ba8c021cc02808a3ce868a7a63f672 bookmarks: Set current bookmark if we create a new one on the tip If track.current is enabled we set the newly created bookmark as the current tracked bookmark. We do not do this if a revision is specified. diff -r bcd364b247ba -r f420eafe59cd hgext/bookmarks.py --- a/hgext/bookmarks.py Mon Mar 02 19:19:12 2009 -0600 +++ b/hgext/bookmarks.py Sun Mar 01 00:30:01 2009 +0100 @@ -164,6 +164,7 @@ marks[mark] = repo.lookup(rev) else: marks[mark] = repo.changectx('.').node() + setcurrent(repo, mark) write(repo, marks) return diff -r bcd364b247ba -r f420eafe59cd tests/test-bookmarks-current --- a/tests/test-bookmarks-current Mon Mar 02 19:19:12 2009 -0600 +++ b/tests/test-bookmarks-current Sun Mar 01 00:30:01 2009 +0100 @@ -14,6 +14,9 @@ echo % set bookmark X hg bookmark X +echo % list bookmarks +hg bookmark + echo % update to bookmark X hg update X diff -r bcd364b247ba -r f420eafe59cd tests/test-bookmarks-current.out --- a/tests/test-bookmarks-current.out Mon Mar 02 19:19:12 2009 -0600 +++ b/tests/test-bookmarks-current.out Sun Mar 01 00:30:01 2009 +0100 @@ -1,6 +1,8 @@ % no bookmarks no bookmarks set % set bookmark X +% list bookmarks + * X -1:000000000000 % update to bookmark X 0 files updated, 0 files merged, 0 files removed, 0 files unresolved % list bookmarks @@ -10,9 +12,9 @@ * Z -1:000000000000 % new bookmark Y % list bookmarks - Y -1:000000000000 - * Z -1:000000000000 + * Y -1:000000000000 + Z -1:000000000000 % commit % list bookmarks - Y -1:000000000000 - * Z 0:719295282060 + * Y 0:719295282060 + Z -1:000000000000