Patchwork record: show content of newly added files

login
register
mail settings
Submitter Laurent Charignon
Date March 9, 2015, 5:25 p.m.
Message ID <1e0846f2f1e735e7c80d.1425921926@lcharignon-mbp.local>
Download mbox | patch
Permalink /patch/7952/
State Changes Requested
Headers show

Comments

Laurent Charignon - March 9, 2015, 5:25 p.m.
# HG changeset patch
# User Laurent Charignon <lcharignon@fb.com>
# Date 1425686263 28800
#      Fri Mar 06 15:57:43 2015 -0800
# Node ID 1e0846f2f1e735e7c80d28afbd8e0e6d0256889e
# Parent  4e865115566e75f938cbff9dcf081da39008a161
record: show content of newly added files

While using the record extension to select changes, the user couldn't see the
content of newly added files and had to select/reject them based on filename.
The test is changed accordingly in two places.
Pierre-Yves David - March 9, 2015, 6:33 p.m.
On 03/09/2015 10:25 AM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon@fb.com>
> # Date 1425686263 28800
> #      Fri Mar 06 15:57:43 2015 -0800
> # Node ID 1e0846f2f1e735e7c80d28afbd8e0e6d0256889e
> # Parent  4e865115566e75f938cbff9dcf081da39008a161
> record: show content of newly added files

This patch looked good but the test apparently disagree:

- test-keyword.t
- test-mq-subrepo.t

How does this relate to issue4303 ?

Looking forward for a V2 ;-)

Patch

diff --git a/hgext/record.py b/hgext/record.py
--- a/hgext/record.py
+++ b/hgext/record.py
@@ -76,7 +76,7 @@ 
     """
     diffgit_re = re.compile('diff --git a/(.*) b/(.*)$')
     diff_re = re.compile('diff -r .* (.*)$')
-    allhunks_re = re.compile('(?:index|new file|deleted file) ')
+    allhunks_re = re.compile('(?:index|deleted file) ')
     pretty_re = re.compile('(?:new file|deleted file) ')
     special_re = re.compile('(?:index|new|deleted|copy|rename) ')
 
diff --git a/tests/test-record.t b/tests/test-record.t
--- a/tests/test-record.t
+++ b/tests/test-record.t
@@ -235,7 +235,19 @@ 
   new file mode 100644
   examine changes to 'plain'? [Ynesfdaq?] y
   
-
+  @@ -0,0 +1,10 @@
+  +1
+  +2
+  +3
+  +4
+  +5
+  +6
+  +7
+  +8
+  +9
+  +10
+  record this change to 'plain'? [Ynesfdaq?] y
+  
   $ hg tip -p
   changeset:   7:11fb457c1be4
   tag:         tip
@@ -317,6 +329,7 @@ 
   > y
   > y
   > y
+  > y
   > EOF
   diff --git a/plain b/plain
   1 hunks, 1 lines changed
@@ -335,7 +348,10 @@ 
   new file mode 100644
   examine changes to 'plain2'? [Ynesfdaq?] y
   
-
+  @@ -0,0 +1,1 @@
+  +1
+  record change 2/2 to 'plain2'? [Ynesfdaq?] y
+  
 Modify beginning, trim end, record both, add another file to test
 changes numbering