Mercurial > public > mercurial-scm > hg-stable
diff mercurial/patch.py @ 23300:f8b5c3e77d4b
patch.trydiff: add support for noprefix
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Wed, 12 Nov 2014 23:50:21 -0800 |
parents | d7abae94a7a0 |
children | f35526b999f4 |
line wrap: on
line diff
--- a/mercurial/patch.py Wed Nov 12 23:29:14 2014 -0800 +++ b/mercurial/patch.py Wed Nov 12 23:50:21 2014 -0800 @@ -1738,9 +1738,15 @@ s.update(text) return s.hexdigest() + if opts.noprefix: + aprefix = bprefix = '' + else: + aprefix = 'a/' + bprefix = 'b/' + def diffline(a, b, revs): if opts.git: - line = 'diff --git a/%s b/%s\n' % (a, b) + line = 'diff --git %s%s %s%s\n' % (aprefix, a, bprefix, b) elif not repo.ui.quiet: if revs: revinfo = ' '.join(["-r %s" % rev for rev in revs])