##// END OF EJS Templates
add -w and -p options to diff. this is for issue 126.
Vadim Gelfer -
r1728:9b92b71d default
parent child Browse files
Show More
@@ -223,9 +223,11 b' diff [-a] [-r revision] [-r revision] [f'
223 probably with undesirable results.
223 probably with undesirable results.
224
224
225 options:
225 options:
226 -a, --text treat all files as text
226 -a, --text treat all files as text
227 -I, --include <pat> include names matching the given patterns
227 -I, --include <pat> include names matching the given patterns
228 -X, --exclude <pat> exclude names matching the given patterns
228 -p, --show-function show which function each change is in
229 -X, --exclude <pat> exclude names matching the given patterns
230 -w, --ignore-all-space ignore white space when comparing lines
229
231
230 export [-o filespec] [revision] ...::
232 export [-o filespec] [revision] ...::
231 Print the changeset header and diffs for one or more revisions.
233 Print the changeset header and diffs for one or more revisions.
@@ -261,7 +261,7 b' def make_file(repo, r, pat, node=None,'
261 mode)
261 mode)
262
262
263 def dodiff(fp, ui, repo, node1, node2, files=None, match=util.always,
263 def dodiff(fp, ui, repo, node1, node2, files=None, match=util.always,
264 changes=None, text=False):
264 changes=None, text=False, opts={}):
265 if not changes:
265 if not changes:
266 changes = repo.changes(node1, node2, files, match=match)
266 changes = repo.changes(node1, node2, files, match=match)
267 modified, added, removed, deleted, unknown = changes
267 modified, added, removed, deleted, unknown = changes
@@ -296,8 +296,8 b' def dodiff(fp, ui, repo, node1, node2, f'
296 date1 = util.datestr(change[2])
296 date1 = util.datestr(change[2])
297
297
298 diffopts = ui.diffopts()
298 diffopts = ui.diffopts()
299 showfunc = diffopts['showfunc']
299 showfunc = opts.get('show_function') or diffopts['showfunc']
300 ignorews = diffopts['ignorews']
300 ignorews = opts.get('ignore_all_space') or diffopts['ignorews']
301 for f in modified:
301 for f in modified:
302 to = None
302 to = None
303 if f in mmap:
303 if f in mmap:
@@ -1140,7 +1140,7 b' def diff(ui, repo, *pats, **opts):'
1140 fns, matchfn, anypats = matchpats(repo, pats, opts)
1140 fns, matchfn, anypats = matchpats(repo, pats, opts)
1141
1141
1142 dodiff(sys.stdout, ui, repo, node1, node2, fns, match=matchfn,
1142 dodiff(sys.stdout, ui, repo, node1, node2, fns, match=matchfn,
1143 text=opts['text'])
1143 text=opts['text'], opts=opts)
1144
1144
1145 def doexport(ui, repo, changeset, seqno, total, revwidth, opts):
1145 def doexport(ui, repo, changeset, seqno, total, revwidth, opts):
1146 node = repo.lookup(changeset)
1146 node = repo.lookup(changeset)
@@ -2337,7 +2337,12 b' table = {'
2337 [('r', 'rev', [], _('revision')),
2337 [('r', 'rev', [], _('revision')),
2338 ('a', 'text', None, _('treat all files as text')),
2338 ('a', 'text', None, _('treat all files as text')),
2339 ('I', 'include', [], _('include names matching the given patterns')),
2339 ('I', 'include', [], _('include names matching the given patterns')),
2340 ('X', 'exclude', [], _('exclude names matching the given patterns'))],
2340 ('p', 'show-function', None,
2341 _('show which function each change is in')),
2342 ('w', 'ignore-all-space', None,
2343 _('ignore white space when comparing lines')),
2344 ('X', 'exclude', [],
2345 _('exclude names matching the given patterns'))],
2341 _('hg diff [-a] [-I] [-X] [-r REV1 [-r REV2]] [FILE]...')),
2346 _('hg diff [-a] [-I] [-X] [-r REV1 [-r REV2]] [FILE]...')),
2342 "^export":
2347 "^export":
2343 (export,
2348 (export,
General Comments 0
You need to be logged in to leave comments. Login now