diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt --- a/doc/hgrc.5.txt +++ b/doc/hgrc.5.txt @@ -911,9 +911,6 @@ User interface controls. The conflict resolution program to use during a manual merge. For more information on merge tools see :hg:`help merge-tools`. For configuring merge tools see the merge-tools_ section. -``patch`` - command to use to apply patches. Look for ``gpatch`` or ``patch`` in - PATH if unset. ``quiet`` Reduce the amount of output printed. True or False. Default is False. ``remotecmd`` diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1559,45 +1559,6 @@ def debuginstall(ui): ui.write(_(" (templates seem to have been installed incorrectly)\n")) problems += 1 - # patch - ui.status(_("Checking patch...\n")) - patchproblems = 0 - a = "1\n2\n3\n4\n" - b = "1\n2\n3\ninsert\n4\n" - fa = writetemp(a) - d = mdiff.unidiff(a, None, b, None, os.path.basename(fa), - os.path.basename(fa)) - fd = writetemp(d) - - files = {} - try: - patch.patch(fd, ui, cwd=os.path.dirname(fa), files=files) - except util.Abort, e: - ui.write(_(" patch call failed:\n")) - ui.write(" " + str(e) + "\n") - patchproblems += 1 - else: - if list(files) != [os.path.basename(fa)]: - ui.write(_(" unexpected patch output!\n")) - patchproblems += 1 - a = open(fa).read() - if a != b: - ui.write(_(" patch test failed!\n")) - patchproblems += 1 - - if patchproblems: - if ui.config('ui', 'patch'): - ui.write(_(" (Current patch tool may be incompatible with patch," - " or misconfigured. Please check your configuration" - " file)\n")) - else: - ui.write(_(" Internal patcher failure, please report this error" - " to http://mercurial.selenic.com/wiki/BugTracker\n")) - problems += patchproblems - - os.unlink(fa) - os.unlink(fd) - # editor ui.status(_("Checking commit editor...\n")) editor = ui.geteditor() diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1156,7 +1156,7 @@ def _applydiff(ui, fp, patcher, copyfn, return -1 return err -def externalpatch(patcher, patchname, ui, strip, cwd, files): +def _externalpatch(patcher, patchname, ui, strip, cwd, files): """use to apply to the working directory. returns whether patch was applied with fuzz factor.""" @@ -1240,7 +1240,7 @@ def patch(patchname, ui, strip=1, cwd=No files = {} try: if patcher: - return externalpatch(patcher, patchname, ui, strip, cwd, files) + return _externalpatch(patcher, patchname, ui, strip, cwd, files) return internalpatch(patchname, ui, strip, cwd, files, eolmode) except PatchError, err: raise util.Abort(str(err)) diff --git a/tests/test-install.t b/tests/test-install.t --- a/tests/test-install.t +++ b/tests/test-install.t @@ -3,7 +3,6 @@ hg debuginstall Checking encoding (ascii)... Checking installed modules (*/mercurial)... (glob) Checking templates... - Checking patch... Checking commit editor... Checking username... No problems detected @@ -13,7 +12,6 @@ hg debuginstall with no username Checking encoding (ascii)... Checking installed modules (*/mercurial)... (glob) Checking templates... - Checking patch... Checking commit editor... Checking username... no username supplied (see "hg help config")