diff --git a/hggit/git_handler.py b/hggit/git_handler.py index 3e00c50bf7863ebed47413d47f88b6328e8574fe_aGdnaXQvZ2l0X2hhbmRsZXIucHk=..c0fcc15f13a396f062709ead4c251b02efce923b_aGdnaXQvZ2l0X2hhbmRsZXIucHk= 100644 --- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -1404,7 +1404,10 @@ else: hgsha = None - if head not in bms: + if bms.get(head) == hgsha: + self.ui.debug(_("bookmark %s is up-to-date\n") % head) + + elif head not in bms: # new branch changes.append((head + suffix, hgsha)) @@ -1408,6 +1411,10 @@ # new branch changes.append((head + suffix, hgsha)) + # only log additions on subsequent pulls + if self.remote_refs: + self.ui.status(_("adding bookmark %s\n") % head) + elif sha is None: bm = self.repo[bms[head]] cur = self.remote_refs.get(b'%s/%s' % (remote_name, head)) @@ -1415,9 +1422,14 @@ # only delete unmoved bookmarks if cur == bm.node(): changes.append((head + suffix, hgsha)) + self.ui.status(_("deleting bookmark %s\n") % head) + else: + self.ui.status( + _("not deleting diverged bookmark %s\n") % head + ) else: bm = self.repo[bms[head]] if bm.ancestor(self.repo[hgsha]) == bm: # fast forward changes.append((head + suffix, hgsha)) @@ -1418,9 +1430,14 @@ else: bm = self.repo[bms[head]] if bm.ancestor(self.repo[hgsha]) == bm: # fast forward changes.append((head + suffix, hgsha)) + self.ui.status(_("updating bookmark %s\n") % head) + else: + self.ui.status( + _("not updating diverged bookmark %s\n") % head + ) if heads: util.updatebookmarks(self.repo, changes) diff --git a/tests/test-bookmark-workflow.t b/tests/test-bookmark-workflow.t index 3e00c50bf7863ebed47413d47f88b6328e8574fe_dGVzdHMvdGVzdC1ib29rbWFyay13b3JrZmxvdy50..c0fcc15f13a396f062709ead4c251b02efce923b_dGVzdHMvdGVzdC1ib29rbWFyay13b3JrZmxvdy50 100644 --- a/tests/test-bookmark-workflow.t +++ b/tests/test-bookmark-workflow.t @@ -222,6 +222,9 @@ $ hg pull pulling from $TESTTMP/gitremoterepo importing git objects into hg + not updating diverged bookmark b1 + adding bookmark b3 + adding bookmark b4 (run 'hg update' to get a working copy) $ cd .. @@ -235,6 +238,7 @@ $ hg pull pulling from $TESTTMP/gitremoterepo no changes found + not deleting diverged bookmark b1 $ hggitstate 4 0ac7ec7b4113 fcfd2c0262db "add epsilon" bookmarks: [b4] (draft) 3 03769a650ded 55b133e1d558 "add delta" bookmarks: [b3 master] (public) @@ -251,6 +255,7 @@ $ hg pull pulling from $TESTTMP/gitremoterepo no changes found + updating bookmark b1 $ cd ../gitremoterepo $ git branch -d b1 Deleted branch b1 (was 9497a4e). @@ -258,6 +263,7 @@ $ hg pull pulling from $TESTTMP/gitremoterepo no changes found + deleting bookmark b1 $ hggitstate 4 0ac7ec7b4113 fcfd2c0262db "add epsilon" bookmarks: [b4] (draft) 3 03769a650ded 55b133e1d558 "add delta" bookmarks: [b3 master] (public) @@ -303,6 +309,7 @@ $ hg pull pulling from $TESTTMP/gitremoterepo importing git objects into hg + adding bookmark b5 (run 'hg heads' to see heads, 'hg merge' to merge) The new branches shouldn't be published! @@ -326,6 +333,7 @@ $ hg pull pulling from $TESTTMP/gitremoterepo no changes found + updating bookmark master $ hg phase b5 5: draft $ hg phase master @@ -341,6 +349,7 @@ $ hg pull pulling from $TESTTMP/gitremoterepo importing git objects into hg + updating bookmark master (run 'hg update' to get a working copy) $ hggitstate 6 7ac86d6e9d1d 842c1e660ab3 "Merge branch 'b5'" bookmarks: [master] (public) diff --git a/tests/test-clone.t b/tests/test-clone.t index 3e00c50bf7863ebed47413d47f88b6328e8574fe_dGVzdHMvdGVzdC1jbG9uZS50..c0fcc15f13a396f062709ead4c251b02efce923b_dGVzdHMvdGVzdC1jbG9uZS50 100644 --- a/tests/test-clone.t +++ b/tests/test-clone.t @@ -92,6 +92,8 @@ $ hg -R hgrepo-shared pull gitrepo pulling from gitrepo no changes found + adding bookmark beta + adding bookmark master $ hg -R hgrepo-shared push gitrepo pushing to gitrepo searching for changes diff --git a/tests/test-git-workflow.t b/tests/test-git-workflow.t index 3e00c50bf7863ebed47413d47f88b6328e8574fe_dGVzdHMvdGVzdC1naXQtd29ya2Zsb3cudA==..c0fcc15f13a396f062709ead4c251b02efce923b_dGVzdHMvdGVzdC1naXQtd29ya2Zsb3cudA== 100644 --- a/tests/test-git-workflow.t +++ b/tests/test-git-workflow.t @@ -50,6 +50,7 @@ get things back to hg $ hg gimport importing git objects into hg + updating bookmark master $ hg log --graph --debug | grep -v phase: o changeset: 1:9f124f3c1fc29a14f5eb027c24811b0ac9d5ff10 | bookmark: master @@ -115,6 +116,7 @@ > git commit -m newcommit > /dev/null || echo "git commit error" $ hg gimport importing git objects into hg + updating bookmark master $ hg log --graph o changeset: 3:3d10b7289d79 | bookmark: master diff --git a/tests/test-incoming.t b/tests/test-incoming.t index 3e00c50bf7863ebed47413d47f88b6328e8574fe_dGVzdHMvdGVzdC1pbmNvbWluZy50..c0fcc15f13a396f062709ead4c251b02efce923b_dGVzdHMvdGVzdC1pbmNvbWluZy50 100644 --- a/tests/test-incoming.t +++ b/tests/test-incoming.t @@ -137,6 +137,8 @@ $ hg pull | grep -v "adding remote bookmark" pulling from $TESTTMP/gitrepo importing git objects into hg + adding bookmark b1 + updating bookmark master (run 'hg heads' to see heads, 'hg merge' to merge) $ hg incoming | grep -v 'no changes found' comparing with $TESTTMP/gitrepo diff --git a/tests/test-outgoing.t b/tests/test-outgoing.t index 3e00c50bf7863ebed47413d47f88b6328e8574fe_dGVzdHMvdGVzdC1vdXRnb2luZy50..c0fcc15f13a396f062709ead4c251b02efce923b_dGVzdHMvdGVzdC1vdXRnb2luZy50 100644 --- a/tests/test-outgoing.t +++ b/tests/test-outgoing.t @@ -97,6 +97,7 @@ $ hg pull 2>&1 | grep -v 'divergent bookmark' pulling from */gitrepo (glob) importing git objects into hg + not updating diverged bookmark master (run 'hg heads' to see heads, 'hg merge' to merge) $ hg outgoing | grep -v 'searching for changes' comparing with */gitrepo (glob) diff --git a/tests/test-pull-after-strip.t b/tests/test-pull-after-strip.t index 3e00c50bf7863ebed47413d47f88b6328e8574fe_dGVzdHMvdGVzdC1wdWxsLWFmdGVyLXN0cmlwLnQ=..c0fcc15f13a396f062709ead4c251b02efce923b_dGVzdHMvdGVzdC1wdWxsLWFmdGVyLXN0cmlwLnQ= 100644 --- a/tests/test-pull-after-strip.t +++ b/tests/test-pull-after-strip.t @@ -74,6 +74,7 @@ $ hg pull -r beta | grep -v "adding remote bookmark" pulling from $TESTTMP/gitrepo importing git objects into hg + updating bookmark beta (run 'hg update' to get a working copy) $ hg log --graph o changeset: 2:cc1e605d90db diff --git a/tests/test-pull.t b/tests/test-pull.t index 3e00c50bf7863ebed47413d47f88b6328e8574fe_dGVzdHMvdGVzdC1wdWxsLnQ=..c0fcc15f13a396f062709ead4c251b02efce923b_dGVzdHMvdGVzdC1wdWxsLnQ= 100644 --- a/tests/test-pull.t +++ b/tests/test-pull.t @@ -50,8 +50,9 @@ $ hg -R hgrepo pull -r epsilon pulling from $TESTTMP/gitrepo no changes found + adding bookmark epsilon pull a branch $ hg -R hgrepo pull -r beta pulling from $TESTTMP/gitrepo importing git objects into hg @@ -53,8 +54,9 @@ pull a branch $ hg -R hgrepo pull -r beta pulling from $TESTTMP/gitrepo importing git objects into hg + adding bookmark beta (run 'hg update' to get a working copy) $ hg -R hgrepo log --graph o changeset: 1:7fe02317c63d @@ -89,6 +91,8 @@ $ hg -R hgrepo pull pulling from $TESTTMP/gitrepo importing git objects into hg + adding bookmark delta + updating bookmark master (run 'hg heads' to see heads, 'hg merge' to merge) $ hg -R hgrepo log --graph o changeset: 3:6f898ad1f3e1 @@ -139,6 +143,8 @@ $ hg -R hgrepo pull pulling from $TESTTMP/gitrepo importing git objects into hg + deleting bookmark beta + updating bookmark master (run 'hg update' to get a working copy) $ hg -R hgrepo log --graph o changeset: 4:a02330f767a4 @@ -199,6 +205,8 @@ $ hg -R hgrepo pull -r 'releases/*' pulling from $TESTTMP/gitrepo importing git objects into hg + adding bookmark releases/v1 + adding bookmark releases/v2 (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg -R hgrepo log --graph o changeset: 6:a3f95e150b0a @@ -306,6 +314,7 @@ $ hg -R hgrepo pull pulling from $TESTTMP/gitrepo importing git objects into hg + updating bookmark master (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg -R hgrepo heads changeset: 9:e103a73f33be diff --git a/tests/test-push.t b/tests/test-push.t index 3e00c50bf7863ebed47413d47f88b6328e8574fe_dGVzdHMvdGVzdC1wdXNoLnQ=..c0fcc15f13a396f062709ead4c251b02efce923b_dGVzdHMvdGVzdC1wdXNoLnQ= 100644 --- a/tests/test-push.t +++ b/tests/test-push.t @@ -72,6 +72,7 @@ $ hg pull 2>&1 | grep -v 'divergent bookmark' pulling from $TESTTMP/gitrepo importing git objects into hg + not updating diverged bookmark master (run 'hg heads' to see heads, 'hg merge' to merge) TODO shouldn't need to do this since we're (in theory) pushing master explicitly, which should not implicitly also push the not-master ref. diff --git a/tests/test-subrepos.t b/tests/test-subrepos.t index 3e00c50bf7863ebed47413d47f88b6328e8574fe_dGVzdHMvdGVzdC1zdWJyZXBvcy50..c0fcc15f13a396f062709ead4c251b02efce923b_dGVzdHMvdGVzdC1zdWJyZXBvcy50 100644 --- a/tests/test-subrepos.t +++ b/tests/test-subrepos.t @@ -101,6 +101,7 @@ $ hg pull pulling from $TESTTMP/gitrepo1 importing git objects into hg + updating bookmark master (run 'hg update' to get a working copy) $ hg checkout -C | egrep -v '^\(activating bookmark master\)$' updating to active bookmark master