Show More
@@ -346,6 +346,21 b' def has_hardlink():' | |||
|
346 | 346 | finally: |
|
347 | 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 | 364 | @check("tla", "GNU Arch tla client") |
|
350 | 365 | def has_tla(): |
|
351 | 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 | 756 | $ touch subfile |
|
757 | 757 | $ hg add subfile |
|
758 | 758 | $ hg commit -m 'second source with subdir' |
|
759 | #if rmcwd | |
|
759 | 760 | $ hg rebase -b . -d 1 --traceback |
|
760 | 761 | rebasing 2:779a07b1b7a0 "first source commit" |
|
761 | 762 | current directory was removed |
|
762 | 763 | (consider changing to repo root: $TESTTMP/cwd-vanish) |
|
763 | 764 | rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip) |
|
764 | 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 | 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 | 74 | #endif |
|
75 | 75 | |
|
76 | #if rmcwd | |
|
77 | ||
|
76 | 78 | Test that warning is printed if cwd is deleted during update |
|
77 | 79 | $ hg init r4 && cd r4 |
|
78 | 80 | $ mkdir dir |
@@ -84,3 +86,5 b' Test that warning is printed if cwd is d' | |||
|
84 | 86 | $ hg up -q null |
|
85 | 87 | current directory was removed |
|
86 | 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