Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/patch.py @ 29904:50f2966f86ca
import: report directory-relative paths in error messages (issue5224)
Import uses paths relative to the root of the repository, so when
user imports patch with paths relative to the current working directory
import aborts with 'unable to find file for patching'.
This patch improves this situation by warning the user that paths are
relative to the root of repository when patching fails.
author | liscju <piotr.listkiewicz@gmail.com> |
---|---|
date | Fri, 26 Aug 2016 12:48:20 +0200 |
parents | 160c829dd5d0 |
children | e40343ce9c4c |
comparison
equal
deleted
inserted
replaced
29903:a9b92164a1f4 | 29904:50f2966f86ca |
---|---|
667 self.missing = False | 667 self.missing = False |
668 if self.mode is None: | 668 if self.mode is None: |
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 |
675 self.offset = 0 | 677 self.offset = 0 |
676 self.skew = 0 | 678 self.skew = 0 |