Show More
@@ -0,0 +1,47 b'' | |||||
|
1 | # HG changeset patch | |||
|
2 | # User test | |||
|
3 | # Node ID b51ca55c20354097ca299529d18b5cd356976ba2 | |||
|
4 | # Parent 0000000000000000000000000000000000000000 | |||
|
5 | 1 | |||
|
6 | ||||
|
7 | diff -r 000000000000 -r b51ca55c2035 foo | |||
|
8 | --- /dev/null Thu Jan 1 00:00:00 1970 +0000 | |||
|
9 | +++ b/foo Thu Jan 1 00:00:00 1970 +0000 | |||
|
10 | @@ -0,0 +1,1 @@ | |||
|
11 | +a | |||
|
12 | # HG changeset patch | |||
|
13 | # User test | |||
|
14 | # Node ID 1e555b9b85c52e1e9e8175446f1ede507b2d1ebb | |||
|
15 | # Parent b51ca55c20354097ca299529d18b5cd356976ba2 | |||
|
16 | 2 | |||
|
17 | ||||
|
18 | diff -r b51ca55c2035 -r 1e555b9b85c5 foo | |||
|
19 | --- a/foo Thu Jan 1 00:00:00 1970 +0000 | |||
|
20 | +++ /dev/null Thu Jan 1 00:00:00 1970 +0000 | |||
|
21 | @@ -1,1 +0,0 @@ | |||
|
22 | -a | |||
|
23 | changeset: 0:b51ca55c2035 | |||
|
24 | user: test | |||
|
25 | date: Thu Jan 1 00:00:00 1970 +0000 | |||
|
26 | summary: 1 | |||
|
27 | ||||
|
28 | diff -r 000000000000 -r b51ca55c2035 foo | |||
|
29 | --- /dev/null Thu Jan 1 00:00:00 1970 +0000 | |||
|
30 | +++ b/foo Thu Jan 1 00:00:00 1970 +0000 | |||
|
31 | @@ -0,0 +1,1 @@ | |||
|
32 | +a | |||
|
33 | ||||
|
34 | ||||
|
35 | changeset: 1:1e555b9b85c5 | |||
|
36 | tag: tip | |||
|
37 | user: test | |||
|
38 | date: Thu Jan 1 00:00:00 1970 +0000 | |||
|
39 | summary: 2 | |||
|
40 | ||||
|
41 | diff -r b51ca55c2035 -r 1e555b9b85c5 foo | |||
|
42 | --- a/foo Thu Jan 1 00:00:00 1970 +0000 | |||
|
43 | +++ /dev/null Thu Jan 1 00:00:00 1970 +0000 | |||
|
44 | @@ -1,1 +0,0 @@ | |||
|
45 | -a | |||
|
46 | ||||
|
47 |
@@ -66,7 +66,7 b' def walkchangerevs(ui, repo, pats, opts)' | |||||
66 | window, we first walk forwards to gather data, then in the desired |
|
66 | window, we first walk forwards to gather data, then in the desired | |
67 | order (usually backwards) to display it. |
|
67 | order (usually backwards) to display it. | |
68 |
|
68 | |||
69 |
This function returns an (iterator, getchange |
|
69 | This function returns an (iterator, getchange, matchfn) tuple. The | |
70 | getchange function returns the changelog entry for a numeric |
|
70 | getchange function returns the changelog entry for a numeric | |
71 | revision. The iterator yields 3-tuples. They will be of one of |
|
71 | revision. The iterator yields 3-tuples. They will be of one of | |
72 | the following forms: |
|
72 | the following forms: | |
@@ -82,10 +82,11 b' def walkchangerevs(ui, repo, pats, opts)' | |||||
82 | "iter", rev, None: in-order traversal of the revs earlier iterated |
|
82 | "iter", rev, None: in-order traversal of the revs earlier iterated | |
83 | over with "add" - use to display data''' |
|
83 | over with "add" - use to display data''' | |
84 |
|
84 | |||
|
85 | files, matchfn, anypats, cwd = matchpats(repo, pats, opts) | |||
|
86 | ||||
85 | if repo.changelog.count() == 0: |
|
87 | if repo.changelog.count() == 0: | |
86 | return [], False |
|
88 | return [], False, matchfn | |
87 |
|
89 | |||
88 | files, matchfn, anypats, cwd = matchpats(repo, pats, opts) |
|
|||
89 | revs = map(int, revrange(ui, repo, opts['rev'] or ['tip:0'])) |
|
90 | revs = map(int, revrange(ui, repo, opts['rev'] or ['tip:0'])) | |
90 | wanted = {} |
|
91 | wanted = {} | |
91 | slowpath = anypats |
|
92 | slowpath = anypats | |
@@ -153,7 +154,7 b' def walkchangerevs(ui, repo, pats, opts)' | |||||
153 | yield 'add', rev, fns |
|
154 | yield 'add', rev, fns | |
154 | for rev in nrevs: |
|
155 | for rev in nrevs: | |
155 | yield 'iter', rev, None |
|
156 | yield 'iter', rev, None | |
156 | return iterate(), getchange |
|
157 | return iterate(), getchange, matchfn | |
157 |
|
158 | |||
158 | revrangesep = ':' |
|
159 | revrangesep = ':' | |
159 |
|
160 | |||
@@ -1287,7 +1288,7 b' def grep(ui, repo, pattern, *pats, **opt' | |||||
1287 |
|
1288 | |||
1288 | fstate = {} |
|
1289 | fstate = {} | |
1289 | skip = {} |
|
1290 | skip = {} | |
1290 | changeiter, getchange = walkchangerevs(ui, repo, pats, opts) |
|
1291 | changeiter, getchange, matchfn = walkchangerevs(ui, repo, pats, opts) | |
1291 | count = 0 |
|
1292 | count = 0 | |
1292 | incrementing = False |
|
1293 | incrementing = False | |
1293 | for st, rev, fns in changeiter: |
|
1294 | for st, rev, fns in changeiter: | |
@@ -1550,7 +1551,7 b' def log(ui, repo, *pats, **opts):' | |||||
1550 | self.write(*args) |
|
1551 | self.write(*args) | |
1551 | def __getattr__(self, key): |
|
1552 | def __getattr__(self, key): | |
1552 | return getattr(self.ui, key) |
|
1553 | return getattr(self.ui, key) | |
1553 | changeiter, getchange = walkchangerevs(ui, repo, pats, opts) |
|
1554 | changeiter, getchange, matchfn = walkchangerevs(ui, repo, pats, opts) | |
1554 | for st, rev, fns in changeiter: |
|
1555 | for st, rev, fns in changeiter: | |
1555 | if st == 'window': |
|
1556 | if st == 'window': | |
1556 | du = dui(ui) |
|
1557 | du = dui(ui) | |
@@ -1566,7 +1567,7 b' def log(ui, repo, *pats, **opts):' | |||||
1566 |
|
1567 | |||
1567 | br = None |
|
1568 | br = None | |
1568 | if opts['keyword']: |
|
1569 | if opts['keyword']: | |
1569 |
changes = |
|
1570 | changes = getchange(rev) | |
1570 | miss = 0 |
|
1571 | miss = 0 | |
1571 | for k in [kw.lower() for kw in opts['keyword']]: |
|
1572 | for k in [kw.lower() for kw in opts['keyword']]: | |
1572 | if not (k in changes[1].lower() or |
|
1573 | if not (k in changes[1].lower() or | |
@@ -1583,7 +1584,7 b' def log(ui, repo, *pats, **opts):' | |||||
1583 | show_changeset(du, repo, rev, brinfo=br) |
|
1584 | show_changeset(du, repo, rev, brinfo=br) | |
1584 | if opts['patch']: |
|
1585 | if opts['patch']: | |
1585 | prev = (parents and parents[0]) or nullid |
|
1586 | prev = (parents and parents[0]) or nullid | |
1586 |
dodiff(du, du, repo, prev, changenode, fn |
|
1587 | dodiff(du, du, repo, prev, changenode, match=matchfn) | |
1587 | du.write("\n\n") |
|
1588 | du.write("\n\n") | |
1588 | elif st == 'iter': |
|
1589 | elif st == 'iter': | |
1589 | for args in du.hunk[rev]: |
|
1590 | for args in du.hunk[rev]: |
General Comments 0
You need to be logged in to leave comments.
Login now