12 import hg, scmutil, util, revlog, extensions, copies, error, bookmarks |
12 import hg, scmutil, util, revlog, extensions, copies, error, bookmarks |
13 import patch, help, url, encoding, templatekw, discovery |
13 import patch, help, url, encoding, templatekw, discovery |
14 import archival, changegroup, cmdutil, hbisect |
14 import archival, changegroup, cmdutil, hbisect |
15 import sshserver, hgweb, hgweb.server, commandserver |
15 import sshserver, hgweb, hgweb.server, commandserver |
16 import match as matchmod |
16 import match as matchmod |
17 import merge |
17 import merge as mergemod |
18 import minirst, revset, fileset |
18 import minirst, revset, fileset |
19 import dagparser, context, simplemerge |
19 import dagparser, context, simplemerge |
20 import random, setdiscovery, treediscovery, dagutil |
20 import random, setdiscovery, treediscovery, dagutil |
21 import phases |
21 import phases |
22 |
22 |
2621 if not cont: |
2621 if not cont: |
2622 # perform the graft merge with p1(rev) as 'ancestor' |
2622 # perform the graft merge with p1(rev) as 'ancestor' |
2623 try: |
2623 try: |
2624 # ui.forcemerge is an internal variable, do not document |
2624 # ui.forcemerge is an internal variable, do not document |
2625 repo.ui.setconfig('ui', 'forcemerge', opts.get('tool', '')) |
2625 repo.ui.setconfig('ui', 'forcemerge', opts.get('tool', '')) |
2626 stats = merge.update(repo, ctx.node(), True, True, False, |
2626 stats = mergemod.update(repo, ctx.node(), True, True, False, |
2627 ctx.p1().node()) |
2627 ctx.p1().node()) |
2628 finally: |
2628 finally: |
2629 ui.setconfig('ui', 'forcemerge', '') |
2629 ui.setconfig('ui', 'forcemerge', '') |
2630 # drop the second merge parent |
2630 # drop the second merge parent |
2631 repo.dirstate.setparents(current.node(), nullid) |
2631 repo.dirstate.setparents(current.node(), nullid) |
2632 repo.dirstate.write() |
2632 repo.dirstate.write() |
4653 raise util.Abort(_("can't specify --all and patterns")) |
4653 raise util.Abort(_("can't specify --all and patterns")) |
4654 if not (all or pats or show or mark or unmark): |
4654 if not (all or pats or show or mark or unmark): |
4655 raise util.Abort(_('no files or directories specified; ' |
4655 raise util.Abort(_('no files or directories specified; ' |
4656 'use --all to remerge all files')) |
4656 'use --all to remerge all files')) |
4657 |
4657 |
4658 ms = merge.mergestate(repo) |
4658 ms = mergemod.mergestate(repo) |
4659 m = scmutil.match(repo[None], pats, opts) |
4659 m = scmutil.match(repo[None], pats, opts) |
4660 ret = 0 |
4660 ret = 0 |
4661 |
4661 |
4662 for f in ms: |
4662 for f in ms: |
4663 if m(f): |
4663 if m(f): |
5350 if d in st[1]: |
5350 if d in st[1]: |
5351 st[1].remove(d) |
5351 st[1].remove(d) |
5352 st.insert(3, renamed) |
5352 st.insert(3, renamed) |
5353 st.insert(4, copied) |
5353 st.insert(4, copied) |
5354 |
5354 |
5355 ms = merge.mergestate(repo) |
5355 ms = mergemod.mergestate(repo) |
5356 st.append([f for f in ms if ms[f] == 'u']) |
5356 st.append([f for f in ms if ms[f] == 'u']) |
5357 |
5357 |
5358 subs = [s for s in ctx.substate if ctx.sub(s).dirty()] |
5358 subs = [s for s in ctx.substate if ctx.sub(s).dirty()] |
5359 st.append(subs) |
5359 st.append(subs) |
5360 |
5360 |