Commits

Dan Villiom Podlaski Christiansen committed 82bbb34

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.

  • Participants
  • Parent commits 641d0c4

Comments (0)

Files changed (1)

hgsubversion/wrappers.py

             # 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!
                         else:
                             ui.traceback()
                             raise hgutil.Abort(*e.args)
+
+                lastpulled = r.revnum
+
         except KeyboardInterrupt:
             ui.traceback()
     finally: