mercurial/subrepo.py
changeset 14041 bcc6ed0f6c3b
parent 13972 d1f4e7fd970a
child 14047 30ccb7d03864
--- a/mercurial/subrepo.py	Fri Apr 29 16:34:52 2011 +0200
+++ b/mercurial/subrepo.py	Fri Apr 29 03:34:18 2011 -0500
@@ -621,7 +621,15 @@
             self._svncommand(['revert', '--recursive'])
         status = self._svncommand(['checkout', state[0], '--revision', state[1]])
         if not re.search('Checked out revision [0-9]+.', status):
-            raise util.Abort(status.splitlines()[-1])
+            # catch the case where the checkout operation is
+            # obstructed but the working copy is clean
+            if ('already a working copy for a different' in status and
+                not self.dirty()):
+                self.remove()
+                self.get(state, overwrite)
+                return
+            else:
+                raise util.Abort(status.splitlines()[-1])
         self._ui.status(status)
 
     def merge(self, state):