changeset 15069:650d81a313cb

convert: use repo.join instead of referencing ".hg" directly
author Martin Geisler <mg@aragost.com>
date Thu, 08 Sep 2011 10:20:42 +0200
parents 73307643a09f
children 91d2efecb245 3bccc15b201f
files hgext/convert/hg.py tests/test-convert-authormap.t
diffstat 2 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/hg.py	Thu Sep 01 12:29:24 2011 +0200
+++ b/hgext/convert/hg.py	Thu Sep 08 10:20:42 2011 +0200
@@ -70,10 +70,10 @@
             self.wlock.release()
 
     def revmapfile(self):
-        return os.path.join(self.path, ".hg", "shamap")
+        return self.repo.join("shamap")
 
     def authorfile(self):
-        return os.path.join(self.path, ".hg", "authormap")
+        return self.repo.join("authormap")
 
     def getheads(self):
         h = self.repo.changelog.heads()
@@ -364,8 +364,7 @@
 
     def converted(self, rev, destrev):
         if self.convertfp is None:
-            self.convertfp = open(os.path.join(self.path, '.hg', 'shamap'),
-                                  'a')
+            self.convertfp = open(self.repo.join('shamap'), 'a')
         self.convertfp.write('%s %s\n' % (destrev, rev))
         self.convertfp.flush()
 
--- a/tests/test-convert-authormap.t	Thu Sep 01 12:29:24 2011 +0200
+++ b/tests/test-convert-authormap.t	Thu Sep 08 10:20:42 2011 +0200
@@ -27,7 +27,7 @@
   sorting...
   converting...
   0 foo
-  Writing author map file new/.hg/authormap
+  Writing author map file $TESTTMP/new/.hg/authormap
   $ cat new/.hg/authormap
   user name=Long User Name
   $ hg -Rnew log
@@ -44,7 +44,7 @@
   $ hg init new
   $ mv authormap.txt new/.hg/authormap
   $ hg convert orig new
-  Ignoring bad line in author map file new/.hg/authormap: this line is ignored
+  Ignoring bad line in author map file $TESTTMP/new/.hg/authormap: this line is ignored
   scanning source...
   sorting...
   converting...