equal
deleted
inserted
replaced
166 if backups: |
166 if backups: |
167 # Equivalent to hg.revert |
167 # Equivalent to hg.revert |
168 choices = lambda key: key in backups |
168 choices = lambda key: key in backups |
169 mergemod.update(repo, repo.dirstate.p1(), |
169 mergemod.update(repo, repo.dirstate.p1(), |
170 False, True, choices) |
170 False, True, choices) |
171 |
|
172 |
171 |
173 # 3b. (apply) |
172 # 3b. (apply) |
174 if dopatch: |
173 if dopatch: |
175 try: |
174 try: |
176 ui.debug('applying patch\n') |
175 ui.debug('applying patch\n') |
670 res = lambda p: os.path.join(dest, |
669 res = lambda p: os.path.join(dest, |
671 os.path.basename(util.localpath(p))) |
670 os.path.basename(util.localpath(p))) |
672 else: |
671 else: |
673 res = lambda p: dest |
672 res = lambda p: dest |
674 return res |
673 return res |
675 |
|
676 |
674 |
677 pats = scmutil.expandpats(pats) |
675 pats = scmutil.expandpats(pats) |
678 if not pats: |
676 if not pats: |
679 raise util.Abort(_('no source or destination specified')) |
677 raise util.Abort(_('no source or destination specified')) |
680 if len(pats) == 1: |
678 if len(pats) == 1: |
978 write = repo.ui.write |
976 write = repo.ui.write |
979 else: |
977 else: |
980 def write(s, **kw): |
978 def write(s, **kw): |
981 fp.write(s) |
979 fp.write(s) |
982 |
980 |
983 |
|
984 write("# HG changeset patch\n") |
981 write("# HG changeset patch\n") |
985 write("# User %s\n" % ctx.user()) |
982 write("# User %s\n" % ctx.user()) |
986 write("# Date %d %d\n" % ctx.date()) |
983 write("# Date %d %d\n" % ctx.date()) |
987 write("# %s\n" % util.datestr(ctx.date())) |
984 write("# %s\n" % util.datestr(ctx.date())) |
988 if branch and branch != 'default': |
985 if branch and branch != 'default': |
1649 |
1646 |
1650 if node is None: |
1647 if node is None: |
1651 last = len(filelog) - 1 |
1648 last = len(filelog) - 1 |
1652 else: |
1649 else: |
1653 last = filelog.rev(node) |
1650 last = filelog.rev(node) |
1654 |
|
1655 |
1651 |
1656 # keep track of all ancestors of the file |
1652 # keep track of all ancestors of the file |
1657 ancestors = set([filelog.linkrev(last)]) |
1653 ancestors = set([filelog.linkrev(last)]) |
1658 |
1654 |
1659 # iterate from latest to oldest revision |
1655 # iterate from latest to oldest revision |
3044 ui.status(msg % rel) |
3040 ui.status(msg % rel) |
3045 elif exact: |
3041 elif exact: |
3046 ui.warn(msg % rel) |
3042 ui.warn(msg % rel) |
3047 break |
3043 break |
3048 |
3044 |
3049 |
|
3050 if not opts.get('dry_run'): |
3045 if not opts.get('dry_run'): |
3051 needdata = ('revert', 'add', 'undelete') |
3046 needdata = ('revert', 'add', 'undelete') |
3052 _revertprefetch(repo, ctx, *[actions[name][0] for name in needdata]) |
3047 _revertprefetch(repo, ctx, *[actions[name][0] for name in needdata]) |
3053 _performrevert(repo, parents, ctx, actions, interactive) |
3048 _performrevert(repo, parents, ctx, actions, interactive) |
3054 |
3049 |