mercurial/cmdutil.py
changeset 3837 7df171ea50cd
parent 3827 3674ca805a5b
child 3838 dec4eba7ccad
--- a/mercurial/cmdutil.py	Fri Dec 08 17:10:40 2006 -0800
+++ b/mercurial/cmdutil.py	Fri Dec 08 20:44:58 2006 -0600
@@ -314,7 +314,7 @@
     def showpatch(self, node):
         if self.patch:
             prev = self.repo.changelog.parents(node)[0]
-            patch.diff(self.repo, prev, node, fp=self.ui)
+            patch.diff(self.repo, prev, node, match=self.patch, fp=self.ui)
             self.ui.write("\n")
 
 class changeset_templater(changeset_printer):
@@ -510,7 +510,7 @@
         except SyntaxError, inst:
             raise util.Abort(_('%s: %s') % (self.t.mapfile, inst.args[0]))
 
-def show_changeset(ui, repo, opts, buffered=False):
+def show_changeset(ui, repo, opts, buffered=False, matchfn=False):
     """show one changeset using template or regular display.
 
     Display format will be the first non-empty hit of:
@@ -522,7 +522,12 @@
     regular display via changeset_printer() is done.
     """
     # options
-    patch = opts.get('patch')
+    patch = False
+    if opts.get('patch'):
+        patch = lambda x: True
+        if matchfn:
+            patch = matchfn
+
     br = None
     if opts.get('branches'):
         ui.warn(_("the --branches option is deprecated, "