Patchwork D2874: remotenames: synchronise remotenames after push also

login
register
mail settings
Submitter phabricator
Date March 15, 2018, 1:49 p.m.
Message ID <differential-rev-PHID-DREV-lsvx26mtzoqxpi7fyor4-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/29533/
State Superseded
Headers show

Comments

phabricator - March 15, 2018, 1:49 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2874

AFFECTED FILES
  mercurial/exchange.py
  tests/test-logexchange.t

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel
phabricator - April 11, 2018, 5:34 p.m.
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  I'm not crazy about the implementation. But for an experimental feature, I think it is fine. The bundle2 changes to do this right are definitely scope bloat.

INLINE COMMENTS

> exchange.py:491
> +    if repo.ui.configbool('experimental', 'remotenames'):
> +        logexchange.pullremotenames(repo, remote)
> +

In a bundle2 world, the news names would ideally be returned by a bundle2 part (this will require 2 extra round trips to the server as implemented). But I think this implementation is fine for an experimental feature.

Also, if the local repo doesn't have names from the remote, we'll never see them. At some point down the long shallow clone road, we'll need to consider what we should be about nodes we know exist remotely but aren't available locally. But this problem can be deferred for a while.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2874

To: pulkit, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
phabricator - May 18, 2018, 2:05 p.m.
pulkit added a comment.


  Irrespective of https://phab.mercurial-scm.org/D2873 and https://phab.mercurial-scm.org/D2875, this should be non-controversial and good to go.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2874

To: pulkit, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

diff --git a/tests/test-logexchange.t b/tests/test-logexchange.t
--- a/tests/test-logexchange.t
+++ b/tests/test-logexchange.t
@@ -376,19 +376,19 @@ 
      bar                       6:87d6d6676308
      foo                       9:aa6a885086c0
 
-XXX: remotebookmarks should have been updated after this push
   $ hg log -G
   @  changeset:   9:aa6a885086c0
   |  branch:      wat
   |  tag:         tip
+  |  remote bookmark:  default/foo
+  |  remote branch:  default/wat
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     added foobar
   |
   o  changeset:   8:3e1487808078
   |  branch:      wat
   |  remote branch:  $TESTTMP/server2/wat
-  |  remote branch:  default/wat
   |  parent:      4:aa98ab95a928
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
@@ -422,7 +422,6 @@ 
   o  changeset:   3:62615734edd5
   |  bookmark:    foo
   |  remote bookmark:  $TESTTMP/server2/foo
-  |  remote bookmark:  default/foo
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     Added d
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -484,6 +484,9 @@ 
         _pushobsolete(pushop)
         _pushbookmark(pushop)
 
+    if repo.ui.configbool('experimental', 'remotenames'):
+        logexchange.pullremotenames(repo, remote)
+
     return pushop
 
 # list of steps to perform discovery before push