[PATCH v2] bookmarks: pull new bookmarks from remote by default
Levi Bard
taktaktaktaktaktaktaktaktaktak at gmail.com
Sat May 12 10:02:02 CDT 2012
# HG changeset patch
# User Levi Bard <levi at unity3d.com>
# Date 1336834801 -7200
# Node ID c3fe1f84a74161cd84ab2c85d78985429fed69c2
# Parent 76c744e0c5bbd0900beba49787b7e04ba862939b
bookmarks: pull new bookmarks from remote by default
diff -r 76c744e0c5bb -r c3fe1f84a741 mercurial/bookmarks.py
--- a/mercurial/bookmarks.py Sat May 12 13:20:26 2012 +0200
+++ b/mercurial/bookmarks.py Sat May 12 17:00:01 2012 +0200
@@ -221,6 +221,11 @@
repo._bookmarks[n] = cr.node()
changed = True
ui.warn(_("divergent bookmark %s stored as %s\n") % (k, n))
+ elif rb[k] in repo:
+ # add remote bookmarks for changes we already have
+ repo._bookmarks[k] = rb[k]
+ changed = True
+ ui.status(_("adding remote bookmark %s\n") % k)
if changed:
write(repo)
diff -r 76c744e0c5bb -r c3fe1f84a741 tests/test-bookmarks-pushpull.t
--- a/tests/test-bookmarks-pushpull.t Sat May 12 13:20:26 2012 +0200
+++ b/tests/test-bookmarks-pushpull.t Sat May 12 17:00:01 2012 +0200
@@ -29,6 +29,8 @@
adding file changes
added 1 changesets with 1 changes to 1 files
updating bookmark Y
+ adding remote bookmark X
+ adding remote bookmark Z
(run 'hg update' to get a working copy)
$ hg bookmarks
Y 0:4e3505fd9583
@@ -43,6 +45,8 @@
$ hg pull -B X ../a
pulling from ../a
no changes found
+ adding remote bookmark X
+ adding remote bookmark Z
importing bookmark X
$ hg bookmark
X 0:4e3505fd9583
@@ -122,6 +126,7 @@
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
divergent bookmark X stored as X at foo
+ adding remote bookmark Z
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg book
* X 1:9b140be10808
@@ -159,9 +164,9 @@
namespaces
$ hg debugpushkey http://localhost:$HGPORT/ bookmarks
Y 4e3505fd95835d721066b76e75dbb8cc554d7f77
+ foobar 9b140be1080824d768c5a4691a564088eede71f9
+ foo 0000000000000000000000000000000000000000
X 9b140be1080824d768c5a4691a564088eede71f9
- foo 0000000000000000000000000000000000000000
- foobar 9b140be1080824d768c5a4691a564088eede71f9
$ hg out -B http://localhost:$HGPORT/
comparing with http://localhost:$HGPORT/
searching for changed bookmarks
@@ -182,6 +187,9 @@
$ hg pull -B Z http://localhost:$HGPORT/
pulling from http://localhost:$HGPORT/
no changes found
+ adding remote bookmark foobar
+ adding remote bookmark Z
+ adding remote bookmark foo
divergent bookmark X stored as X at 1
importing bookmark Z
$ hg clone http://localhost:$HGPORT/ cloned-bookmarks
diff -r 76c744e0c5bb -r c3fe1f84a741 tests/test-hook.t
--- a/tests/test-hook.t Sat May 12 13:20:26 2012 +0200
+++ b/tests/test-hook.t Sat May 12 17:00:01 2012 +0200
@@ -195,6 +195,7 @@
no changes found
listkeys hook: HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'}
listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
+ adding remote bookmark bar
importing bookmark bar
$ cd ../a
@@ -279,6 +280,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
+ adding remote bookmark quux
(run 'hg update' to get a working copy)
$ hg rollback
repository tip rolled back to revision 3 (undo pull)
@@ -447,6 +449,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
+ adding remote bookmark quux
(run 'hg update' to get a working copy)
make sure --traceback works
More information about the Mercurial-devel
mailing list