Show More
@@ -0,0 +1,20 b'' | |||
|
1 | #!/bin/sh | |
|
2 | # | |
|
3 | mkdir t | |
|
4 | cd t | |
|
5 | hg init | |
|
6 | echo 0 > a | |
|
7 | echo 0 > b | |
|
8 | hg ci -A -m m -d "0 0" | |
|
9 | touch nottracked | |
|
10 | hg locate a | |
|
11 | hg locate NONEXISTENT | |
|
12 | hg locate | |
|
13 | hg rm a | |
|
14 | hg ci -m m -d "0 0" | |
|
15 | hg locate a | |
|
16 | hg locate NONEXISTENT | |
|
17 | hg locate | |
|
18 | hg locate -r 0 a | |
|
19 | hg locate -r 0 NONEXISTENT | |
|
20 | hg locate -r 0 |
@@ -0,0 +1,13 b'' | |||
|
1 | adding a | |
|
2 | adding b | |
|
3 | a | |
|
4 | NONEXISTENT: No such file or directory | |
|
5 | a | |
|
6 | b | |
|
7 | a: No such file or directory | |
|
8 | NONEXISTENT: No such file or directory | |
|
9 | b | |
|
10 | a | |
|
11 | NONEXISTENT: No such file in rev 9e1684505872 | |
|
12 | a | |
|
13 | b |
@@ -1531,9 +1531,15 b' def locate(ui, repo, *pats, **opts):' | |||
|
1531 | 1531 | that contain white space as multiple filenames. |
|
1532 | 1532 | """ |
|
1533 | 1533 | end = opts['print0'] and '\0' or '\n' |
|
1534 | rev = opts['rev'] | |
|
1535 | if rev: | |
|
1536 | node = repo.lookup(rev) | |
|
1537 | else: | |
|
1538 | node = None | |
|
1534 | 1539 | |
|
1535 |
for src, abs, rel, exact in walk(repo, pats, opts, |
|
|
1536 | if repo.dirstate.state(abs) == '?': | |
|
1540 | for src, abs, rel, exact in walk(repo, pats, opts, node=node, | |
|
1541 | head='(?:.*/|)'): | |
|
1542 | if not node and repo.dirstate.state(abs) == '?': | |
|
1537 | 1543 | continue |
|
1538 | 1544 | if opts['fullpath']: |
|
1539 | 1545 | ui.write(os.path.join(repo.root, abs), end) |
General Comments 0
You need to be logged in to leave comments.
Login now