Show More
@@ -976,7 +976,7 b' def backout(ui, repo, rev, **opts):' | |||
|
976 | 976 | if opts['parent']: |
|
977 | 977 | raise util.Abort(_('cannot use --parent on non-merge changeset')) |
|
978 | 978 | parent = p1 |
|
979 | hg.update(repo, node, force=True, show_stats=False) | |
|
979 | hg.update(repo, node, force=True, show_stats=False) # backout | |
|
980 | 980 | revert_opts = opts.copy() |
|
981 | 981 | revert_opts['rev'] = hex(parent) |
|
982 | 982 | revert(ui, repo, **revert_opts) |
@@ -993,7 +993,8 b' def backout(ui, repo, rev, **opts):' | |||
|
993 | 993 | if op1 != node: |
|
994 | 994 | if opts['merge']: |
|
995 | 995 | ui.status(_('merging with changeset %s\n') % nice(op1)) |
|
996 |
|
|
|
996 | n = _lookup(repo, hex(op1)) | |
|
997 | hg.update(repo, n, allow=True) # merge | |
|
997 | 998 | else: |
|
998 | 999 | ui.status(_('the backout changeset is a new head - ' |
|
999 | 1000 | 'do not forget to merge\n')) |
@@ -2152,7 +2153,7 b' def manifest(ui, repo, rev=None):' | |||
|
2152 | 2153 | for f in files: |
|
2153 | 2154 | ui.write("%40s %3s %s\n" % (hex(m[f]), mf[f] and "755" or "644", f)) |
|
2154 | 2155 | |
|
2155 |
def merge(ui, repo, node=None, |
|
|
2156 | def merge(ui, repo, node=None, force=None, branch=None): | |
|
2156 | 2157 | """Merge working directory with another revision |
|
2157 | 2158 | |
|
2158 | 2159 | Merge the contents of the current working directory and the |
@@ -2160,7 +2161,9 b' def merge(ui, repo, node=None, **opts):' | |||
|
2160 | 2161 | marked as changed for the next commit and a commit must be |
|
2161 | 2162 | performed before any further updates are allowed. |
|
2162 | 2163 | """ |
|
2163 | return doupdate(ui, repo, node=node, merge=True, **opts) | |
|
2164 | ||
|
2165 | node = _lookup(repo, node, branch) | |
|
2166 | hg.update(repo, node, allow=True, forcemerge=force) # merge | |
|
2164 | 2167 | |
|
2165 | 2168 | def outgoing(ui, repo, dest=None, **opts): |
|
2166 | 2169 | """show changesets not found in destination |
@@ -2254,7 +2257,7 b' def postincoming(ui, repo, modheads, opt' | |||
|
2254 | 2257 | return |
|
2255 | 2258 | if optupdate: |
|
2256 | 2259 | if modheads == 1: |
|
2257 |
return |
|
|
2260 | return hg.update(repo, repo.changelog.tip()) # update | |
|
2258 | 2261 | else: |
|
2259 | 2262 | ui.status(_("not updating, since new heads added\n")) |
|
2260 | 2263 | if modheads > 1: |
@@ -2604,7 +2607,7 b' def revert(ui, repo, *pats, **opts):' | |||
|
2604 | 2607 | if not opts.get('dry_run'): |
|
2605 | 2608 | repo.dirstate.forget(forget[0]) |
|
2606 | 2609 | r = hg.update(repo, node, False, True, update.has_key, False, |
|
2607 | wlock=wlock, show_stats=False) | |
|
2610 | wlock=wlock, show_stats=False) # revert | |
|
2608 | 2611 | repo.dirstate.update(add[0], 'a') |
|
2609 | 2612 | repo.dirstate.update(undelete[0], 'n') |
|
2610 | 2613 | repo.dirstate.update(remove[0], 'r') |
@@ -2905,10 +2908,10 b' def update(ui, repo, node=None, merge=Fa' | |||
|
2905 | 2908 | if merge: |
|
2906 | 2909 | ui.warn(_('(the -m/--merge option is deprecated; ' |
|
2907 | 2910 | 'use the merge command instead)\n')) |
|
2908 | return doupdate(ui, repo, node, merge, clean, force, branch) | |
|
2909 | ||
|
2910 | def doupdate(ui, repo, node=None, merge=False, clean=False, force=None, | |
|
2911 | branch=None): | |
|
2911 | node = _lookup(repo, node, branch) | |
|
2912 | return hg.update(repo, node, allow=merge, force=clean, forcemerge=force) | |
|
2913 | ||
|
2914 | def _lookup(repo, node, branch=None): | |
|
2912 | 2915 | if branch: |
|
2913 | 2916 | br = repo.branchlookup(branch=branch) |
|
2914 | 2917 | found = [] |
@@ -2916,19 +2919,19 b' def doupdate(ui, repo, node=None, merge=' | |||
|
2916 | 2919 | if branch in br[x]: |
|
2917 | 2920 | found.append(x) |
|
2918 | 2921 | if len(found) > 1: |
|
2919 | ui.warn(_("Found multiple heads for %s\n") % branch) | |
|
2922 | repo.ui.warn(_("Found multiple heads for %s\n") % branch) | |
|
2920 | 2923 | for x in found: |
|
2921 | 2924 | show_changeset(ui, repo, {}).show(changenode=x, brinfo=br) |
|
2922 |
re |
|
|
2925 | raise util.Abort("") | |
|
2923 | 2926 | if len(found) == 1: |
|
2924 | 2927 | node = found[0] |
|
2925 |
ui.warn(_("Using head %s for branch %s\n") |
|
|
2928 | repo.ui.warn(_("Using head %s for branch %s\n") | |
|
2929 | % (short(node), branch)) | |
|
2926 | 2930 | else: |
|
2927 |
ui. |
|
|
2928 | return 1 | |
|
2931 | raise util.Abort(_("branch %s not found\n") % (branch)) | |
|
2929 | 2932 | else: |
|
2930 | 2933 | node = node and repo.lookup(node) or repo.changelog.tip() |
|
2931 | return hg.update(repo, node, allow=merge, force=clean, forcemerge=force) | |
|
2934 | return node | |
|
2932 | 2935 | |
|
2933 | 2936 | def verify(ui, repo): |
|
2934 | 2937 | """verify the integrity of the repository |
General Comments 0
You need to be logged in to leave comments.
Login now