changeset 981:82bbb3428684

pull: save the last pulled revision *after* converting revisions Otherwise, a KeyboardInterrupt may lead to an unpulled revision being incorrectly saved as pulled in the lastpulled file. This will lead to the interrupted revision being incorrectly skipped at the next pull, leading to an incorrect conversion -- one might even say corrupt. Due to it's nature of requiring a manual interrupt, this bug is difficult to test.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Sun, 11 Nov 2012 15:31:19 +0100
parents 641d0c41d1ea
children ea8ef4dd967e
files hgsubversion/wrappers.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -386,10 +386,10 @@ def pull(repo, source, heads=[], force=F
             # start converting revisions
             firstrun = True
             for r in svn.revisions(start=start, stop=stopat_rev):
-                lastpulled = r.revnum
                 if (r.revnum in skiprevs or
                     (r.author is None and
                      r.message == 'This is an empty revision for padding.')):
+                    lastpulled = r.revnum
                     continue
                 tbdelta = meta.update_branch_tag_map_for_rev(r)
                 # got a 502? Try more than once!
@@ -438,6 +438,9 @@ def pull(repo, source, heads=[], force=F
                         else:
                             ui.traceback()
                             raise hgutil.Abort(*e.args)
+
+                lastpulled = r.revnum
+
         except KeyboardInterrupt:
             ui.traceback()
     finally: