changeset 1186:f9650d24464a

svnmeta: move revmap.oldest to meta.firstpulled We factor out revmap.oldest and rename it to 'firstpulled' to make it analogous with 'lastpulled'.
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 24 Mar 2014 11:20:45 -0500
parents 65ca78ac2ee1
children 30b2139c3931
files hgsubversion/maps.py hgsubversion/replay.py hgsubversion/stupid.py hgsubversion/svnmeta.py
diffstat 4 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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)
 
 
--- 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
--- 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)
 
--- 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)