Show More
@@ -0,0 +1,33 b'' | |||||
|
1 | #!/bin/sh | |||
|
2 | ||||
|
3 | # Test issue 746: renaming files brought by the | |||
|
4 | # second parent of a merge was broken. | |||
|
5 | ||||
|
6 | echo % create source repository | |||
|
7 | hg init t | |||
|
8 | cd t | |||
|
9 | echo a > a | |||
|
10 | hg ci -Am a | |||
|
11 | cd .. | |||
|
12 | ||||
|
13 | echo % fork source repository | |||
|
14 | hg clone t t2 | |||
|
15 | cd t2 | |||
|
16 | echo b > b | |||
|
17 | hg ci -Am b | |||
|
18 | ||||
|
19 | echo % update source repository | |||
|
20 | cd ../t | |||
|
21 | echo a >> a | |||
|
22 | hg ci -m a2 | |||
|
23 | ||||
|
24 | echo % merge repositories | |||
|
25 | hg pull ../t2 | |||
|
26 | hg merge | |||
|
27 | ||||
|
28 | echo % rename b as c | |||
|
29 | hg mv b c | |||
|
30 | hg st | |||
|
31 | echo % rename back c as b | |||
|
32 | hg mv c b | |||
|
33 | hg st |
@@ -0,0 +1,20 b'' | |||||
|
1 | % create source repository | |||
|
2 | adding a | |||
|
3 | % fork source repository | |||
|
4 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
5 | adding b | |||
|
6 | % update source repository | |||
|
7 | % merge repositories | |||
|
8 | pulling from ../t2 | |||
|
9 | searching for changes | |||
|
10 | adding changesets | |||
|
11 | adding manifests | |||
|
12 | adding file changes | |||
|
13 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
14 | (run 'hg heads' to see heads, 'hg merge' to merge) | |||
|
15 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
16 | (branch merge, don't forget to commit) | |||
|
17 | % rename b as c | |||
|
18 | A c | |||
|
19 | R b | |||
|
20 | % rename back c as b |
@@ -1045,14 +1045,14 b' class localrepository(repo.repository):' | |||||
1045 | def undelete(self, list): |
|
1045 | def undelete(self, list): | |
1046 | wlock = None |
|
1046 | wlock = None | |
1047 | try: |
|
1047 | try: | |
1048 | p = self.dirstate.parents()[0] |
|
1048 | manifests = [self.manifest.read(self.changelog.read(p)[0]) | |
1049 | mn = self.changelog.read(p)[0] |
|
1049 | for p in self.dirstate.parents() if p != nullid] | |
1050 | m = self.manifest.read(mn) |
|
|||
1051 | wlock = self.wlock() |
|
1050 | wlock = self.wlock() | |
1052 | for f in list: |
|
1051 | for f in list: | |
1053 | if self.dirstate[f] != 'r': |
|
1052 | if self.dirstate[f] != 'r': | |
1054 | self.ui.warn("%s not removed!\n" % f) |
|
1053 | self.ui.warn("%s not removed!\n" % f) | |
1055 | else: |
|
1054 | else: | |
|
1055 | m = f in manifests[0] and manifests[0] or manifests[1] | |||
1056 | t = self.file(f).read(m[f]) |
|
1056 | t = self.file(f).read(m[f]) | |
1057 | self.wwrite(f, t, m.flags(f)) |
|
1057 | self.wwrite(f, t, m.flags(f)) | |
1058 | self.dirstate.normal(f) |
|
1058 | self.dirstate.normal(f) |
General Comments 0
You need to be logged in to leave comments.
Login now