# HG changeset patch # User Sean Farley # Date 1395678043 18000 # Node ID eba7de99c576553aabd304396894a1c8f51a484e # Parent 52de1f3b6824fa51dae92c6ca2da567f25eb9231 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. diff --git a/hgsubversion/svncommands.py b/hgsubversion/svncommands.py --- 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] == '/':