diff mercurial/commands.py @ 24432:e22248f6d257

commands.diff: add support for diffs relative to a subdirectory Previous patches added all the backend support for this. This exposes this option in the UI.
author Siddharth Agarwal <sid0@fb.com>
date Tue, 17 Mar 2015 15:46:30 -0700
parents 69bd0ec2f9be
children 16961d43dc89
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Mar 17 15:06:40 2015 -0700
+++ b/mercurial/commands.py	Tue Mar 17 15:46:30 2015 -0700
@@ -148,6 +148,7 @@
     ('U', 'unified', '',
      _('number of lines of context to show'), _('NUM')),
     ('', 'stat', None, _('output diffstat-style summary of changes')),
+    ('', 'relative', '', _('produce diffs relative to subdirectory'), _('DIR')),
 ]
 
 mergetoolopts = [
@@ -3169,7 +3170,8 @@
     diffopts = patch.diffallopts(ui, opts)
     m = scmutil.match(repo[node2], pats, opts)
     cmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat,
-                           listsubrepos=opts.get('subrepos'))
+                           listsubrepos=opts.get('subrepos'),
+                           relative=opts.get('relative'))
 
 @command('^export',
     [('o', 'output', '',