changeset 1503:180e0d5fba2e

join: remove uses of repo.join/wjoin Upstream Mercurial has dropped these functions as of 4.3. Let's switch to the appropriate repo.[w]vfs.join functions.
author Durham Goode <durham@fb.com>
date Tue, 09 May 2017 15:20:16 -0700
parents fb91566d849c
children e65d6f6897f4
files hgsubversion/svncommands.py hgsubversion/svnexternals.py hgsubversion/svnmeta.py hgsubversion/wrappers.py tests/test_utility_commands.py
diffstat 5 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svncommands.py
+++ b/hgsubversion/svncommands.py
@@ -341,7 +341,7 @@ def genignore(ui, repo, force=False, **o
         raise error.RepoError("There is no Mercurial repository"
                               " here (.hg not found)")
 
-    ignpath = repo.wjoin('.hgignore')
+    ignpath = repo.wvfs.join('.hgignore')
     if not force and os.path.exists(ignpath):
         raise hgutil.Abort('not overwriting existing .hgignore, try --force?')
     svn = svnrepo.svnremoterepo(repo.ui).svn
@@ -363,7 +363,7 @@ def genignore(ui, repo, force=False, **o
         lines = props['svn:ignore'].strip().split('\n')
         ignorelines += [dir and (dir + '/' + prop) or prop for prop in lines if prop.strip()]
 
-    repo.wopener('.hgignore', 'w').write('\n'.join(ignorelines) + '\n')
+    repo.wvfs('.hgignore', 'w').write('\n'.join(ignorelines) + '\n')
 
 
 def info(ui, repo, **opts):
--- a/hgsubversion/svnexternals.py
+++ b/hgsubversion/svnexternals.py
@@ -289,7 +289,7 @@ class externalsupdater:
         self.ui = ui
 
     def update(self, wpath, rev, source, pegrev):
-        path = self.repo.wjoin(wpath)
+        path = self.repo.wvfs.join(wpath)
         revspec = []
         if rev:
             revspec = ['-r', rev]
@@ -321,7 +321,7 @@ class externalsupdater:
         self.svn(['co'] + revspec + [source, dest], cwd)
 
     def delete(self, wpath):
-        path = self.repo.wjoin(wpath)
+        path = self.repo.wvfs.join(wpath)
         if os.path.isdir(path):
             self.ui.status(_('removing external %s\n') % wpath)
 
@@ -368,7 +368,7 @@ def updateexternals(ui, args, repo, **op
 
     # Retrieve current externals status
     try:
-        oldext = file(repo.join('svn/externals'), 'rb').read()
+        oldext = file(repo.vfs.join('svn/externals'), 'rb').read()
     except IOError:
         oldext = ''
     newext = ''
@@ -386,7 +386,7 @@ def updateexternals(ui, args, repo, **op
         else:
             raise hgutil.Abort(_('unknown update actions: %r') % action)
 
-    file(repo.join('svn/externals'), 'wb').write(newext)
+    file(repo.vfs.join('svn/externals'), 'wb').write(newext)
 
 def getchanges(ui, repo, parentctx, exts):
     """Take a parent changectx and the new externals definitions as an
--- a/hgsubversion/svnmeta.py
+++ b/hgsubversion/svnmeta.py
@@ -26,7 +26,7 @@ class SVNMeta(object):
         # simple and public variables
         self.ui = repo.ui
         self.repo = repo
-        self.path = os.path.normpath(repo.join('..'))
+        self.path = os.path.normpath(repo.vfs.join('..'))
         self.lastdate = '1970-01-01 00:00:00 -0000'
         self.addedtags = {}
         self.deletedtags = {}
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -674,7 +674,7 @@ def clone(orig, ui, source, dest=None, *
 
     if dstrepo.local() and srcrepo.capable('subversion'):
         dst = dstrepo.local()
-        fd = dst.opener("hgrc", "a", text=True)
+        fd = dst.vfs("hgrc", "a", text=True)
         preservesections = set(s for s, v in optionmap.itervalues())
         preservesections |= extrasections
         for section in preservesections:
--- a/tests/test_utility_commands.py
+++ b/tests/test_utility_commands.py
@@ -128,10 +128,10 @@ class UtilityTests(test_util.TestBase):
 
     def test_missing_metadata(self):
         self._load_fixture_and_fetch('two_heads.svndump')
-        os.remove(self.repo.join('svn/branch_info'))
+        os.remove(self.repo.vfs.join('svn/branch_info'))
         svncommands.updatemeta(self.ui(), self.repo, [])
 
-        test_util.rmtree(self.repo.join('svn'))
+        test_util.rmtree(self.repo.vfs.join('svn'))
         self.assertRaises(hgutil.Abort,
                           self.repo.svnmeta)
         self.assertRaises(hgutil.Abort,
@@ -141,7 +141,7 @@ class UtilityTests(test_util.TestBase):
                           svncommands.genignore,
                           self.ui(), repo=self.repo, args=[])
 
-        os.remove(self.repo.join('hgrc'))
+        os.remove(self.repo.vfs.join('hgrc'))
         self.assertRaises(hgutil.Abort,
                           self.repo.svnmeta)
         self.assertRaises(hgutil.Abort,