# HG changeset patch # User Bryan O'Sullivan # Date 1360025036 28800 # Node ID 2c87bdc43d3ca540b9912a462f2b899a79daabda # Parent 0274b75af266bb3639f3e0a84ad4c15cddb2ceee buildmeta: initialize uuid from local metadata if possible diff --git a/hgsubversion/svncommands.py b/hgsubversion/svncommands.py --- a/hgsubversion/svncommands.py +++ b/hgsubversion/svncommands.py @@ -65,7 +65,6 @@ def _buildmeta(ui, repo, args, partial=F dest = args[0] elif len(args) > 1: raise hgutil.Abort('rebuildmeta takes 1 or no arguments') - uuid = None url = repo.ui.expandpath(dest or repo.ui.config('paths', 'default-push') or repo.ui.config('paths', 'default') or '') svn = svnrepo.svnremoterepo(ui, url).svn @@ -73,6 +72,8 @@ def _buildmeta(ui, repo, args, partial=F svnmetadir = os.path.join(repo.path, 'svn') if not os.path.exists(svnmetadir): os.makedirs(svnmetadir) + uuidpath = os.path.join(svnmetadir, 'uuid') + uuid = read_if_exists(uuidpath) youngest = 0 startrev = 0 @@ -207,7 +208,7 @@ def _buildmeta(ui, repo, args, partial=F if uuid != svn.uuid: raise hgutil.Abort('remote svn repository identifier ' 'does not match') - write_if_needed(os.path.join(svnmetadir, 'uuid'), uuid) + write_if_needed(uuidpath, uuid) # don't reflect closed branches if (ctx.extra().get('close') and not ctx.files() or