Patchwork D1607: remotenames: rename related file and storage dir to logexchange

login
register
mail settings
Submitter phabricator
Date Dec. 9, 2017, 7:33 p.m.
Message ID <6271665d2944c93e2c902ab75fa8284d@localhost.localdomain>
Download mbox | patch
Permalink /patch/26140/
State Not Applicable
Headers show

Comments

phabricator - Dec. 9, 2017, 7:33 p.m.
pulkit updated this revision to Diff 4289.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1607?vs=4162&id=4289

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

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

CHANGE DETAILS




To: pulkit, #hg-reviewers, krbullock
Cc: krbullock, durin42, smf, mercurial-devel

Patch

diff --git a/tests/test-remotenames.t b/tests/test-logexchange.t
rename from tests/test-remotenames.t
rename to tests/test-logexchange.t
--- a/tests/test-remotenames.t
+++ b/tests/test-logexchange.t
@@ -54,13 +54,13 @@ 
   8 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
   $ cd client
-  $ cat .hg/remotenames/bookmarks
+  $ cat .hg/logexchange/bookmarks
   0
   
   87d6d66763085b629e6d7ed56778c79827273022\x00file:$TESTTMP/server\x00bar (esc)
   62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00file:$TESTTMP/server\x00foo (esc)
 
-  $ cat .hg/remotenames/branches
+  $ cat .hg/logexchange/branches
   0
   
   ec2426147f0e39dbc9cef599b066be6035ce691d\x00file:$TESTTMP/server\x00default (esc)
@@ -91,15 +91,15 @@ 
   pulling from ../server2/
   searching for changes
   no changes found
-  $ cat .hg/remotenames/bookmarks
+  $ cat .hg/logexchange/bookmarks
   0
   
   62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00file:$TESTTMP/server\x00foo (esc)
   87d6d66763085b629e6d7ed56778c79827273022\x00file:$TESTTMP/server\x00bar (esc)
   87d6d66763085b629e6d7ed56778c79827273022\x00file:$TESTTMP/server2\x00bar (esc)
   62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00file:$TESTTMP/server2\x00foo (esc)
 
-  $ cat .hg/remotenames/branches
+  $ cat .hg/logexchange/branches
   0
   
   3e1487808078543b0af6d10dadf5d46943578db0\x00file:$TESTTMP/server\x00wat (esc)
diff --git a/mercurial/remotenames.py b/mercurial/logexchange.py
rename from mercurial/remotenames.py
rename to mercurial/logexchange.py
--- a/mercurial/remotenames.py
+++ b/mercurial/logexchange.py
@@ -1,4 +1,4 @@ 
-# remotenames.py
+# logexchange.py
 #
 # Copyright 2017 Augie Fackler <raf@durin42.com>
 # Copyright 2017 Sean Farley <sean@farley.io>
@@ -15,11 +15,11 @@ 
 )
 
 # directory name in .hg/ in which remotenames files will be present
-remotenamedir = 'remotenames'
+remotenamedir = 'logexchange'
 
 def readremotenamefile(repo, filename):
     """
-    reads a file from .hg/remotenames/ directory and yields it's content
+    reads a file from .hg/logexchange/ directory and yields it's content
     filename: the file to be read
     yield a tuple (node, remotepath, name)
     """
@@ -46,7 +46,7 @@ 
 
 def readremotenames(repo):
     """
-    read the details about the remotenames stored in .hg/remotenames/ and
+    read the details about the remotenames stored in .hg/logexchange/ and
     yields a tuple (node, remotepath, name). It does not yields information
     about whether an entry yielded is branch or bookmark. To get that
     information, call the respective functions.
@@ -83,7 +83,7 @@ 
 def saveremotenames(repo, remotepath, branches=None, bookmarks=None):
     """
     save remotenames i.e. remotebookmarks and remotebranches in their
-    respective files under ".hg/remotenames/" directory.
+    respective files under ".hg/logexchange/" directory.
     """
     wlock = repo.wlock()
     try:
diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -28,10 +28,10 @@ 
     httppeer,
     localrepo,
     lock,
+    logexchange,
     merge as mergemod,
     node,
     phases,
-    remotenames,
     repoview,
     scmutil,
     sshpeer,
@@ -691,7 +691,7 @@ 
             destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone')
 
             if ui.configbool('experimental', 'remotenames'):
-                remotenames.pullremotenames(destrepo, srcpeer)
+                logexchange.pullremotenames(destrepo, srcpeer)
 
             if update:
                 if update is not True:
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -24,11 +24,11 @@ 
     discovery,
     error,
     lock as lockmod,
+    logexchange,
     obsolete,
     phases,
     pushkey,
     pycompat,
-    remotenames,
     scmutil,
     sslutil,
     streamclone,
@@ -1366,7 +1366,7 @@ 
 
     # storing remotenames
     if repo.ui.configbool('experimental', 'remotenames'):
-        remotenames.pullremotenames(repo, remote)
+        logexchange.pullremotenames(repo, remote)
 
     return pullop