Index: vcpx/repository/darcs/target.py
===================================================================
--- vcpx/repository/darcs/target.py	(revision 1618)
+++ vcpx/repository/darcs/target.py	(revision 1639)
@@ -12,4 +12,5 @@
 __docformat__ = 'reStructuredText'
 
+from os.path import join, exists
 import re
 
@@ -33,5 +34,4 @@
     def importFirstRevision(self, source_repo, changeset, initial):
         from os import walk, sep
-        from os.path import join
         from vcpx.dualwd import IGNORED_METADIRS
 
@@ -106,4 +106,6 @@
         """
 
+        from os import rename, unlink
+
         logmessage = []
 
@@ -135,4 +137,11 @@
 
         if record.exit_status:
+            pending = join(self.repository.basedir, '_darcs', 'patches', 'pending')
+            if exists(pending):
+                wrongpending = pending + '.wrong'
+                if exists(wrongpending):
+                    unlink(wrongpending)
+                rename(pending, wrongpending)
+                self.log.debug("Pending file renamed to %s", wrongpending)
             raise ChangesetReplayFailure(
                 "%s returned status %d, saying: %s" % (str(record),
@@ -163,6 +172,4 @@
         A with its new content, darcs would move the *wrong* A to B...
         """
-
-        from os.path import join, exists
 
         # The "_darcs/patches/pending" file is basically a patch containing
@@ -248,6 +255,4 @@
         """
 
-        from os.path import join, exists
-
         metadir = join(self.repository.basedir, '_darcs')
 
@@ -278,6 +283,4 @@
         Tweak the default settings of the repository.
         """
-
-        from os.path import join
 
         motd = open(join(self.repository.basedir, '_darcs/prefs/motd'), 'w')
