# HG changeset patch # User Sean Farley # Date 1395678045 18000 # Node ID f9650d24464ab8d806029fd34bbeab607aaf5e73 # Parent 65ca78ac2ee1ef5a58f6e0481d2df3de468ae522 svnmeta: move revmap.oldest to meta.firstpulled We factor out revmap.oldest and rename it to 'firstpulled' to make it analogous with 'lastpulled'. diff --git a/hgsubversion/maps.py b/hgsubversion/maps.py --- a/hgsubversion/maps.py +++ b/hgsubversion/maps.py @@ -197,7 +197,6 @@ class RevMap(dict): def __init__(self, meta): dict.__init__(self) self.meta = meta - self.oldest = 0 if os.path.isfile(self.meta.revmap_file): self._load() @@ -234,8 +233,8 @@ class RevMap(dict): revnum = int(revnum) if revnum > self.meta.lastpulled or not self.meta.lastpulled: self.meta.lastpulled = revnum - if revnum < self.oldest or not self.oldest: - self.oldest = revnum + if revnum < self.meta.firstpulled or not self.meta.firstpulled: + self.meta.firstpulled = revnum dict.__setitem__(self, (revnum, branch), node.bin(ha)) def _write(self): @@ -251,8 +250,8 @@ class RevMap(dict): f.close() if revnum > self.meta.lastpulled or not self.meta.lastpulled: self.meta.lastpulled = revnum - if revnum < self.oldest or not self.oldest: - self.oldest = revnum + if revnum < self.meta.firstpulled or not self.meta.firstpulled: + self.meta.firstpulled = revnum dict.__setitem__(self, (revnum, branch), ha) diff --git a/hgsubversion/replay.py b/hgsubversion/replay.py --- a/hgsubversion/replay.py +++ b/hgsubversion/replay.py @@ -65,13 +65,13 @@ def _convert_rev(ui, meta, svn, r, tbdel editor.current.rev = r editor.setsvn(svn) - if firstrun and meta.revmap.oldest <= 0: + if firstrun and meta.firstpulled <= 0: # We know nothing about this project, so fetch everything before # trying to apply deltas. ui.debug('replay: fetching full revision\n') svn.get_revision(r.revnum, editor) else: - svn.get_replay(r.revnum, editor, meta.revmap.oldest) + svn.get_replay(r.revnum, editor, meta.firstpulled) editor.close() current = editor.current diff --git a/hgsubversion/stupid.py b/hgsubversion/stupid.py --- a/hgsubversion/stupid.py +++ b/hgsubversion/stupid.py @@ -709,7 +709,7 @@ def convert_rev(ui, meta, svn, r, tbdelt # path does not support this case with svn >= 1.7. We can fix # it, or we can force the existing fetch_branchrev() path. Do # the latter for now. - incremental = (meta.revmap.oldest > 0 and + incremental = (meta.firstpulled > 0 and parentctx.rev() != node.nullrev and not firstrun) diff --git a/hgsubversion/svnmeta.py b/hgsubversion/svnmeta.py --- a/hgsubversion/svnmeta.py +++ b/hgsubversion/svnmeta.py @@ -31,6 +31,7 @@ class SVNMeta(object): self.uuid = uuid self.subdir = subdir self._revmap = None + self.firstpulled = 0 self._gen_cachedconfig('lastpulled', 0, configname=False)