changeset 1165:eba7de99c576

svncommands: use meta.subdir instead of duplicating code We now will use meta.subdir which will elminate most of the reading / writing code in svncommands.
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 24 Mar 2014 11:20:43 -0500
parents 52de1f3b6824
children 8a1bf7d011c3
files hgsubversion/svncommands.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svncommands.py
+++ b/hgsubversion/svncommands.py
@@ -57,13 +57,10 @@ def _buildmeta(ui, repo, args, partial=F
 
     meta = svnmeta.SVNMeta(repo, skiperrorcheck=True)
 
-    subdirpath = os.path.join(meta.metapath, 'subdir')
-    subdir = util.load(subdirpath)
     svn = None
-    if subdir is None:
+    if meta.subdir is None:
         svn = svnrepo.svnremoterepo(ui, url).svn
-        subdir = svn.subdir
-        util.dump(subdir.strip('/'), subdirpath)
+        meta.subdir = svn.subdir
 
     youngest = 0
     startrev = 0
@@ -181,6 +178,8 @@ def _buildmeta(ui, repo, args, partial=F
         # check that the conversion metadata matches expectations
         assert convinfo.startswith('svn:')
         revpath, revision = convinfo[40:].split('@')
+        # use tmp variable for testing
+        subdir = meta.subdir
         if subdir and subdir[0] != '/':
             subdir = '/' + subdir
         if subdir and subdir[-1] == '/':