Patchwork [3,of,7] transplant: don't honor whitespace and format-changing diffopts

login
register
mail settings
Submitter Siddharth Agarwal
Date Dec. 2, 2014, 6:30 p.m.
Message ID <d0567be37614d98bdb4d.1417545014@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/6950/
State Accepted
Commit 2635f3e452e290aeb1b2884d5d8159f4f6fd99d8
Headers show

Comments

Siddharth Agarwal - Dec. 2, 2014, 6:30 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1416376145 28800
#      Tue Nov 18 21:49:05 2014 -0800
# Node ID d0567be37614d98bdb4da26d207b788094d1c3b1
# Parent  3f4ea445b52d04d825bcfec784c9f397f8c119aa
transplant: don't honor whitespace and format-changing diffopts

transplant uses diff purely internally.

Patch

diff --git a/hgext/transplant.py b/hgext/transplant.py
--- a/hgext/transplant.py
+++ b/hgext/transplant.py
@@ -118,7 +118,7 @@ 
         revs = sorted(revmap)
         p1, p2 = repo.dirstate.parents()
         pulls = []
-        diffopts = patch.diffopts(self.ui, opts)
+        diffopts = patch.difffeatureopts(self.ui, opts)
         diffopts.git = True
 
         lock = wlock = tr = None
diff --git a/tests/test-transplant.t b/tests/test-transplant.t
--- a/tests/test-transplant.t
+++ b/tests/test-transplant.t
@@ -230,7 +230,8 @@ 
   (transplanted from e234d668f844e1b1a765f01db83a32c0c7bfa170)
   1  r2
   0  r1
-remote transplant
+remote transplant, and also test that transplant doesn't break with
+format-breaking diffopts
 
   $ hg clone -r 1 ../t ../remote
   adding changesets
@@ -240,7 +241,7 @@ 
   updating to branch default
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd ../remote
-  $ hg transplant --log -s ../t 2 4
+  $ hg --config diff.noprefix=True transplant --log -s ../t 2 4
   searching for changes
   applying 37a1297eb21b
   37a1297eb21b transplanted to c19cf0ccb069