Show More
@@ -53,11 +53,17 b' def pathto(n1, n2):' | |||
|
53 | 53 | b.reverse() |
|
54 | 54 | return os.sep.join((['..'] * len(a)) + b) |
|
55 | 55 | |
|
56 | def walk(repo, pats, opts, head = ''): | |
|
56 | def makewalk(repo, pats, opts, head = ''): | |
|
57 | 57 | cwd = repo.getcwd() |
|
58 | 58 | files, matchfn = matchpats(cwd, pats, opts, head) |
|
59 | for src, fn in repo.walk(files = files, match = matchfn): | |
|
60 | yield src, fn, pathto(cwd, fn) | |
|
59 | def walk(): | |
|
60 | for src, fn in repo.walk(files = files, match = matchfn): | |
|
61 | yield src, fn, pathto(cwd, fn) | |
|
62 | return files, matchfn, walk() | |
|
63 | ||
|
64 | def walk(repo, pats, opts, head = ''): | |
|
65 | files, matchfn, results = makewalk(repo, pats, opts, head) | |
|
66 | for r in results: yield r | |
|
61 | 67 | |
|
62 | 68 | revrangesep = ':' |
|
63 | 69 | |
@@ -153,11 +159,11 b' def make_file(repo, r, pat, node=None,' | |||
|
153 | 159 | return open(make_filename(repo, r, pat, node, total, seqno, revwidth), |
|
154 | 160 | mode) |
|
155 | 161 | |
|
156 | def dodiff(fp, ui, repo, files=None, node1=None, node2=None): | |
|
162 | def dodiff(fp, ui, repo, files=None, node1=None, node2=None, match=util.always): | |
|
157 | 163 | def date(c): |
|
158 | 164 | return time.asctime(time.gmtime(float(c[2].split(' ')[0]))) |
|
159 | 165 | |
|
160 | (c, a, d, u) = repo.changes(node1, node2, files) | |
|
166 | (c, a, d, u) = repo.changes(node1, node2, files, match = match) | |
|
161 | 167 | if files: |
|
162 | 168 | c, a, d = map(lambda x: filterfiles(files, x), (c, a, d)) |
|
163 | 169 | |
@@ -588,9 +594,10 b' def diff(ui, repo, *pats, **opts):' | |||
|
588 | 594 | raise Abort("too many revisions to diff") |
|
589 | 595 | |
|
590 | 596 | files = [] |
|
591 |
|
|
|
597 | roots, match, results = makewalk(repo, pats, opts) | |
|
598 | for src, abs, rel in results: | |
|
592 | 599 | files.append(abs) |
|
593 | dodiff(sys.stdout, ui, repo, files, *revs) | |
|
600 | dodiff(sys.stdout, ui, repo, files, *revs, **{'match': match}) | |
|
594 | 601 | |
|
595 | 602 | def doexport(ui, repo, changeset, seqno, total, revwidth, opts): |
|
596 | 603 | node = repo.lookup(changeset) |
General Comments 0
You need to be logged in to leave comments.
Login now