##// END OF EJS Templates
rebase: do not crash in panic when cwd disapear in the process (issue4121)...
Pierre-Yves David -
r20335:e4052064 stable
parent child Browse files
Show More
@@ -162,8 +162,12 b' class dirstate(object):'
162 else:
162 else:
163 return fallback
163 return fallback
164
164
165 @propertycache
166 def _cwd(self):
167 return os.getcwd()
168
165 def getcwd(self):
169 def getcwd(self):
166 cwd = os.getcwd()
170 cwd = self._cwd
167 if cwd == self._root:
171 if cwd == self._root:
168 return ''
172 return ''
169 # self._root ends with a path separator if self._root is '/' or 'C:\'
173 # self._root ends with a path separator if self._root is '/' or 'C:\'
@@ -649,3 +649,28 b' each root have a different common ancest'
649 |/
649 |/
650 o 0: 'A'
650 o 0: 'A'
651
651
652
653 Test that rebase is not confused by $CWD disapearing during rebase (issue 4121)
654
655 $ cd ..
656 $ hg init cwd-vanish
657 $ cd cwd-vanish
658 $ touch initial-file
659 $ hg add initial-file
660 $ hg commit -m 'initial commit'
661 $ touch dest-file
662 $ hg add dest-file
663 $ hg commit -m 'dest commit'
664 $ hg up 0
665 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
666 $ touch other-file
667 $ hg add other-file
668 $ hg commit -m 'first source commit'
669 created new head
670 $ mkdir subdir
671 $ cd subdir
672 $ touch subfile
673 $ hg add subfile
674 $ hg commit -m 'second source with subdir'
675 $ hg rebase -b . -d 1 --traceback
676 saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-backup.hg (glob)
General Comments 0
You need to be logged in to leave comments. Login now