mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
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.
This commit is contained in:
parent
c0a5b18825
commit
eb9cab87ed
@ -57,13 +57,10 @@ def _buildmeta(ui, repo, args, partial=False, skipuuid=False):
|
||||
|
||||
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=False, skipuuid=False):
|
||||
# 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] == '/':
|
||||
|
Loading…
Reference in New Issue
Block a user