Show More
@@ -0,0 +1,42 b'' | |||||
|
1 | #!/bin/sh | |||
|
2 | ||||
|
3 | echo % no repo | |||
|
4 | hg id | |||
|
5 | ||||
|
6 | echo % create repo | |||
|
7 | hg init test | |||
|
8 | cd test | |||
|
9 | echo a > a | |||
|
10 | hg ci -Ama | |||
|
11 | ||||
|
12 | echo % basic id usage | |||
|
13 | hg id | |||
|
14 | hg id --debug | |||
|
15 | hg id -q | |||
|
16 | hg id -v | |||
|
17 | ||||
|
18 | echo % with options | |||
|
19 | hg id -r. | |||
|
20 | hg id -n | |||
|
21 | hg id -t | |||
|
22 | hg id -b | |||
|
23 | hg id -i | |||
|
24 | hg id -n -t -b -i | |||
|
25 | ||||
|
26 | echo % with modifications | |||
|
27 | echo b > a | |||
|
28 | hg id -n -t -b -i | |||
|
29 | ||||
|
30 | echo % other local repo | |||
|
31 | cd .. | |||
|
32 | hg -R test id | |||
|
33 | hg id test | |||
|
34 | ||||
|
35 | echo % with remote http repo | |||
|
36 | cd test | |||
|
37 | hg serve -p $HGPORT1 -d --pid-file=hg.pid | |||
|
38 | cat hg.pid >> $DAEMON_PIDS | |||
|
39 | hg id http://localhost:$HGPORT1/ | |||
|
40 | ||||
|
41 | echo % remote with tags? | |||
|
42 | hg id -t http://localhost:$HGPORT1/ |
@@ -0,0 +1,25 b'' | |||||
|
1 | % no repo | |||
|
2 | abort: There is no Mercurial repository here (.hg not found) | |||
|
3 | % create repo | |||
|
4 | adding a | |||
|
5 | % basic id usage | |||
|
6 | cb9a9f314b8b tip | |||
|
7 | cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b tip | |||
|
8 | cb9a9f314b8b | |||
|
9 | cb9a9f314b8b tip | |||
|
10 | % with options | |||
|
11 | cb9a9f314b8b tip | |||
|
12 | 0 | |||
|
13 | tip | |||
|
14 | default | |||
|
15 | cb9a9f314b8b | |||
|
16 | cb9a9f314b8b 0 default tip | |||
|
17 | % with modifications | |||
|
18 | cb9a9f314b8b+ 0+ default tip | |||
|
19 | % other local repo | |||
|
20 | cb9a9f314b8b+ tip | |||
|
21 | cb9a9f314b8b+ tip | |||
|
22 | % with remote http repo | |||
|
23 | cb9a9f314b8b | |||
|
24 | % remote with tags? | |||
|
25 | abort: can't query remote revision number, branch, or tags |
@@ -1538,9 +1538,12 b' def identify(ui, repo, source=None,' | |||||
1538 | default = not (num or id or branch or tags) |
|
1538 | default = not (num or id or branch or tags) | |
1539 | output = [] |
|
1539 | output = [] | |
1540 |
|
1540 | |||
|
1541 | revs = [] | |||
1541 | if source: |
|
1542 | if source: | |
1542 | source, revs, checkout = hg.parseurl(ui.expandpath(source), []) |
|
1543 | source, revs, checkout = hg.parseurl(ui.expandpath(source), []) | |
1543 |
|
|
1544 | repo = hg.repository(ui, source) | |
|
1545 | ||||
|
1546 | if not repo.local(): | |||
1544 | if not rev and revs: |
|
1547 | if not rev and revs: | |
1545 | rev = revs[0] |
|
1548 | rev = revs[0] | |
1546 | if not rev: |
|
1549 | if not rev: | |
@@ -1548,7 +1551,7 b' def identify(ui, repo, source=None,' | |||||
1548 | if num or branch or tags: |
|
1551 | if num or branch or tags: | |
1549 | raise util.Abort( |
|
1552 | raise util.Abort( | |
1550 | "can't query remote revision number, branch, or tags") |
|
1553 | "can't query remote revision number, branch, or tags") | |
1551 |
output = [hexfunc( |
|
1554 | output = [hexfunc(repo.lookup(rev))] | |
1552 | elif not rev: |
|
1555 | elif not rev: | |
1553 | ctx = repo[None] |
|
1556 | ctx = repo[None] | |
1554 | parents = ctx.parents() |
|
1557 | parents = ctx.parents() | |
@@ -1568,7 +1571,7 b' def identify(ui, repo, source=None,' | |||||
1568 | if num: |
|
1571 | if num: | |
1569 | output.append(str(ctx.rev())) |
|
1572 | output.append(str(ctx.rev())) | |
1570 |
|
1573 | |||
1571 |
if |
|
1574 | if repo.local() and default and not ui.quiet: | |
1572 | b = util.tolocal(ctx.branch()) |
|
1575 | b = util.tolocal(ctx.branch()) | |
1573 | if b != 'default': |
|
1576 | if b != 'default': | |
1574 | output.append("(%s)" % b) |
|
1577 | output.append("(%s)" % b) |
General Comments 0
You need to be logged in to leave comments.
Login now