##// END OF EJS Templates
merge: fix --preview to show all nodes that will be merged (issue2043)....
Greg Ward -
r10505:b3311e26 stable
parent child Browse files
Show More
@@ -2233,14 +2233,14 b' def merge(ui, repo, node=None, **opts):'
2233 node = parent == bheads[0] and bheads[-1] or bheads[0]
2233 node = parent == bheads[0] and bheads[-1] or bheads[0]
2234
2234
2235 if opts.get('preview'):
2235 if opts.get('preview'):
2236 p1 = repo['.']
2236 # find nodes that are ancestors of p2 but not of p1
2237 p2 = repo[node]
2237 p1 = repo.lookup('.')
2238 common = p1.ancestor(p2)
2238 p2 = repo.lookup(node)
2239 roots, heads = [common.node()], [p2.node()]
2239 nodes = repo.changelog.findmissing(common=[p1], heads=[p2])
2240
2240 displayer = cmdutil.show_changeset(ui, repo, opts)
2241 displayer = cmdutil.show_changeset(ui, repo, opts)
2241 for node in repo.changelog.nodesbetween(roots=roots, heads=heads)[0]:
2242 for node in nodes:
2242 if node not in roots:
2243 displayer.show(repo[node])
2243 displayer.show(repo[node])
2244 displayer.close()
2244 displayer.close()
2245 return 0
2245 return 0
2246
2246
@@ -50,4 +50,11 b' hg commit -mf'
50 echo % should fail because merge with other branch
50 echo % should fail because merge with other branch
51 hg merge
51 hg merge
52
52
53 # Test for issue2043: ensure that 'merge -P' shows ancestors of 6 that
54 # are not ancestors of 7, regardless of where their least common
55 # ancestor is.
56 echo % merge preview not affected by common ancestor
57 hg up -q 7
58 hg merge -q -P 6 # expect: 2, 4, 5, 6
59
53 true
60 true
@@ -34,3 +34,8 b' created new head'
34 % should fail because merge with other branch
34 % should fail because merge with other branch
35 abort: branch 'foobranch' has one head - please merge with an explicit rev
35 abort: branch 'foobranch' has one head - please merge with an explicit rev
36 (run 'hg heads' to see all heads)
36 (run 'hg heads' to see all heads)
37 % merge preview not affected by common ancestor
38 2:2d95304fed5d
39 4:f25cbe84d8b3
40 5:a431fabd6039
41 6:e88e33f3bf62
General Comments 0
You need to be logged in to leave comments. Login now