##// END OF EJS Templates
tests: run "cwd was removed" test only if cwd can actually be removed...
Yuya Nishihara -
r30230:46a0203d stable
parent child Browse files
Show More
@@ -346,6 +346,21 b' def has_hardlink():'
346 finally:
346 finally:
347 os.unlink(fn)
347 os.unlink(fn)
348
348
349 @check("rmcwd", "can remove current working directory")
350 def has_rmcwd():
351 ocwd = os.getcwd()
352 temp = tempfile.mkdtemp(dir='.', prefix=tempprefix)
353 try:
354 os.chdir(temp)
355 # On Linux, 'rmdir .' isn't allowed, but the other names are okay.
356 # On Solaris and Windows, the cwd can't be removed by any names.
357 os.rmdir(os.getcwd())
358 return True
359 except OSError:
360 return False
361 finally:
362 os.chdir(ocwd)
363
349 @check("tla", "GNU Arch tla client")
364 @check("tla", "GNU Arch tla client")
350 def has_tla():
365 def has_tla():
351 return matchoutput('tla --version 2>&1', br'The GNU Arch Revision')
366 return matchoutput('tla --version 2>&1', br'The GNU Arch Revision')
@@ -756,12 +756,19 b' Test that rebase is not confused by $CWD'
756 $ touch subfile
756 $ touch subfile
757 $ hg add subfile
757 $ hg add subfile
758 $ hg commit -m 'second source with subdir'
758 $ hg commit -m 'second source with subdir'
759 #if rmcwd
759 $ hg rebase -b . -d 1 --traceback
760 $ hg rebase -b . -d 1 --traceback
760 rebasing 2:779a07b1b7a0 "first source commit"
761 rebasing 2:779a07b1b7a0 "first source commit"
761 current directory was removed
762 current directory was removed
762 (consider changing to repo root: $TESTTMP/cwd-vanish)
763 (consider changing to repo root: $TESTTMP/cwd-vanish)
763 rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip)
764 rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip)
764 saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-backup.hg (glob)
765 saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-backup.hg (glob)
766 #else
767 $ hg rebase -b . -d 1 --traceback
768 rebasing 2:779a07b1b7a0 "first source commit"
769 rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip)
770 saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-backup.hg (glob)
771 #endif
765
772
766 Test that rebase is done in topo order (issue5370)
773 Test that rebase is done in topo order (issue5370)
767
774
@@ -73,6 +73,8 b' Test update when two commits have symlin'
73
73
74 #endif
74 #endif
75
75
76 #if rmcwd
77
76 Test that warning is printed if cwd is deleted during update
78 Test that warning is printed if cwd is deleted during update
77 $ hg init r4 && cd r4
79 $ hg init r4 && cd r4
78 $ mkdir dir
80 $ mkdir dir
@@ -84,3 +86,5 b' Test that warning is printed if cwd is d'
84 $ hg up -q null
86 $ hg up -q null
85 current directory was removed
87 current directory was removed
86 (consider changing to repo root: $TESTTMP/r1/r4)
88 (consider changing to repo root: $TESTTMP/r1/r4)
89
90 #endif
General Comments 0
You need to be logged in to leave comments. Login now