Patchwork [Bug,4626] New: Regression: Adding new file with record from within a subdir crashes

login
register
mail settings
Submitter mercurial-bugs@selenic.com
Date April 27, 2015, 8:53 p.m.
Message ID <bug-4626-285@http.bz.selenic.com/>
Download mbox | patch
Permalink /patch/8798/
State Not Applicable
Headers show

Comments

mercurial-bugs@selenic.com - April 27, 2015, 8:53 p.m.
http://bz.selenic.com/show_bug.cgi?id=4626

          Priority: normal
            Bug ID: 4626
                CC: mercurial-devel@selenic.com
          Assignee: bugzilla@selenic.com
           Summary: Regression: Adding new file with record from within a
                    subdir crashes
          Severity: bug
    Classification: Unclassified
                OS: Mac OS
          Reporter: lcharignon@fb.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 3.4-rc
         Component: record
           Product: Mercurial

Test proving the issue, this is because we should compute the path relative to
the current location:

Patch

diff --git a/tests/test-commit-interactive.t b/tests/test-commit-interactive.t
--- a/tests/test-commit-interactive.t
+++ b/tests/test-commit-interactive.t
@@ -1463,4 +1463,26 @@ 
   This is the first line
   This is the second line
   This is the third line
+
+Add new file from within a subdirectory
+  $ hg update -C .
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ mkdir folder
+  $ cd folder
+  $ echo "foo" > bar
+  $ hg add bar
+  $ hg record <<EOF
+  > y
+  > y
+  > EOF
+  diff --git a/folder/bar b/folder/bar
+  new file mode 100644
+  examine changes to 'folder/bar'? [Ynesfdaq?] y
+
+  @@ -0,0 +1,1 @@
+  +foo
+  record this change to 'folder/bar'? [Ynesfdaq?] y
+
+  abort: No such file or directory: 'folder/bar'
+  [255]
   $ cd ..