##// END OF EJS Templates
patch: deprecate ui.patch / external patcher feature...
Patrick Mezard -
r13751:85d74f6b default
parent child Browse files
Show More
@@ -911,9 +911,6 b' User interface controls.'
911 The conflict resolution program to use during a manual merge.
911 The conflict resolution program to use during a manual merge.
912 For more information on merge tools see :hg:`help merge-tools`.
912 For more information on merge tools see :hg:`help merge-tools`.
913 For configuring merge tools see the merge-tools_ section.
913 For configuring merge tools see the merge-tools_ section.
914 ``patch``
915 command to use to apply patches. Look for ``gpatch`` or ``patch`` in
916 PATH if unset.
917 ``quiet``
914 ``quiet``
918 Reduce the amount of output printed. True or False. Default is False.
915 Reduce the amount of output printed. True or False. Default is False.
919 ``remotecmd``
916 ``remotecmd``
@@ -1559,45 +1559,6 b' def debuginstall(ui):'
1559 ui.write(_(" (templates seem to have been installed incorrectly)\n"))
1559 ui.write(_(" (templates seem to have been installed incorrectly)\n"))
1560 problems += 1
1560 problems += 1
1561
1561
1562 # patch
1563 ui.status(_("Checking patch...\n"))
1564 patchproblems = 0
1565 a = "1\n2\n3\n4\n"
1566 b = "1\n2\n3\ninsert\n4\n"
1567 fa = writetemp(a)
1568 d = mdiff.unidiff(a, None, b, None, os.path.basename(fa),
1569 os.path.basename(fa))
1570 fd = writetemp(d)
1571
1572 files = {}
1573 try:
1574 patch.patch(fd, ui, cwd=os.path.dirname(fa), files=files)
1575 except util.Abort, e:
1576 ui.write(_(" patch call failed:\n"))
1577 ui.write(" " + str(e) + "\n")
1578 patchproblems += 1
1579 else:
1580 if list(files) != [os.path.basename(fa)]:
1581 ui.write(_(" unexpected patch output!\n"))
1582 patchproblems += 1
1583 a = open(fa).read()
1584 if a != b:
1585 ui.write(_(" patch test failed!\n"))
1586 patchproblems += 1
1587
1588 if patchproblems:
1589 if ui.config('ui', 'patch'):
1590 ui.write(_(" (Current patch tool may be incompatible with patch,"
1591 " or misconfigured. Please check your configuration"
1592 " file)\n"))
1593 else:
1594 ui.write(_(" Internal patcher failure, please report this error"
1595 " to http://mercurial.selenic.com/wiki/BugTracker\n"))
1596 problems += patchproblems
1597
1598 os.unlink(fa)
1599 os.unlink(fd)
1600
1601 # editor
1562 # editor
1602 ui.status(_("Checking commit editor...\n"))
1563 ui.status(_("Checking commit editor...\n"))
1603 editor = ui.geteditor()
1564 editor = ui.geteditor()
@@ -1156,7 +1156,7 b' def _applydiff(ui, fp, patcher, copyfn, '
1156 return -1
1156 return -1
1157 return err
1157 return err
1158
1158
1159 def externalpatch(patcher, patchname, ui, strip, cwd, files):
1159 def _externalpatch(patcher, patchname, ui, strip, cwd, files):
1160 """use <patcher> to apply <patchname> to the working directory.
1160 """use <patcher> to apply <patchname> to the working directory.
1161 returns whether patch was applied with fuzz factor."""
1161 returns whether patch was applied with fuzz factor."""
1162
1162
@@ -1240,7 +1240,7 b' def patch(patchname, ui, strip=1, cwd=No'
1240 files = {}
1240 files = {}
1241 try:
1241 try:
1242 if patcher:
1242 if patcher:
1243 return externalpatch(patcher, patchname, ui, strip, cwd, files)
1243 return _externalpatch(patcher, patchname, ui, strip, cwd, files)
1244 return internalpatch(patchname, ui, strip, cwd, files, eolmode)
1244 return internalpatch(patchname, ui, strip, cwd, files, eolmode)
1245 except PatchError, err:
1245 except PatchError, err:
1246 raise util.Abort(str(err))
1246 raise util.Abort(str(err))
@@ -3,7 +3,6 b' hg debuginstall'
3 Checking encoding (ascii)...
3 Checking encoding (ascii)...
4 Checking installed modules (*/mercurial)... (glob)
4 Checking installed modules (*/mercurial)... (glob)
5 Checking templates...
5 Checking templates...
6 Checking patch...
7 Checking commit editor...
6 Checking commit editor...
8 Checking username...
7 Checking username...
9 No problems detected
8 No problems detected
@@ -13,7 +12,6 b' hg debuginstall with no username'
13 Checking encoding (ascii)...
12 Checking encoding (ascii)...
14 Checking installed modules (*/mercurial)... (glob)
13 Checking installed modules (*/mercurial)... (glob)
15 Checking templates...
14 Checking templates...
16 Checking patch...
17 Checking commit editor...
15 Checking commit editor...
18 Checking username...
16 Checking username...
19 no username supplied (see "hg help config")
17 no username supplied (see "hg help config")
General Comments 0
You need to be logged in to leave comments. Login now