# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-03-15 12:07:03 # Node ID 4d5fb4062f0bb159230062701461fa6cab9b539b # Parent 5cbcbe51d38d8f518133b63153b4cb0c78cb0b28 remotenames: synchronise remotenames after push also Earlier we use to pull remotenames information from the server in case of pull and clone only. This patch adds logic to push also command to pull remotenames information. This will help us in keeping the remotenames more upto date where there are a lot people changing state of branches and bookmarks at the server. Differential Revision: https://phab.mercurial-scm.org/D2874 diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -531,6 +531,9 @@ def push(repo, remote, force=False, revs _pushobsolete(pushop) _pushbookmark(pushop) + if repo.ui.configbool('experimental', 'remotenames'): + logexchange.pullremotenames(repo, remote) + return pushop # list of steps to perform discovery before push diff --git a/tests/test-logexchange.t b/tests/test-logexchange.t --- a/tests/test-logexchange.t +++ b/tests/test-logexchange.t @@ -339,3 +339,59 @@ Local bookmark should take precedence ov default/bar 6:87d6d6676308 default/foo 3:62615734edd5 * foo 8:3e1487808078 + +Testing the remotenames sychronization during `hg push` +------------------------------------------------------- + + $ cd ../server/ + $ hg bookmark foo + moving bookmark 'foo' forward from 62615734edd5 + +After the push, default/foo should move to rev 8 + $ cd ../client/ + $ hg push + pushing to ssh://user@dummy/server + searching for changes + no changes found + [1] + $ hg log -Gr 'remotenames()' + @ changeset: 8:3e1487808078 + : branch: wat + : bookmark: foo + : tag: tip + : remote bookmark: default/foo + : hoisted name: foo + : remote branch: $TESTTMP/server2/wat + : remote branch: default/wat + : parent: 4:aa98ab95a928 + : user: test + : date: Thu Jan 01 00:00:00 1970 +0000 + : summary: added bar + : + : o changeset: 7:ec2426147f0e + : | remote branch: $TESTTMP/server2/default + : | remote branch: default/default + : | user: test + : | date: Thu Jan 01 00:00:00 1970 +0000 + : | summary: Added h + : | + : o changeset: 6:87d6d6676308 + :/ remote bookmark: $TESTTMP/server2/bar + : remote bookmark: default/bar + : hoisted name: bar + : user: test + : date: Thu Jan 01 00:00:00 1970 +0000 + : summary: Added g + : + o changeset: 3:62615734edd5 + | remote bookmark: $TESTTMP/server2/foo + ~ user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: Added d + + $ hg bookmarks + $TESTTMP/server2/bar 6:87d6d6676308 + $TESTTMP/server2/foo 3:62615734edd5 + default/bar 6:87d6d6676308 + default/foo 8:3e1487808078 + * foo 8:3e1487808078