Patchwork [7,of,7] record: don't honor format-changing diffopts (issue4459)

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 22, 2014, 1 a.m.
Message ID <6f01e7d6689c61b37880.1416618009@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/6828/
State Superseded
Commit 486a1fe09422f7738ef356bd135376dd1fbefb4b
Headers show

Comments

Siddharth Agarwal - Nov. 22, 2014, 1 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1416369637 28800
#      Tue Nov 18 20:00:37 2014 -0800
# Node ID 6f01e7d6689c61b3788010d82122fb3365233fab
# Parent  6aa17cf4615cef0e44c99d73864db1aa244ea580
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.

Patch

diff --git hgext/record.py hgext/record.py
--- hgext/record.py
+++ hgext/record.py
@@ -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))
diff --git tests/test-record.t tests/test-record.t
--- tests/test-record.t
+++ tests/test-record.t
@@ -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