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 |
@@ -37,10 +37,9 b' class bisect(object):' | |||||
37 | self.ui = ui |
|
37 | self.ui = ui | |
38 | self.goodrevs = [] |
|
38 | self.goodrevs = [] | |
39 | self.badrev = None |
|
39 | self.badrev = None | |
40 | self.good_dirty = 0 |
|
|||
41 | self.bad_dirty = 0 |
|
|||
42 | self.good_path = "good" |
|
40 | self.good_path = "good" | |
43 | self.bad_path = "bad" |
|
41 | self.bad_path = "bad" | |
|
42 | self.is_reset = False | |||
44 |
|
43 | |||
45 | if os.path.exists(os.path.join(self.path, self.good_path)): |
|
44 | if os.path.exists(os.path.join(self.path, self.good_path)): | |
46 | self.goodrevs = self.opener(self.good_path).read().splitlines() |
|
45 | self.goodrevs = self.opener(self.good_path).read().splitlines() | |
@@ -51,8 +50,10 b' class bisect(object):' | |||||
51 | self.badrev = hg.bin(r.pop(0)) |
|
50 | self.badrev = hg.bin(r.pop(0)) | |
52 |
|
51 | |||
53 | def write(self): |
|
52 | def write(self): | |
|
53 | if self.is_reset: | |||
|
54 | return | |||
54 | if not os.path.isdir(self.path): |
|
55 | if not os.path.isdir(self.path): | |
55 |
|
|
56 | os.mkdir(self.path) | |
56 | f = self.opener(self.good_path, "w") |
|
57 | f = self.opener(self.good_path, "w") | |
57 | f.write("\n".join([hg.hex(r) for r in self.goodrevs])) |
|
58 | f.write("\n".join([hg.hex(r) for r in self.goodrevs])) | |
58 | if len(self.goodrevs) > 0: |
|
59 | if len(self.goodrevs) > 0: | |
@@ -81,6 +82,7 b' class bisect(object):' | |||||
81 | # Not sure about this |
|
82 | # Not sure about this | |
82 | #self.ui.write("Going back to tip\n") |
|
83 | #self.ui.write("Going back to tip\n") | |
83 | #self.repo.update(self.repo.changelog.tip()) |
|
84 | #self.repo.update(self.repo.changelog.tip()) | |
|
85 | self.is_reset = True | |||
84 | return 0 |
|
86 | return 0 | |
85 |
|
87 | |||
86 | def num_ancestors(self, head=None, stop=None): |
|
88 | def num_ancestors(self, head=None, stop=None): | |
@@ -301,10 +303,9 b' For subcommands see "hg bisect help\\"' | |||||
301 | if len(args) > bisectcmdtable[cmd][1]: |
|
303 | if len(args) > bisectcmdtable[cmd][1]: | |
302 | ui.warn(_("bisect: Too many arguments\n")) |
|
304 | ui.warn(_("bisect: Too many arguments\n")) | |
303 | return help_() |
|
305 | return help_() | |
304 | try: |
|
306 | ret = bisectcmdtable[cmd][0](*args) | |
305 | return bisectcmdtable[cmd][0](*args) |
|
307 | b.write() | |
306 | finally: |
|
308 | return ret | |
307 | b.write() |
|
|||
308 |
|
309 | |||
309 | cmdtable = { |
|
310 | cmdtable = { | |
310 | "bisect": (bisect_run, [], _("hg bisect [help|init|reset|next|good|bad]")), |
|
311 | "bisect": (bisect_run, [], _("hg bisect [help|init|reset|next|good|bad]")), |
@@ -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) |
@@ -1038,7 +1038,7 b' class revlog(object):' | |||||
1038 | ifh.write(entry) |
|
1038 | ifh.write(entry) | |
1039 | else: |
|
1039 | else: | |
1040 | offset += curr * self._io.size |
|
1040 | offset += curr * self._io.size | |
1041 |
transaction.add(self.indexfile, offset, |
|
1041 | transaction.add(self.indexfile, offset, curr) | |
1042 | ifh.write(entry) |
|
1042 | ifh.write(entry) | |
1043 | ifh.write(data[0]) |
|
1043 | ifh.write(data[0]) | |
1044 | ifh.write(data[1]) |
|
1044 | ifh.write(data[1]) |
@@ -33,7 +33,7 b' class statichttprepository(localrepo.loc' | |||||
33 | self._url = path |
|
33 | self._url = path | |
34 | self.ui = ui |
|
34 | self.ui = ui | |
35 |
|
35 | |||
36 |
self.path = ( |
|
36 | self.path = path.rstrip('/') + "/.hg" | |
37 | self.opener = opener(self.path) |
|
37 | self.opener = opener(self.path) | |
38 | # find requirements |
|
38 | # find requirements | |
39 | try: |
|
39 | try: |
@@ -49,4 +49,18 b" echo '[hooks]' >> .hg/hgrc" | |||||
49 | echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc |
|
49 | echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc | |
50 | http_proxy= hg pull |
|
50 | http_proxy= hg pull | |
51 |
|
51 | |||
|
52 | echo '% test with "/" URI (issue 747)' | |||
|
53 | cd .. | |||
|
54 | hg init | |||
|
55 | echo a > a | |||
|
56 | hg add a | |||
|
57 | hg ci -ma | |||
|
58 | ||||
|
59 | http_proxy= hg clone static-http://localhost:20059/ local2 | |||
|
60 | ||||
|
61 | cd local2 | |||
|
62 | hg verify | |||
|
63 | cat a | |||
|
64 | hg paths | |||
|
65 | ||||
52 | kill $! |
|
66 | kill $! |
@@ -28,3 +28,17 b' adding manifests' | |||||
28 | adding file changes |
|
28 | adding file changes | |
29 | added 1 changesets with 1 changes to 1 files |
|
29 | added 1 changesets with 1 changes to 1 files | |
30 | (run 'hg update' to get a working copy) |
|
30 | (run 'hg update' to get a working copy) | |
|
31 | % test with "/" URI (issue 747) | |||
|
32 | requesting all changes | |||
|
33 | adding changesets | |||
|
34 | adding manifests | |||
|
35 | adding file changes | |||
|
36 | added 1 changesets with 1 changes to 1 files | |||
|
37 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
38 | checking changesets | |||
|
39 | checking manifests | |||
|
40 | crosschecking files in changesets and manifests | |||
|
41 | checking files | |||
|
42 | 1 files, 1 changesets, 1 total revisions | |||
|
43 | a | |||
|
44 | default = static-http://localhost:20059/ |
General Comments 0
You need to be logged in to leave comments.
Login now