Support using shared marks files for all remotes

... which essentially track the shared bag of revisions that
the shared proxy repo constitutes.
This commit is contained in:
Mark Nauwelaerts
2016-09-09 19:49:30 +02:00
parent 5d429d2da1
commit cbbbaddc41
7 changed files with 245 additions and 10 deletions

View File

@@ -128,7 +128,7 @@ class GitHgRepo:
remotehg = import_sibling('remotehg', 'git-remote-hg')
for r in self.get_hg_repos():
try:
hgpath = os.path.join(self.gitdir, 'hg', r)
hgpath = remotehg.select_marks_dir(r, self.gitdir, False)
m = remotehg.Marks(os.path.join(hgpath, 'marks-hg'), None)
mark = m.from_rev(rev)
m = GitMarks(os.path.join(hgpath, 'marks-git'))
@@ -151,6 +151,9 @@ class GitHgRepo:
# skip the shared repo
if r == '.hg':
continue
# only dirs
if not os.path.isdir(os.path.join(shared_path, r)):
continue
local_path = os.path.join(shared_path, r, 'clone')
local_hg = os.path.join(local_path, '.hg')
if not os.path.exists(local_hg):
@@ -415,7 +418,7 @@ class GcCommand(SubCommand):
for remote in args:
if not remote in hg_repos:
self.usage('%s is not a valid hg remote' % (remote))
hgpath = os.path.join(self.githgrepo.gitdir, 'hg', remote)
hgpath = remotehg.select_marks_dir(remote, self.githgrepo.gitdir, False)
print "Loading hg marks ..."
hgm = remotehg.Marks(os.path.join(hgpath, 'marks-hg'), None)
print "Loading git marks ..."