diff mercurial/cmdutil.py @ 8568:4fa1618bf495

match: refactor patkind add patkind(pat) to match change external users change util.patkind to _patsplit
author Matt Mackall <mpm@selenic.com>
date Sun, 24 May 2009 02:56:14 -0500
parents 5b6a6ed4f185
children 573734e7e6d0
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Sun May 24 02:56:14 2009 -0500
+++ b/mercurial/cmdutil.py	Sun May 24 02:56:14 2009 -0500
@@ -447,7 +447,7 @@
     # srcs: list of (hgsep, hgsep, ossep, bool)
     # return: function that takes hgsep and returns ossep
     def targetpathafterfn(pat, dest, srcs):
-        if util.patkind(pat, None)[0]:
+        if _match.patkind(pat):
             # a mercurial pattern
             res = lambda p: os.path.join(dest,
                                          os.path.basename(util.localpath(p)))
@@ -495,7 +495,7 @@
     dest = pats.pop()
     destdirexists = os.path.isdir(dest) and not os.path.islink(dest)
     if not destdirexists:
-        if len(pats) > 1 or util.patkind(pats[0], None)[0]:
+        if len(pats) > 1 or _match.patkind(pats[0]):
             raise util.Abort(_('with multiple sources, destination must be an '
                                'existing directory'))
         if util.endswithsep(dest):