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

login
register
mail settings
Submitter phabricator
Date Dec. 6, 2017, 10:51 p.m.
Message ID <0822cb3070b05a7665dca8168c2f146b@localhost.localdomain>
Download mbox | patch
Permalink /patch/25983/
State Not Applicable
Headers show

Comments

phabricator - Dec. 6, 2017, 10:51 p.m.
pulkit updated this revision to Diff 4162.
pulkit edited the summary of this revision.
pulkit retitled this revision from "remotenames: rename the file to logexchange" to "remotenames: rename related file and storage dir to logexchange".

REPOSITORY
  rHG Mercurial

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

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

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

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: durin42, smf, mercurial-devel
Sean Farley - Dec. 8, 2017, 8:08 a.m.
pulkit (Pulkit Goyal) <phabricator@mercurial-scm.org> writes:

> pulkit updated this revision to Diff 4162.
> pulkit edited the summary of this revision.
> pulkit retitled this revision from "remotenames: rename the file to logexchange" to "remotenames: rename related file and storage dir to logexchange".

This is better than before. Though, I'm still opposed to skipping hgext/.

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
@@ -62,13 +62,13 @@ 
   new changesets 18d04c59bb5d:3e1487808078
   (run 'hg heads' to see heads)
 
-  $ 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)
@@ -99,15 +99,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/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -23,11 +23,11 @@ 
     discovery,
     error,
     lock as lockmod,
+    logexchange,
     obsolete,
     phases,
     pushkey,
     pycompat,
-    remotenames,
     scmutil,
     sslutil,
     streamclone,
@@ -1307,7 +1307,7 @@ 
 
     # storing remotenames
     if repo.ui.configbool('experimental', 'remotenames'):
-        remotenames.pullremotenames(repo, remote)
+        logexchange.pullremotenames(repo, remote)
 
     return pullop