record: don't honor format-changing diffopts (issue4459)
authorSiddharth Agarwal <sid0@fb.com>
Tue, 18 Nov 2014 20:00:37 -0800
changeset 23435 486a1fe09422
parent 23434 60300a4c0ae5
child 23436 52db731b964d
record: don't honor format-changing diffopts (issue4459) record does support the whitespace options, so honor those. In upcoming patches we'll replace all the other uses.
hgext/record.py
tests/test-record.t
--- a/hgext/record.py	Tue Nov 18 17:22:03 2014 -0800
+++ b/hgext/record.py	Tue Nov 18 20:00:37 2014 -0800
@@ -519,10 +519,9 @@
                                '(use "hg commit" instead)'))
 
         status = repo.status(match=match)
-        diffopts = opts.copy()
-        diffopts['nodates'] = True
-        diffopts['git'] = True
-        diffopts = patch.diffopts(ui, opts=diffopts)
+        diffopts = patch.difffeatureopts(ui, opts=opts, whitespace=True)
+        diffopts.nodates = True
+        diffopts.git = True
         chunks = patch.diff(repo, changes=status, opts=diffopts)
         fp = cStringIO.StringIO()
         fp.write(''.join(chunks))
--- a/tests/test-record.t	Tue Nov 18 17:22:03 2014 -0800
+++ b/tests/test-record.t	Tue Nov 18 20:00:37 2014 -0800
@@ -559,9 +559,9 @@
   >   echo $i >> plain
   > done
 
-Record beginning, middle
+Record beginning, middle, and test that format-breaking diffopts are ignored
 
-  $ hg record -d '14 0' -m middle-only plain <<EOF
+  $ hg record --config diff.noprefix=True -d '14 0' -m middle-only plain <<EOF
   > y
   > y
   > y