changeset 1013:7835460756d4

repo: update repo.join to be repo.vfs.join Upstream has deprecated repo.join in favor of repo.vfs.join, so let's update to match them. Old hg should have repo.vfs.join so I don't think this breaks backwards compatibility.
author Durham Goode <durham@fb.com>
date Wed, 15 Mar 2017 13:37:02 -0700
parents a4f4f861fc5e
children 4842e94f36ca
files hggit/__init__.py hggit/git_handler.py
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/__init__.py	Thu Mar 09 12:33:05 2017 -0800
+++ b/hggit/__init__.py	Wed Mar 15 13:37:02 2017 -0700
@@ -211,7 +211,7 @@
         if (getattr(dirstate, 'rootcache', False) and
             (not ignoremod or getattr(ignore, 'readpats', False)) and
             hgutil.safehasattr(repo, 'join') and
-            os.path.exists(repo.join('git'))):
+            os.path.exists(repo.vfs.join('git'))):
             # only install our dirstate wrapper if it has a hope of working
             import gitdirstate
             if ignoremod:
--- a/hggit/git_handler.py	Thu Mar 09 12:33:05 2017 -0800
+++ b/hggit/git_handler.py	Wed Mar 15 13:37:02 2017 -0700
@@ -108,7 +108,7 @@
         if ui.configbool('git', 'intree'):
             self.gitdir = self.repo.wjoin('.git')
         else:
-            self.gitdir = self.repo.join('git')
+            self.gitdir = self.repo.vfs.join('git')
 
         self.init_author_file()
 
@@ -182,7 +182,7 @@
     def load_map(self):
         map_git_real = {}
         map_hg_real = {}
-        if os.path.exists(self.repo.join(self.map_file)):
+        if os.path.exists(self.repo.vfs.join(self.map_file)):
             for line in self.repo.vfs(self.map_file):
                 # format is <40 hex digits> <40 hex digits>\n
                 if len(line) != 82:
@@ -210,7 +210,7 @@
 
     def load_tags(self):
         self.tags = {}
-        if os.path.exists(self.repo.join(self.tags_file)):
+        if os.path.exists(self.repo.vfs.join(self.tags_file)):
             for line in self.repo.vfs(self.tags_file):
                 sha, name = line.strip().split(' ', 1)
                 self.tags[name] = sha
@@ -402,7 +402,7 @@
         return ret
 
     def clear(self):
-        mapfile = self.repo.join(self.map_file)
+        mapfile = self.repo.vfs.join(self.map_file)
         if os.path.exists(self.gitdir):
             for root, dirs, files in os.walk(self.gitdir, topdown=False):
                 for name in files: