Show More
@@ -9,7 +9,7 from node import hex, nullid, nullrev, s | |||
|
9 | 9 | from i18n import _ |
|
10 | 10 | import os, sys, errno, re, glob, tempfile |
|
11 | 11 | import util, templater, patch, error, encoding, templatekw |
|
12 |
import match as |
|
|
12 | import match as matchmod | |
|
13 | 13 | import similar, revset |
|
14 | 14 | |
|
15 | 15 | revrangesep = ':' |
@@ -247,7 +247,7 def expandpats(pats): | |||
|
247 | 247 | return list(pats) |
|
248 | 248 | ret = [] |
|
249 | 249 | for p in pats: |
|
250 |
kind, name = |
|
|
250 | kind, name = matchmod._patsplit(p, None) | |
|
251 | 251 | if kind is None: |
|
252 | 252 | try: |
|
253 | 253 | globbed = glob.glob(name) |
@@ -262,7 +262,7 def expandpats(pats): | |||
|
262 | 262 | def match(repo, pats=[], opts={}, globbed=False, default='relpath'): |
|
263 | 263 | if not globbed and default == 'relpath': |
|
264 | 264 | pats = expandpats(pats or []) |
|
265 |
m = |
|
|
265 | m = matchmod.match(repo.root, repo.getcwd(), pats, | |
|
266 | 266 | opts.get('include'), opts.get('exclude'), default) |
|
267 | 267 | def badfn(f, msg): |
|
268 | 268 | repo.ui.warn("%s: %s\n" % (m.rel(f), msg)) |
@@ -270,10 +270,10 def match(repo, pats=[], opts={}, globbe | |||
|
270 | 270 | return m |
|
271 | 271 | |
|
272 | 272 | def matchall(repo): |
|
273 |
return |
|
|
273 | return matchmod.always(repo.root, repo.getcwd()) | |
|
274 | 274 | |
|
275 | 275 | def matchfiles(repo, files): |
|
276 |
return |
|
|
276 | return matchmod.exact(repo.root, repo.getcwd(), files) | |
|
277 | 277 | |
|
278 | 278 | def addremove(repo, pats=[], opts={}, dry_run=None, similarity=None): |
|
279 | 279 | if dry_run is None: |
@@ -464,7 +464,7 def copy(ui, repo, pats, opts, rename=Fa | |||
|
464 | 464 | # srcs: list of (hgsep, hgsep, ossep, bool) |
|
465 | 465 | # return: function that takes hgsep and returns ossep |
|
466 | 466 | def targetpathafterfn(pat, dest, srcs): |
|
467 |
if |
|
|
467 | if matchmod.patkind(pat): | |
|
468 | 468 | # a mercurial pattern |
|
469 | 469 | res = lambda p: os.path.join(dest, |
|
470 | 470 | os.path.basename(util.localpath(p))) |
@@ -512,7 +512,7 def copy(ui, repo, pats, opts, rename=Fa | |||
|
512 | 512 | dest = pats.pop() |
|
513 | 513 | destdirexists = os.path.isdir(dest) and not os.path.islink(dest) |
|
514 | 514 | if not destdirexists: |
|
515 |
if len(pats) > 1 or |
|
|
515 | if len(pats) > 1 or matchmod.patkind(pats[0]): | |
|
516 | 516 | raise util.Abort(_('with multiple sources, destination must be an ' |
|
517 | 517 | 'existing directory')) |
|
518 | 518 | if util.endswithsep(dest): |
@@ -7,7 +7,7 | |||
|
7 | 7 | |
|
8 | 8 | import re |
|
9 | 9 | import parser, util, error, discovery |
|
10 |
import match as |
|
|
10 | import match as matchmod | |
|
11 | 11 | from i18n import _ |
|
12 | 12 | |
|
13 | 13 | elements = { |
@@ -292,7 +292,7 def author(repo, subset, x): | |||
|
292 | 292 | |
|
293 | 293 | def hasfile(repo, subset, x): |
|
294 | 294 | pat = getstring(x, _("file wants a pattern")) |
|
295 |
m = |
|
|
295 | m = matchmod.match(repo.root, repo.getcwd(), [pat]) | |
|
296 | 296 | s = [] |
|
297 | 297 | for r in subset: |
|
298 | 298 | for f in repo[r].files(): |
@@ -303,7 +303,7 def hasfile(repo, subset, x): | |||
|
303 | 303 | |
|
304 | 304 | def contains(repo, subset, x): |
|
305 | 305 | pat = getstring(x, _("contains wants a pattern")) |
|
306 |
m = |
|
|
306 | m = matchmod.match(repo.root, repo.getcwd(), [pat]) | |
|
307 | 307 | s = [] |
|
308 | 308 | if m.files() == [pat]: |
|
309 | 309 | for r in subset: |
@@ -319,7 +319,7 def contains(repo, subset, x): | |||
|
319 | 319 | return s |
|
320 | 320 | |
|
321 | 321 | def checkstatus(repo, subset, pat, field): |
|
322 |
m = |
|
|
322 | m = matchmod.match(repo.root, repo.getcwd(), [pat]) | |
|
323 | 323 | s = [] |
|
324 | 324 | fast = (m.files() == [pat]) |
|
325 | 325 | for r in subset: |
@@ -10,7 +10,7 from i18n import _ | |||
|
10 | 10 | from node import bin, hex |
|
11 | 11 | import changegroup as changegroupmod |
|
12 | 12 | import repo, error, encoding, util, store |
|
13 |
import pushkey as pushkey |
|
|
13 | import pushkey as pushkeymod | |
|
14 | 14 | |
|
15 | 15 | # list of nodes encoding / decoding |
|
16 | 16 | |
@@ -202,7 +202,7 def hello(repo, proto): | |||
|
202 | 202 | return "capabilities: %s\n" % (capabilities(repo, proto)) |
|
203 | 203 | |
|
204 | 204 | def listkeys(repo, proto, namespace): |
|
205 |
d = pushkey |
|
|
205 | d = pushkeymod.list(repo, namespace).items() | |
|
206 | 206 | t = '\n'.join(['%s\t%s' % (k.encode('string-escape'), |
|
207 | 207 | v.encode('string-escape')) for k, v in d]) |
|
208 | 208 | return t |
@@ -217,7 +217,7 def lookup(repo, proto, key): | |||
|
217 | 217 | return "%s %s\n" % (success, r) |
|
218 | 218 | |
|
219 | 219 | def pushkey(repo, proto, namespace, key, old, new): |
|
220 |
r = pushkey |
|
|
220 | r = pushkeymod.push(repo, namespace, key, old, new) | |
|
221 | 221 | return '%s\n' % int(r) |
|
222 | 222 | |
|
223 | 223 | def _allowstream(ui): |
General Comments 0
You need to be logged in to leave comments.
Login now