Show More
@@ -1978,7 +1978,10 b' def parents(ui, repo, file_=None, **opts' | |||||
1978 | """ |
|
1978 | """ | |
1979 | rev = opts.get('rev') |
|
1979 | rev = opts.get('rev') | |
1980 | if file_: |
|
1980 | if file_: | |
1981 | ctx = repo.filectx(file_, changeid=rev) |
|
1981 | files, match, anypats = cmdutil.matchpats(repo, (file_,), opts) | |
|
1982 | if anypats or len(files) != 1: | |||
|
1983 | raise util.Abort(_('can only specify an explicit file name')) | |||
|
1984 | ctx = repo.filectx(files[0], changeid=rev) | |||
1982 | elif rev: |
|
1985 | elif rev: | |
1983 | ctx = repo.changectx(rev) |
|
1986 | ctx = repo.changectx(rev) | |
1984 | else: |
|
1987 | else: |
@@ -1,8 +1,8 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 | # test parents command |
|
2 | # test parents command | |
3 |
|
3 | |||
4 |
hg init |
|
4 | hg init repo | |
5 | cd a |
|
5 | cd repo | |
6 | echo % no working directory |
|
6 | echo % no working directory | |
7 | hg parents |
|
7 | hg parents | |
8 |
|
8 | |||
@@ -25,3 +25,20 b' hg parents -r 2' | |||||
25 |
|
25 | |||
26 | echo % hg parents -r 2 a |
|
26 | echo % hg parents -r 2 a | |
27 | hg parents -r 2 a |
|
27 | hg parents -r 2 a | |
|
28 | ||||
|
29 | echo % hg parents -r 2 ../a | |||
|
30 | hg parents -r 2 ../a | |||
|
31 | ||||
|
32 | echo '% cd dir; hg parents -r 2 ../a' | |||
|
33 | mkdir dir | |||
|
34 | cd dir | |||
|
35 | hg parents -r 2 ../a | |||
|
36 | ||||
|
37 | echo '% hg parents -r 2 path:a' | |||
|
38 | hg parents -r 2 path:a | |||
|
39 | ||||
|
40 | echo '% hg parents -r 2 glob:a' | |||
|
41 | cd .. | |||
|
42 | hg parents -r 2 glob:a | |||
|
43 | ||||
|
44 | true |
@@ -26,3 +26,19 b' user: test' | |||||
26 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
26 | date: Thu Jan 01 00:00:00 1970 +0000 | |
27 | summary: ab |
|
27 | summary: ab | |
28 |
|
28 | |||
|
29 | % hg parents -r 2 ../a | |||
|
30 | abort: ../a not under root | |||
|
31 | % cd dir; hg parents -r 2 ../a | |||
|
32 | changeset: 0:b6a1406d8886 | |||
|
33 | user: test | |||
|
34 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
35 | summary: ab | |||
|
36 | ||||
|
37 | % hg parents -r 2 path:a | |||
|
38 | changeset: 0:b6a1406d8886 | |||
|
39 | user: test | |||
|
40 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
41 | summary: ab | |||
|
42 | ||||
|
43 | % hg parents -r 2 glob:a | |||
|
44 | abort: can only specify an explicit file name |
General Comments 0
You need to be logged in to leave comments.
Login now