mercurial/commands.py
changeset 4435 aac150af09e8
parent 4394 a6436e9333db
child 4438 3900f684a150
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -881,8 +881,10 @@ def debuginstall(ui):
     # patch
     ui.status(_("Checking patch...\n"))
     path = os.environ.get('PATH', '')
-    patcher = util.find_in_path('gpatch', path,
-                                util.find_in_path('patch', path, None))
+    patcher = ui.config('ui', 'patch')
+    if not patcher:
+        patcher = util.find_in_path('gpatch', path,
+                                    util.find_in_path('patch', path, None))
     if not patcher:
         ui.write(_(" Can't find patch or gpatch in PATH\n"))
         ui.write(_(" (specify a patch utility in your .hgrc file)\n"))