##// END OF EJS Templates
localrepo: use the path relative to "self.vfs" instead of "path" argument...
localrepo: use the path relative to "self.vfs" instead of "path" argument As a part of migration to vfs, this patch uses "self.root", which can be recognized as the path relative to "self.vfs", instead of "path" argument. This fix allows to make invocations of "util.makedirs()" and "os.path.exists()" while ensuring repository directory in "localrepository.__init__()" ones indirectly via vfs. But this fix also raises issue 2528: "hg clone" with empty destination. "path" argument is empty in many cases, so this issue can't be fixed in the view of "localrepository.__init__()". Before this patch, it is fixed by empty-ness check ("not name") of exception handler in "util.makedirs()". try: os.mkdir(name) except OSError, err: if err.errno == errno.EEXIST: return if err.errno != errno.ENOENT or not name: raise This requires "localrepository.__init__()" to invoke "util.makedirs()" with "path" instead of "self.root", because empty "path" is treated as "current directory" and "self.root" becomes valid path. But "hg clone" with empty destination can be detected also in "hg.clone()" before "localrepository.__init__()" invocation, so this patch re-fixes issue2528 by checking it in "hg.clone()".

File last commit:

r16492:774e2dcd stable
r17159:36a30168 default
Show More
test-casecollision-merge.t
209 lines | 4.1 KiB | text/troff | Tads3Lexer
/ tests / test-casecollision-merge.t
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673 run only on case-insensitive filesystems
$ "$TESTDIR/hghave" icasefs || exit 80
################################
test for branch merging
################################
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 test for rename awareness of case-folding collision check:
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 (1) colliding file is one renamed from collided file:
this is also case for issue3370.
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 $ hg init merge_renameaware_1
$ cd merge_renameaware_1
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 $ echo a > a
$ hg add a
$ hg commit -m '#0'
$ hg rename a tmp
$ hg rename tmp A
$ hg commit -m '#1'
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673 $ hg update 0
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo 'modified at #2' > a
$ hg commit -m '#2'
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673 created new head
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 $ hg merge
merging a and A to A
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg status -A
M A
a
R a
$ cat A
modified at #2
$ hg update --clean 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg merge
merging A and a to A
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg status -A
M A
a
$ cat A
modified at #2
$ cd ..
(2) colliding file is not related to collided file
$ hg init merge_renameaware_2
$ cd merge_renameaware_2
$ echo a > a
$ hg add a
$ hg commit -m '#0'
$ hg remove a
$ hg commit -m '#1'
$ echo A > A
$ hg add A
$ hg commit -m '#2'
$ hg update --clean 0
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo 'modified at #3' > a
$ hg commit -m '#3'
created new head
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673
$ hg merge
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 abort: case-folding collision between A and a
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673 [255]
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 $ hg parents --template '{rev}\n'
3
$ hg status -A
C a
$ cat a
modified at #3
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 $ hg update --clean 2
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg merge
abort: case-folding collision between a and A
[255]
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673 $ hg parents --template '{rev}\n'
2
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 $ hg status -A
C A
$ cat A
A
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673 $ cd ..
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673 ################################
test for linear updates
################################
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 test for rename awareness of case-folding collision check:
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 (1) colliding file is one renamed from collided file
$ hg init linearupdate_renameaware_1
$ cd linearupdate_renameaware_1
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 $ echo a > a
$ hg add a
$ hg commit -m '#0'
$ hg rename a tmp
$ hg rename tmp A
$ hg commit -m '#1'
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673
$ hg update 0
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 $ echo 'this is added line' >> a
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673 $ hg update 1
merging a and A to A
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
$ hg status -A
M A
$ cat A
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 a
FUJIWARA Katsunori
merge: check filename case collision between changesets for branch merging...
r15673 this is added line
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478
$ cd ..
(2) colliding file is not related to collided file
$ hg init linearupdate_renameaware_2
$ cd linearupdate_renameaware_2
$ echo a > a
$ hg add a
$ hg commit -m '#0'
$ hg remove a
$ hg commit -m '#1'
$ echo A > A
$ hg add A
$ hg commit -m '#2'
$ hg update 0
Patrick Mezard
update: fix case-collision with a clean wd and no --clean...
r16492 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 $ hg parents --template '{rev}\n'
Patrick Mezard
update: fix case-collision with a clean wd and no --clean...
r16492 0
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 $ hg status -A
Patrick Mezard
update: fix case-collision with a clean wd and no --clean...
r16492 C a
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478 $ cat A
Patrick Mezard
update: fix case-collision with a clean wd and no --clean...
r16492 a
$ hg up -qC 2
FUJIWARA Katsunori
icasefs: make case-folding collision detection as rename aware (issue3370)...
r16478
$ hg update --check 0
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg parents --template '{rev}\n'
0
$ hg status -A
C a
$ cat a
a
$ hg update --clean 2
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg parents --template '{rev}\n'
2
$ hg status -A
C A
$ cat A
A
$ cd ..
(3) colliding file is not related to collided file: added in working dir
$ hg init linearupdate_renameaware_3
$ cd linearupdate_renameaware_3
$ echo a > a
$ hg add a
$ hg commit -m '#0'
$ hg rename a b
$ hg commit -m '#1'
$ hg update 0
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo B > B
$ hg add B
$ hg status
A B
$ hg update
abort: case-folding collision between b and B
[255]
$ hg update --check
abort: uncommitted local changes
[255]
$ hg update --clean
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg parents --template '{rev}\n'
1
$ hg status -A
C b
$ cat b
a
$ cd ..