833 |
833 |
834 Without the -a option, diff will avoid generating diffs of files |
834 Without the -a option, diff will avoid generating diffs of files |
835 it detects as binary. With -a, diff will generate a diff anyway, |
835 it detects as binary. With -a, diff will generate a diff anyway, |
836 probably with undesirable results. |
836 probably with undesirable results. |
837 """ |
837 """ |
838 node1, node2 = cmdutil.revpair(ui, repo, opts['rev']) |
838 node1, node2 = cmdutil.revpair(repo, opts['rev']) |
839 |
839 |
840 fns, matchfn, anypats = cmdutil.matchpats(repo, pats, opts) |
840 fns, matchfn, anypats = cmdutil.matchpats(repo, pats, opts) |
841 |
841 |
842 patch.diff(repo, node1, node2, fns, match=matchfn, |
842 patch.diff(repo, node1, node2, fns, match=matchfn, |
843 opts=patch.diffopts(ui, opts)) |
843 opts=patch.diffopts(ui, opts)) |
869 With the --switch-parent option, the diff will be against the second |
869 With the --switch-parent option, the diff will be against the second |
870 parent. It can be useful to review a merge. |
870 parent. It can be useful to review a merge. |
871 """ |
871 """ |
872 if not changesets: |
872 if not changesets: |
873 raise util.Abort(_("export requires at least one changeset")) |
873 raise util.Abort(_("export requires at least one changeset")) |
874 revs = cmdutil.revrange(ui, repo, changesets) |
874 revs = cmdutil.revrange(repo, changesets) |
875 if len(revs) > 1: |
875 if len(revs) > 1: |
876 ui.note(_('exporting patches:\n')) |
876 ui.note(_('exporting patches:\n')) |
877 else: |
877 else: |
878 ui.note(_('exporting patch:\n')) |
878 ui.note(_('exporting patch:\n')) |
879 patch.export(repo, map(repo.lookup, revs), template=opts['output'], |
879 patch.export(repo, map(repo.lookup, revs), template=opts['output'], |
2118 I = ignored (not shown by default) |
2118 I = ignored (not shown by default) |
2119 = the previous added file was copied from here |
2119 = the previous added file was copied from here |
2120 """ |
2120 """ |
2121 |
2121 |
2122 all = opts['all'] |
2122 all = opts['all'] |
2123 node1, node2 = cmdutil.revpair(ui, repo, opts.get('rev')) |
2123 node1, node2 = cmdutil.revpair(repo, opts.get('rev')) |
2124 |
2124 |
2125 files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts) |
2125 files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts) |
2126 cwd = (pats and repo.getcwd()) or '' |
2126 cwd = (pats and repo.getcwd()) or '' |
2127 modified, added, removed, deleted, unknown, ignored, clean = [ |
2127 modified, added, removed, deleted, unknown, ignored, clean = [ |
2128 [util.pathto(cwd, x) for x in n] |
2128 [util.pathto(cwd, x) for x in n] |