Show More
@@ -0,0 +1,56 b'' | |||||
|
1 | $ hg init repo | |||
|
2 | $ cd repo | |||
|
3 | $ for n in 0 1 2 3; do | |||
|
4 | > echo $n > $n | |||
|
5 | > hg ci -qAm $n | |||
|
6 | > done | |||
|
7 | ||||
|
8 | test revset support | |||
|
9 | ||||
|
10 | $ cat <<'EOF' >> .hg/hgrc | |||
|
11 | > [extdata] | |||
|
12 | > filedata = file:extdata.txt | |||
|
13 | > shelldata = shell:cat extdata.txt | grep 2 | |||
|
14 | > EOF | |||
|
15 | $ cat <<'EOF' > extdata.txt | |||
|
16 | > 2 | |||
|
17 | > 3 | |||
|
18 | > EOF | |||
|
19 | ||||
|
20 | $ hg log -qr "extdata(filedata)" | |||
|
21 | 2:f6ed99a58333 | |||
|
22 | 3:9de260b1e88e | |||
|
23 | $ hg log -qr "extdata(shelldata)" | |||
|
24 | 2:f6ed99a58333 | |||
|
25 | ||||
|
26 | test weight of extdata() revset | |||
|
27 | ||||
|
28 | $ hg debugrevspec -p optimized "extdata(filedata) & 3" | |||
|
29 | * optimized: | |||
|
30 | (andsmally | |||
|
31 | (func | |||
|
32 | (symbol 'extdata') | |||
|
33 | (symbol 'filedata')) | |||
|
34 | (symbol '3')) | |||
|
35 | 3 | |||
|
36 | ||||
|
37 | test bad extdata() revset source | |||
|
38 | ||||
|
39 | $ hg log -qr "extdata()" | |||
|
40 | hg: parse error: extdata takes at least 1 string argument | |||
|
41 | [255] | |||
|
42 | $ hg log -qr "extdata(unknown)" | |||
|
43 | abort: unknown extdata source 'unknown' | |||
|
44 | [255] | |||
|
45 | ||||
|
46 | we don't fix up relative file URLs, but we do run shell commands in repo root | |||
|
47 | ||||
|
48 | $ mkdir sub | |||
|
49 | $ cd sub | |||
|
50 | $ hg log -qr "extdata(filedata)" | |||
|
51 | abort: error: No such file or directory | |||
|
52 | [255] | |||
|
53 | $ hg log -qr "extdata(shelldata)" | |||
|
54 | 2:f6ed99a58333 | |||
|
55 | ||||
|
56 | $ cd .. |
@@ -786,6 +786,17 b' def contentdivergent(repo, subset, x):' | |||||
786 | contentdivergent = obsmod.getrevs(repo, 'contentdivergent') |
|
786 | contentdivergent = obsmod.getrevs(repo, 'contentdivergent') | |
787 | return subset & contentdivergent |
|
787 | return subset & contentdivergent | |
788 |
|
788 | |||
|
789 | @predicate('extdata(source)', safe=False, weight=100) | |||
|
790 | def extdata(repo, subset, x): | |||
|
791 | """Changesets in the specified extdata source. (EXPERIMENTAL)""" | |||
|
792 | # i18n: "extdata" is a keyword | |||
|
793 | args = getargsdict(x, 'extdata', 'source') | |||
|
794 | source = getstring(args.get('source'), | |||
|
795 | # i18n: "extdata" is a keyword | |||
|
796 | _('extdata takes at least 1 string argument')) | |||
|
797 | data = scmutil.extdatasource(repo, source) | |||
|
798 | return subset & baseset(data) | |||
|
799 | ||||
789 | @predicate('extinct()', safe=True) |
|
800 | @predicate('extinct()', safe=True) | |
790 | def extinct(repo, subset, x): |
|
801 | def extinct(repo, subset, x): | |
791 | """Obsolete changesets with obsolete descendants only. |
|
802 | """Obsolete changesets with obsolete descendants only. |
General Comments 0
You need to be logged in to leave comments.
Login now