##// END OF EJS Templates
rhg: add a test for --rev with a hex changeset ID...
Simon Sapin -
r46611:904647f7 default
parent child Browse files
Show More
@@ -1,147 +1,167
1 1 #require rust
2 2
3 3 Define an rhg function that will only run if rhg exists
4 4 $ rhg() {
5 5 > if [ -f "$RUNTESTDIR/../rust/target/debug/rhg" ]; then
6 6 > "$RUNTESTDIR/../rust/target/debug/rhg" "$@"
7 7 > else
8 8 > echo "skipped: Cannot find rhg. Try to run cargo build in rust/rhg."
9 9 > exit 80
10 10 > fi
11 11 > }
12 12
13 13 Unimplemented command
14 14 $ rhg unimplemented-command
15 15 error: Found argument 'unimplemented-command' which wasn't expected, or isn't valid in this context
16 16
17 17 USAGE:
18 18 rhg <SUBCOMMAND>
19 19
20 20 For more information try --help
21 21 [252]
22 22
23 23 Finding root
24 24 $ rhg root
25 25 abort: no repository found in '$TESTTMP' (.hg not found)!
26 26 [255]
27 27
28 28 $ hg init repository
29 29 $ cd repository
30 30 $ rhg root
31 31 $TESTTMP/repository
32 32
33 33 Unwritable file descriptor
34 34 $ rhg root > /dev/full
35 35 abort: No space left on device (os error 28)
36 36 [255]
37 37
38 38 Deleted repository
39 39 $ rm -rf `pwd`
40 40 $ rhg root
41 41 abort: error getting current working directory: $ENOENT$
42 42 [255]
43 43
44 44 Listing tracked files
45 45 $ cd $TESTTMP
46 46 $ hg init repository
47 47 $ cd repository
48 48 $ for i in 1 2 3; do
49 49 > echo $i >> file$i
50 50 > hg add file$i
51 51 > done
52 52 > hg commit -m "commit $i" -q
53 53
54 54 Listing tracked files from root
55 55 $ rhg files
56 56 file1
57 57 file2
58 58 file3
59 59
60 60 Listing tracked files from subdirectory
61 61 $ mkdir -p path/to/directory
62 62 $ cd path/to/directory
63 63 $ rhg files
64 64 ../../../file1
65 65 ../../../file2
66 66 ../../../file3
67 67
68 68 Listing tracked files through broken pipe
69 69 $ rhg files | head -n 1
70 70 ../../../file1
71 71
72 72 Debuging data in inline index
73 73 $ cd $TESTTMP
74 74 $ rm -rf repository
75 75 $ hg init repository
76 76 $ cd repository
77 77 $ for i in 1 2 3; do
78 78 > echo $i >> file$i
79 79 > hg add file$i
80 80 > hg commit -m "commit $i" -q
81 81 > done
82 82 $ rhg debugdata -c 2
83 83 e36fa63d37a576b27a69057598351db6ee5746bd
84 84 test
85 85 0 0
86 86 file3
87 87
88 88 commit 3 (no-eol)
89 89 $ rhg debugdata -m 2
90 90 file1\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
91 91 file2\x005d9299349fc01ddd25d0070d149b124d8f10411e (esc)
92 92 file3\x002661d26c649684b482d10f91960cc3db683c38b4 (esc)
93 93
94 94 Debuging with full node id
95 95 $ rhg debugdata -c `hg log -r 0 -T '{node}'`
96 96 c8e64718e1ca0312eeee0f59d37f8dc612793856
97 97 test
98 98 0 0
99 99 file1
100 100
101 101 commit 1 (no-eol)
102 102
103 103 Cat files
104 104 $ cd $TESTTMP
105 105 $ rm -rf repository
106 106 $ hg init repository
107 107 $ cd repository
108 108 $ echo "original content" > original
109 109 $ hg add original
110 110 $ hg commit -m "add original" original
111 111 $ rhg cat -r 0 original
112 112 original content
113 113 Cat copied file should not display copy metadata
114 114 $ hg copy original copy_of_original
115 115 $ hg commit -m "add copy of original"
116 116 $ rhg cat -r 1 copy_of_original
117 117 original content
118 118
119 Specifying revisions by changeset ID
120 $ hg log
121 changeset: 1:41263439dc17
122 tag: tip
123 user: test
124 date: Thu Jan 01 00:00:00 1970 +0000
125 summary: add copy of original
126
127 changeset: 0:1c9e69808da7
128 user: test
129 date: Thu Jan 01 00:00:00 1970 +0000
130 summary: add original
131
132 $ rhg files -r 41263439dc17
133 abort: invalid revision identifier 41263439dc17
134 [255]
135 $ rhg cat -r 41263439dc17 original
136 abort: invalid revision identifier 41263439dc17
137 [255]
138
119 139 Requirements
120 140 $ rhg debugrequirements
121 141 dotencode
122 142 fncache
123 143 generaldelta
124 144 revlogv1
125 145 sparserevlog
126 146 store
127 147
128 148 $ echo indoor-pool >> .hg/requires
129 149 $ rhg files
130 150 [252]
131 151
132 152 $ rhg cat -r 1 copy_of_original
133 153 [252]
134 154
135 155 $ rhg debugrequirements
136 156 dotencode
137 157 fncache
138 158 generaldelta
139 159 revlogv1
140 160 sparserevlog
141 161 store
142 162 indoor-pool
143 163
144 164 $ echo -e '\xFF' >> .hg/requires
145 165 $ rhg debugrequirements
146 166 abort: .hg/requires is corrupted
147 167 [255]
General Comments 0
You need to be logged in to leave comments. Login now