From: John Goerzen Date: Mon, 3 Mar 2008 03:22:12 +0000 (-0600) Subject: Fix for repo with local changes prior to obliterate X-Git-Url: https://repo.or.cz/w/darcs2git.git/commitdiff_plain/bb42b6c87f28f193f206168a286f045e2a55c9e3 Fix for repo with local changes prior to obliterate When attempting to convert the OfflineIMAP darcs repo to git, the conversion process crashed approximately 500 revisions into the process. Darcs was complaining of uncommitted local changes prior to an obliterate. Adding some darcs revert commands fixed that. Next, though, it was complaining of EOF on input with the obliterate prompt. Changing the call from echo ay to yes | darcs obliterate -a fixed that. --- diff --git a/darcs2git.py b/darcs2git.py old mode 100644 new mode 100755 index 82fd90e..a5700ca --- a/darcs2git.py +++ b/darcs2git.py @@ -358,7 +358,9 @@ going back (obliterate) and forward (pull). dir = self.dir progress ('Rewinding %d patches' % count) - system ('cd %(dir)s && echo ay|darcs obliterate --ignore-times --last %(count)d' % locals ()) + system ('cd %(dir)s && darcs revert --all' % locals()) + system ('cd %(dir)s && yes|darcs obliterate -a --ignore-times --last %(count)d' % locals ()) + system ('cd %(dir)s && darcs revert -a' % locals()) d = self.inventory_dict () for p in self.patches[dest+1:self._current_number+1]: try: @@ -381,6 +383,7 @@ going back (obliterate) and forward (pull). dir = self.dir progress ('Pull patch %d' % patch.number) + system ('cd %(dir)s && darcs revert --all' % locals()) system ('cd %(dir)s && darcs pull --ignore-times --quiet --all --match "hash %(id)s" %(source_repo)s ' % locals ()) self._current_number = patch.number @@ -404,6 +407,7 @@ going back (obliterate) and forward (pull). src = self.patches[0].dir progress ('Pulling %d patches to go to %d' % (len (pull_me), num)) + system ('darcs revert --repo %(dir)s --all' % locals ()) system ('darcs pull --all --repo %(dir)s --match "%(pull_str)s" %(src)s' % locals ()) def create_fresh (self): @@ -458,6 +462,7 @@ going back (obliterate) and forward (pull). self._inventory_dict[p.short_id ()] = p iv.close () + system ('darcs revert --repo %(dir)s --all' % locals()) system ('darcs repair --repo %(dir)s --quiet' % locals ()) self.checkout () self._current_number = num