##// END OF EJS Templates
import: report directory-relative paths in error messages (issue5224)...
liscju -
r29900:50f2966f default
parent child Browse files
Show More
@@ -669,6 +669,8 b' class patchfile(object):'
669 self.mode = (False, False)
669 self.mode = (False, False)
670 if self.missing:
670 if self.missing:
671 self.ui.warn(_("unable to find '%s' for patching\n") % self.fname)
671 self.ui.warn(_("unable to find '%s' for patching\n") % self.fname)
672 self.ui.warn(_("(use '--prefix' to apply patch relative to the "
673 "current directory)\n"))
672
674
673 self.hash = {}
675 self.hash = {}
674 self.dirty = 0
676 self.dirty = 0
@@ -41,6 +41,7 b' Test failure without --exact'
41 $ hg import --bypass ../test.diff
41 $ hg import --bypass ../test.diff
42 applying ../test.diff
42 applying ../test.diff
43 unable to find 'a' for patching
43 unable to find 'a' for patching
44 (use '--prefix' to apply patch relative to the current directory)
44 abort: patch failed to apply
45 abort: patch failed to apply
45 [255]
46 [255]
46 $ hg st
47 $ hg st
@@ -1623,6 +1623,7 b' Importing with unknown file:'
1623 $ hg export --rev 'desc("extended jungle")' | hg import --partial -
1623 $ hg export --rev 'desc("extended jungle")' | hg import --partial -
1624 applying patch from stdin
1624 applying patch from stdin
1625 unable to find 'jungle' for patching
1625 unable to find 'jungle' for patching
1626 (use '--prefix' to apply patch relative to the current directory)
1626 1 out of 1 hunks FAILED -- saving rejects to file jungle.rej
1627 1 out of 1 hunks FAILED -- saving rejects to file jungle.rej
1627 patch applied partially
1628 patch applied partially
1628 (fix the .rej files and run `hg commit --amend`)
1629 (fix the .rej files and run `hg commit --amend`)
@@ -1764,3 +1765,31 b' Importing some extra header'
1764 $ hg log --debug -r . | grep extra
1765 $ hg log --debug -r . | grep extra
1765 extra: branch=default
1766 extra: branch=default
1766 extra: foo=bar
1767 extra: foo=bar
1768
1769 Warn the user that paths are relative to the root of
1770 repository when file not found for patching
1771
1772 $ mkdir filedir
1773 $ echo "file1" >> filedir/file1
1774 $ hg add filedir/file1
1775 $ hg commit -m "file1"
1776 $ cd filedir
1777 $ hg import -p 2 - <<EOF
1778 > # HG changeset patch
1779 > # User test
1780 > # Date 0 0
1781 > file2
1782 >
1783 > diff --git a/filedir/file1 b/filedir/file1
1784 > --- a/filedir/file1
1785 > +++ b/filedir/file1
1786 > @@ -1,1 +1,2 @@
1787 > file1
1788 > +file2
1789 > EOF
1790 applying patch from stdin
1791 unable to find 'file1' for patching
1792 (use '--prefix' to apply patch relative to the current directory)
1793 1 out of 1 hunks FAILED -- saving rejects to file file1.rej
1794 abort: patch failed to apply
1795 [255]
@@ -42,6 +42,7 b' Push patch with missing target:'
42 $ hg qpush
42 $ hg qpush
43 applying changeb
43 applying changeb
44 unable to find 'b' for patching
44 unable to find 'b' for patching
45 (use '--prefix' to apply patch relative to the current directory)
45 2 out of 2 hunks FAILED -- saving rejects to file b.rej
46 2 out of 2 hunks FAILED -- saving rejects to file b.rej
46 patch failed, unable to continue (try -v)
47 patch failed, unable to continue (try -v)
47 patch failed, rejects left in working directory
48 patch failed, rejects left in working directory
@@ -147,6 +148,7 b' Push git patch with missing target:'
147 $ hg qpush
148 $ hg qpush
148 applying changeb
149 applying changeb
149 unable to find 'b' for patching
150 unable to find 'b' for patching
151 (use '--prefix' to apply patch relative to the current directory)
150 1 out of 1 hunks FAILED -- saving rejects to file b.rej
152 1 out of 1 hunks FAILED -- saving rejects to file b.rej
151 patch failed, unable to continue (try -v)
153 patch failed, unable to continue (try -v)
152 patch failed, rejects left in working directory
154 patch failed, rejects left in working directory
General Comments 0
You need to be logged in to leave comments. Login now