mdiff.diffopts: add a new noprefix option
authorSiddharth Agarwal <sid0@fb.com>
Wed, 12 Nov 2014 23:25:32 -0800
changeset 23294 ec8c73b02e2e
parent 23293 b89856abf4e2
child 23295 ac072c79bd9d
mdiff.diffopts: add a new noprefix option By popular demand, we introduce an option to disable the 'a/' and 'b/' prefixes in diff output. This makes copying and pasting filenames from diff output easier. This option will be implemented and documented in upcoming patches. To ensure that existing scripts that parse output don't break, we will ensure that this prefix is disabled in plain mode. A straight 'hg export | hg import' without HGPLAIN=1 will still be broken though, but there's little that can be done about that.
mercurial/mdiff.py
--- a/mercurial/mdiff.py	Wed Nov 12 23:19:44 2014 -0800
+++ b/mercurial/mdiff.py	Wed Nov 12 23:25:32 2014 -0800
@@ -26,6 +26,7 @@
     git enables the git extended patch format
     nodates removes dates from diff headers
     nobinary ignores binary files
+    noprefix disables the 'a/' and 'b/' prefixes (ignored in plain mode)
     ignorews ignores all whitespace changes in the diff
     ignorewsamount ignores changes in the amount of whitespace
     ignoreblanklines ignores changes whose lines are all blank
@@ -39,6 +40,7 @@
         'git': False,
         'nodates': False,
         'nobinary': False,
+        'noprefix': False,
         'ignorews': False,
         'ignorewsamount': False,
         'ignoreblanklines': False,