Show More
@@ -1,616 +1,616 b'' | |||||
1 | The *dirstate* is what Mercurial uses internally to track |
|
1 | The *dirstate* is what Mercurial uses internally to track | |
2 | the state of files in the working directory, |
|
2 | the state of files in the working directory, | |
3 | such as set by commands like `hg add` and `hg rm`. |
|
3 | such as set by commands like `hg add` and `hg rm`. | |
4 | It also contains some cached data that help make `hg status` faster. |
|
4 | It also contains some cached data that help make `hg status` faster. | |
5 | The name refers both to `.hg/dirstate` on the filesystem |
|
5 | The name refers both to `.hg/dirstate` on the filesystem | |
6 | and the corresponding data structure in memory while a Mercurial process |
|
6 | and the corresponding data structure in memory while a Mercurial process | |
7 | is running. |
|
7 | is running. | |
8 |
|
8 | |||
9 | The original file format, retroactively dubbed `dirstate-v1`, |
|
9 | The original file format, retroactively dubbed `dirstate-v1`, | |
10 | is described at https://www.mercurial-scm.org/wiki/DirState. |
|
10 | is described at https://www.mercurial-scm.org/wiki/DirState. | |
11 | It is made of a flat sequence of unordered variable-size entries, |
|
11 | It is made of a flat sequence of unordered variable-size entries, | |
12 | so accessing any information in it requires parsing all of it. |
|
12 | so accessing any information in it requires parsing all of it. | |
13 | Similarly, saving changes requires rewriting the entire file. |
|
13 | Similarly, saving changes requires rewriting the entire file. | |
14 |
|
14 | |||
15 | The newer `dirsate-v2` file format is designed to fix these limitations |
|
15 | The newer `dirsate-v2` file format is designed to fix these limitations | |
16 | and make `hg status` faster. |
|
16 | and make `hg status` faster. | |
17 |
|
17 | |||
18 | User guide |
|
18 | User guide | |
19 | ========== |
|
19 | ========== | |
20 |
|
20 | |||
21 | Compatibility |
|
21 | Compatibility | |
22 | ------------- |
|
22 | ------------- | |
23 |
|
23 | |||
24 | The file format is experimental and may still change. |
|
24 | The file format is experimental and may still change. | |
25 | Different versions of Mercurial may not be compatible with each other |
|
25 | Different versions of Mercurial may not be compatible with each other | |
26 | when working on a local repository that uses this format. |
|
26 | when working on a local repository that uses this format. | |
27 | When using an incompatible version with the experimental format, |
|
27 | When using an incompatible version with the experimental format, | |
28 | anything can happen including data corruption. |
|
28 | anything can happen including data corruption. | |
29 |
|
29 | |||
30 | Since the dirstate is entirely local and not relevant to the wire protocol, |
|
30 | Since the dirstate is entirely local and not relevant to the wire protocol, | |
31 | `dirstate-v2` does not affect compatibility with remote Mercurial versions. |
|
31 | `dirstate-v2` does not affect compatibility with remote Mercurial versions. | |
32 |
|
32 | |||
33 | When `share-safe` is enabled, different repositories sharing the same store |
|
33 | When `share-safe` is enabled, different repositories sharing the same store | |
34 | can use different dirstate formats. |
|
34 | can use different dirstate formats. | |
35 |
|
35 | |||
36 | Enabling `dirsate-v2` for new local repositories |
|
36 | Enabling `dirsate-v2` for new local repositories | |
37 | ------------------------------------------------ |
|
37 | ------------------------------------------------ | |
38 |
|
38 | |||
39 | When creating a new local repository such as with `hg init` or `hg clone`, |
|
39 | When creating a new local repository such as with `hg init` or `hg clone`, | |
40 | the `exp-rc-dirstate-v2` boolean in the `format` configuration section |
|
40 | the `exp-rc-dirstate-v2` boolean in the `format` configuration section | |
41 | controls whether to use this file format. |
|
41 | controls whether to use this file format. | |
42 | This is disabled by default as of this writing. |
|
42 | This is disabled by default as of this writing. | |
43 | To enable it for a single repository, run for example:: |
|
43 | To enable it for a single repository, run for example:: | |
44 |
|
44 | |||
45 | $ hg init my-project --config format.exp-rc-dirstate-v2=1 |
|
45 | $ hg init my-project --config format.exp-rc-dirstate-v2=1 | |
46 |
|
46 | |||
47 | Checking the format of an existing local repsitory |
|
47 | Checking the format of an existing local repsitory | |
48 | -------------------------------------------------- |
|
48 | -------------------------------------------------- | |
49 |
|
49 | |||
50 | The `debugformat` commands prints information about |
|
50 | The `debugformat` commands prints information about | |
51 | which of multiple optional formats are used in the current repository, |
|
51 | which of multiple optional formats are used in the current repository, | |
52 | including `dirstate-v2`:: |
|
52 | including `dirstate-v2`:: | |
53 |
|
53 | |||
54 | $ hg debugformat |
|
54 | $ hg debugformat | |
55 | format-variant repo |
|
55 | format-variant repo | |
56 | fncache: yes |
|
56 | fncache: yes | |
57 | dirstate-v2: yes |
|
57 | dirstate-v2: yes | |
58 | […] |
|
58 | […] | |
59 |
|
59 | |||
60 | Upgrading or downgrading an existing local repository |
|
60 | Upgrading or downgrading an existing local repository | |
61 | ----------------------------------------------------- |
|
61 | ----------------------------------------------------- | |
62 |
|
62 | |||
63 | The `debugupgrade` command does various upgrades or downgrades |
|
63 | The `debugupgrade` command does various upgrades or downgrades | |
64 | on a local repository |
|
64 | on a local repository | |
65 | based on the current Mercurial version and on configuration. |
|
65 | based on the current Mercurial version and on configuration. | |
66 | The same `format.exp-rc-dirstate-v2` configuration is used again. |
|
66 | The same `format.exp-rc-dirstate-v2` configuration is used again. | |
67 |
|
67 | |||
68 | Example to upgrade:: |
|
68 | Example to upgrade:: | |
69 |
|
69 | |||
70 | $ hg debugupgrade --config format.exp-rc-dirstate-v2=1 |
|
70 | $ hg debugupgrade --config format.exp-rc-dirstate-v2=1 | |
71 |
|
71 | |||
72 | Example to downgrade to `dirstate-v1`:: |
|
72 | Example to downgrade to `dirstate-v1`:: | |
73 |
|
73 | |||
74 | $ hg debugupgrade --config format.exp-rc-dirstate-v2=0 |
|
74 | $ hg debugupgrade --config format.exp-rc-dirstate-v2=0 | |
75 |
|
75 | |||
76 | Both of this commands do nothing but print a list of proposed changes, |
|
76 | Both of this commands do nothing but print a list of proposed changes, | |
77 | which may include changes unrelated to the dirstate. |
|
77 | which may include changes unrelated to the dirstate. | |
78 | Those other changes are controlled by their own configuration keys. |
|
78 | Those other changes are controlled by their own configuration keys. | |
79 | Add `--run` to a command to actually apply the proposed changes. |
|
79 | Add `--run` to a command to actually apply the proposed changes. | |
80 |
|
80 | |||
81 | Backups of `.hg/requires` and `.hg/dirstate` are created |
|
81 | Backups of `.hg/requires` and `.hg/dirstate` are created | |
82 | in a `.hg/upgradebackup.*` directory. |
|
82 | in a `.hg/upgradebackup.*` directory. | |
83 | If something goes wrong, restoring those files should undo the change. |
|
83 | If something goes wrong, restoring those files should undo the change. | |
84 |
|
84 | |||
85 | Note that upgrading affects compatibility with older versions of Mercurial |
|
85 | Note that upgrading affects compatibility with older versions of Mercurial | |
86 | as noted above. |
|
86 | as noted above. | |
87 | This can be relevant when a repository’s files are on a USB drive |
|
87 | This can be relevant when a repository’s files are on a USB drive | |
88 | or some other removable media, or shared over the network, etc. |
|
88 | or some other removable media, or shared over the network, etc. | |
89 |
|
89 | |||
90 | Internal filesystem representation |
|
90 | Internal filesystem representation | |
91 | ================================== |
|
91 | ================================== | |
92 |
|
92 | |||
93 | Requirements file |
|
93 | Requirements file | |
94 | ----------------- |
|
94 | ----------------- | |
95 |
|
95 | |||
96 | The `.hg/requires` file indicates which of various optional file formats |
|
96 | The `.hg/requires` file indicates which of various optional file formats | |
97 | are used by a given repository. |
|
97 | are used by a given repository. | |
98 | Mercurial aborts when seeing a requirement it does not know about, |
|
98 | Mercurial aborts when seeing a requirement it does not know about, | |
99 | which avoids older version accidentally messing up a respository |
|
99 | which avoids older version accidentally messing up a respository | |
100 | that uses a format that was introduced later. |
|
100 | that uses a format that was introduced later. | |
101 | For versions that do support a format, the presence or absence of |
|
101 | For versions that do support a format, the presence or absence of | |
102 | the corresponding requirement indicates whether to use that format. |
|
102 | the corresponding requirement indicates whether to use that format. | |
103 |
|
103 | |||
104 |
When the file contains a ` |
|
104 | When the file contains a `dirstate-v2` line, | |
105 | the `dirstate-v2` format is used. |
|
105 | the `dirstate-v2` format is used. | |
106 | With no such line `dirstate-v1` is used. |
|
106 | With no such line `dirstate-v1` is used. | |
107 |
|
107 | |||
108 | High level description |
|
108 | High level description | |
109 | ---------------------- |
|
109 | ---------------------- | |
110 |
|
110 | |||
111 | Whereas `dirstate-v1` uses a single `.hg/disrtate` file, |
|
111 | Whereas `dirstate-v1` uses a single `.hg/disrtate` file, | |
112 | in `dirstate-v2` that file is a "docket" file |
|
112 | in `dirstate-v2` that file is a "docket" file | |
113 | that only contains some metadata |
|
113 | that only contains some metadata | |
114 | and points to separate data file named `.hg/dirstate.{ID}`, |
|
114 | and points to separate data file named `.hg/dirstate.{ID}`, | |
115 | where `{ID}` is a random identifier. |
|
115 | where `{ID}` is a random identifier. | |
116 |
|
116 | |||
117 | This separation allows making data files append-only |
|
117 | This separation allows making data files append-only | |
118 | and therefore safer to memory-map. |
|
118 | and therefore safer to memory-map. | |
119 | Creating a new data file (occasionally to clean up unused data) |
|
119 | Creating a new data file (occasionally to clean up unused data) | |
120 | can be done with a different ID |
|
120 | can be done with a different ID | |
121 | without disrupting another Mercurial process |
|
121 | without disrupting another Mercurial process | |
122 | that could still be using the previous data file. |
|
122 | that could still be using the previous data file. | |
123 |
|
123 | |||
124 | Both files have a format designed to reduce the need for parsing, |
|
124 | Both files have a format designed to reduce the need for parsing, | |
125 | by using fixed-size binary components as much as possible. |
|
125 | by using fixed-size binary components as much as possible. | |
126 | For data that is not fixed-size, |
|
126 | For data that is not fixed-size, | |
127 | references to other parts of a file can be made by storing "pseudo-pointers": |
|
127 | references to other parts of a file can be made by storing "pseudo-pointers": | |
128 | integers counted in bytes from the start of a file. |
|
128 | integers counted in bytes from the start of a file. | |
129 | For read-only access no data structure is needed, |
|
129 | For read-only access no data structure is needed, | |
130 | only a bytes buffer (possibly memory-mapped directly from the filesystem) |
|
130 | only a bytes buffer (possibly memory-mapped directly from the filesystem) | |
131 | with specific parts read on demand. |
|
131 | with specific parts read on demand. | |
132 |
|
132 | |||
133 | The data file contains "nodes" organized in a tree. |
|
133 | The data file contains "nodes" organized in a tree. | |
134 | Each node represents a file or directory inside the working directory |
|
134 | Each node represents a file or directory inside the working directory | |
135 | or its parent changeset. |
|
135 | or its parent changeset. | |
136 | This tree has the same structure as the filesystem, |
|
136 | This tree has the same structure as the filesystem, | |
137 | so a node representing a directory has child nodes representing |
|
137 | so a node representing a directory has child nodes representing | |
138 | the files and subdirectories contained directly in that directory. |
|
138 | the files and subdirectories contained directly in that directory. | |
139 |
|
139 | |||
140 | The docket file format |
|
140 | The docket file format | |
141 | ---------------------- |
|
141 | ---------------------- | |
142 |
|
142 | |||
143 | This is implemented in `rust/hg-core/src/dirstate_tree/on_disk.rs` |
|
143 | This is implemented in `rust/hg-core/src/dirstate_tree/on_disk.rs` | |
144 | and `mercurial/dirstateutils/docket.py`. |
|
144 | and `mercurial/dirstateutils/docket.py`. | |
145 |
|
145 | |||
146 | Components of the docket file are found at fixed offsets, |
|
146 | Components of the docket file are found at fixed offsets, | |
147 | counted in bytes from the start of the file: |
|
147 | counted in bytes from the start of the file: | |
148 |
|
148 | |||
149 | * Offset 0: |
|
149 | * Offset 0: | |
150 | The 12-bytes marker string "dirstate-v2\n" ending with a newline character. |
|
150 | The 12-bytes marker string "dirstate-v2\n" ending with a newline character. | |
151 | This makes it easier to tell a dirstate-v2 file from a dirstate-v1 file, |
|
151 | This makes it easier to tell a dirstate-v2 file from a dirstate-v1 file, | |
152 | although it is not strictly necessary |
|
152 | although it is not strictly necessary | |
153 | since `.hg/requires` determines which format to use. |
|
153 | since `.hg/requires` determines which format to use. | |
154 |
|
154 | |||
155 | * Offset 12: |
|
155 | * Offset 12: | |
156 | The changeset node ID on the first parent of the working directory, |
|
156 | The changeset node ID on the first parent of the working directory, | |
157 | as up to 32 binary bytes. |
|
157 | as up to 32 binary bytes. | |
158 | If a node ID is shorter (20 bytes for SHA-1), |
|
158 | If a node ID is shorter (20 bytes for SHA-1), | |
159 | it is start-aligned and the rest of the bytes are set to zero. |
|
159 | it is start-aligned and the rest of the bytes are set to zero. | |
160 |
|
160 | |||
161 | * Offset 44: |
|
161 | * Offset 44: | |
162 | The changeset node ID on the second parent of the working directory, |
|
162 | The changeset node ID on the second parent of the working directory, | |
163 | or all zeros if there isn’t one. |
|
163 | or all zeros if there isn’t one. | |
164 | Also 32 binary bytes. |
|
164 | Also 32 binary bytes. | |
165 |
|
165 | |||
166 | * Offset 76: |
|
166 | * Offset 76: | |
167 | Tree metadata on 44 bytes, described below. |
|
167 | Tree metadata on 44 bytes, described below. | |
168 | Its separation in this documentation from the rest of the docket |
|
168 | Its separation in this documentation from the rest of the docket | |
169 | reflects a detail of the current implementation. |
|
169 | reflects a detail of the current implementation. | |
170 | Since tree metadata is also made of fields at fixed offsets, those could |
|
170 | Since tree metadata is also made of fields at fixed offsets, those could | |
171 | be inlined here by adding 76 bytes to each offset. |
|
171 | be inlined here by adding 76 bytes to each offset. | |
172 |
|
172 | |||
173 | * Offset 120: |
|
173 | * Offset 120: | |
174 | The used size of the data file, as a 32-bit big-endian integer. |
|
174 | The used size of the data file, as a 32-bit big-endian integer. | |
175 | The actual size of the data file may be larger |
|
175 | The actual size of the data file may be larger | |
176 | (if another Mercurial processis in appending to it |
|
176 | (if another Mercurial processis in appending to it | |
177 | but has not updated the docket yet). |
|
177 | but has not updated the docket yet). | |
178 | That extra data must be ignored. |
|
178 | That extra data must be ignored. | |
179 |
|
179 | |||
180 | * Offset 124: |
|
180 | * Offset 124: | |
181 | The length of the data file identifier, as a 8-bit integer. |
|
181 | The length of the data file identifier, as a 8-bit integer. | |
182 |
|
182 | |||
183 | * Offset 125: |
|
183 | * Offset 125: | |
184 | The data file identifier. |
|
184 | The data file identifier. | |
185 |
|
185 | |||
186 | * Any additional data is current ignored, and dropped when updating the file. |
|
186 | * Any additional data is current ignored, and dropped when updating the file. | |
187 |
|
187 | |||
188 | Tree metadata in the docket file |
|
188 | Tree metadata in the docket file | |
189 | -------------------------------- |
|
189 | -------------------------------- | |
190 |
|
190 | |||
191 | Tree metadata is similarly made of components at fixed offsets. |
|
191 | Tree metadata is similarly made of components at fixed offsets. | |
192 | These offsets are counted in bytes from the start of tree metadata, |
|
192 | These offsets are counted in bytes from the start of tree metadata, | |
193 | which is 76 bytes after the start of the docket file. |
|
193 | which is 76 bytes after the start of the docket file. | |
194 |
|
194 | |||
195 | This metadata can be thought of as the singular root of the tree |
|
195 | This metadata can be thought of as the singular root of the tree | |
196 | formed by nodes in the data file. |
|
196 | formed by nodes in the data file. | |
197 |
|
197 | |||
198 | * Offset 0: |
|
198 | * Offset 0: | |
199 | Pseudo-pointer to the start of root nodes, |
|
199 | Pseudo-pointer to the start of root nodes, | |
200 | counted in bytes from the start of the data file, |
|
200 | counted in bytes from the start of the data file, | |
201 | as a 32-bit big-endian integer. |
|
201 | as a 32-bit big-endian integer. | |
202 | These nodes describe files and directories found directly |
|
202 | These nodes describe files and directories found directly | |
203 | at the root of the working directory. |
|
203 | at the root of the working directory. | |
204 |
|
204 | |||
205 | * Offset 4: |
|
205 | * Offset 4: | |
206 | Number of root nodes, as a 32-bit big-endian integer. |
|
206 | Number of root nodes, as a 32-bit big-endian integer. | |
207 |
|
207 | |||
208 | * Offset 8: |
|
208 | * Offset 8: | |
209 | Total number of nodes in the entire tree that "have a dirstate entry", |
|
209 | Total number of nodes in the entire tree that "have a dirstate entry", | |
210 | as a 32-bit big-endian integer. |
|
210 | as a 32-bit big-endian integer. | |
211 | Those nodes represent files that would be present at all in `dirstate-v1`. |
|
211 | Those nodes represent files that would be present at all in `dirstate-v1`. | |
212 | This is typically less than the total number of nodes. |
|
212 | This is typically less than the total number of nodes. | |
213 | This counter is used to implement `len(dirstatemap)`. |
|
213 | This counter is used to implement `len(dirstatemap)`. | |
214 |
|
214 | |||
215 | * Offset 12: |
|
215 | * Offset 12: | |
216 | Number of nodes in the entire tree that have a copy source, |
|
216 | Number of nodes in the entire tree that have a copy source, | |
217 | as a 32-bit big-endian integer. |
|
217 | as a 32-bit big-endian integer. | |
218 | At the next commit, these files are recorded |
|
218 | At the next commit, these files are recorded | |
219 | as having been copied or moved/renamed from that source. |
|
219 | as having been copied or moved/renamed from that source. | |
220 | (A move is recorded as a copy and separate removal of the source.) |
|
220 | (A move is recorded as a copy and separate removal of the source.) | |
221 | This counter is used to implement `len(dirstatemap.copymap)`. |
|
221 | This counter is used to implement `len(dirstatemap.copymap)`. | |
222 |
|
222 | |||
223 | * Offset 16: |
|
223 | * Offset 16: | |
224 | An estimation of how many bytes of the data file |
|
224 | An estimation of how many bytes of the data file | |
225 | (within its used size) are unused, as a 32-bit big-endian integer. |
|
225 | (within its used size) are unused, as a 32-bit big-endian integer. | |
226 | When appending to an existing data file, |
|
226 | When appending to an existing data file, | |
227 | some existing nodes or paths can be unreachable from the new root |
|
227 | some existing nodes or paths can be unreachable from the new root | |
228 | but they still take up space. |
|
228 | but they still take up space. | |
229 | This counter is used to decide when to write a new data file from scratch |
|
229 | This counter is used to decide when to write a new data file from scratch | |
230 | instead of appending to an existing one, |
|
230 | instead of appending to an existing one, | |
231 | in order to get rid of that unreachable data |
|
231 | in order to get rid of that unreachable data | |
232 | and avoid unbounded file size growth. |
|
232 | and avoid unbounded file size growth. | |
233 |
|
233 | |||
234 | * Offset 20: |
|
234 | * Offset 20: | |
235 | These four bytes are currently ignored |
|
235 | These four bytes are currently ignored | |
236 | and reset to zero when updating a docket file. |
|
236 | and reset to zero when updating a docket file. | |
237 | This is an attempt at forward compatibility: |
|
237 | This is an attempt at forward compatibility: | |
238 | future Mercurial versions could use this as a bit field |
|
238 | future Mercurial versions could use this as a bit field | |
239 | to indicate that a dirstate has additional data or constraints. |
|
239 | to indicate that a dirstate has additional data or constraints. | |
240 | Finding a dirstate file with the relevant bit unset indicates that |
|
240 | Finding a dirstate file with the relevant bit unset indicates that | |
241 | it was written by a then-older version |
|
241 | it was written by a then-older version | |
242 | which is not aware of that future change. |
|
242 | which is not aware of that future change. | |
243 |
|
243 | |||
244 | * Offset 24: |
|
244 | * Offset 24: | |
245 | Either 20 zero bytes, or a SHA-1 hash as 20 binary bytes. |
|
245 | Either 20 zero bytes, or a SHA-1 hash as 20 binary bytes. | |
246 | When present, the hash is of ignore patterns |
|
246 | When present, the hash is of ignore patterns | |
247 | that were used for some previous run of the `status` algorithm. |
|
247 | that were used for some previous run of the `status` algorithm. | |
248 |
|
248 | |||
249 | * (Offset 44: end of tree metadata) |
|
249 | * (Offset 44: end of tree metadata) | |
250 |
|
250 | |||
251 | Optional hash of ignore patterns |
|
251 | Optional hash of ignore patterns | |
252 | -------------------------------- |
|
252 | -------------------------------- | |
253 |
|
253 | |||
254 | The implementation of `status` at `rust/hg-core/src/dirstate_tree/status.rs` |
|
254 | The implementation of `status` at `rust/hg-core/src/dirstate_tree/status.rs` | |
255 | has been optimized such that its run time is dominated by calls |
|
255 | has been optimized such that its run time is dominated by calls | |
256 | to `stat` for reading the filesystem metadata of a file or directory, |
|
256 | to `stat` for reading the filesystem metadata of a file or directory, | |
257 | and to `readdir` for listing the contents of a directory. |
|
257 | and to `readdir` for listing the contents of a directory. | |
258 | In some cases the algorithm can skip calls to `readdir` |
|
258 | In some cases the algorithm can skip calls to `readdir` | |
259 | (saving significant time) |
|
259 | (saving significant time) | |
260 | because the dirstate already contains enough of the relevant information |
|
260 | because the dirstate already contains enough of the relevant information | |
261 | to build the correct `status` results. |
|
261 | to build the correct `status` results. | |
262 |
|
262 | |||
263 | The default configuration of `hg status` is to list unknown files |
|
263 | The default configuration of `hg status` is to list unknown files | |
264 | but not ignored files. |
|
264 | but not ignored files. | |
265 | In this case, it matters for the `readdir`-skipping optimization |
|
265 | In this case, it matters for the `readdir`-skipping optimization | |
266 | if a given file used to be ignored but became unknown |
|
266 | if a given file used to be ignored but became unknown | |
267 | because `.hgignore` changed. |
|
267 | because `.hgignore` changed. | |
268 | To detect the possibility of such a change, |
|
268 | To detect the possibility of such a change, | |
269 | the tree metadata contains an optional hash of all ignore patterns. |
|
269 | the tree metadata contains an optional hash of all ignore patterns. | |
270 |
|
270 | |||
271 | We define: |
|
271 | We define: | |
272 |
|
272 | |||
273 | * "Root" ignore files as: |
|
273 | * "Root" ignore files as: | |
274 |
|
274 | |||
275 | - `.hgignore` at the root of the repository if it exists |
|
275 | - `.hgignore` at the root of the repository if it exists | |
276 | - And all files from `ui.ignore.*` config. |
|
276 | - And all files from `ui.ignore.*` config. | |
277 |
|
277 | |||
278 | This set of files is sorted by the string representation of their path. |
|
278 | This set of files is sorted by the string representation of their path. | |
279 |
|
279 | |||
280 | * The "expanded contents" of an ignore files is the byte string made |
|
280 | * The "expanded contents" of an ignore files is the byte string made | |
281 | by the concatenation of its contents followed by the "expanded contents" |
|
281 | by the concatenation of its contents followed by the "expanded contents" | |
282 | of other files included with `include:` or `subinclude:` directives, |
|
282 | of other files included with `include:` or `subinclude:` directives, | |
283 | in inclusion order. This definition is recursive, as included files can |
|
283 | in inclusion order. This definition is recursive, as included files can | |
284 | themselves include more files. |
|
284 | themselves include more files. | |
285 |
|
285 | |||
286 | This hash is defined as the SHA-1 of the concatenation (in sorted |
|
286 | This hash is defined as the SHA-1 of the concatenation (in sorted | |
287 | order) of the "expanded contents" of each "root" ignore file. |
|
287 | order) of the "expanded contents" of each "root" ignore file. | |
288 | (Note that computing this does not require actually concatenating |
|
288 | (Note that computing this does not require actually concatenating | |
289 | into a single contiguous byte sequence. |
|
289 | into a single contiguous byte sequence. | |
290 | Instead a SHA-1 hasher object can be created |
|
290 | Instead a SHA-1 hasher object can be created | |
291 | and fed separate chunks one by one.) |
|
291 | and fed separate chunks one by one.) | |
292 |
|
292 | |||
293 | The data file format |
|
293 | The data file format | |
294 | -------------------- |
|
294 | -------------------- | |
295 |
|
295 | |||
296 | This is implemented in `rust/hg-core/src/dirstate_tree/on_disk.rs` |
|
296 | This is implemented in `rust/hg-core/src/dirstate_tree/on_disk.rs` | |
297 | and `mercurial/dirstateutils/v2.py`. |
|
297 | and `mercurial/dirstateutils/v2.py`. | |
298 |
|
298 | |||
299 | The data file contains two types of data: paths and nodes. |
|
299 | The data file contains two types of data: paths and nodes. | |
300 |
|
300 | |||
301 | Paths and nodes can be organized in any order in the file, except that sibling |
|
301 | Paths and nodes can be organized in any order in the file, except that sibling | |
302 | nodes must be next to each other and sorted by their path. |
|
302 | nodes must be next to each other and sorted by their path. | |
303 | Contiguity lets the parent refer to them all |
|
303 | Contiguity lets the parent refer to them all | |
304 | by their count and a single pseudo-pointer, |
|
304 | by their count and a single pseudo-pointer, | |
305 | instead of storing one pseudo-pointer per child node. |
|
305 | instead of storing one pseudo-pointer per child node. | |
306 | Sorting allows using binary seach to find a child node with a given name |
|
306 | Sorting allows using binary seach to find a child node with a given name | |
307 | in `O(log(n))` byte sequence comparisons. |
|
307 | in `O(log(n))` byte sequence comparisons. | |
308 |
|
308 | |||
309 | The current implemention writes paths and child node before a given node |
|
309 | The current implemention writes paths and child node before a given node | |
310 | for ease of figuring out the value of pseudo-pointers by the time the are to be |
|
310 | for ease of figuring out the value of pseudo-pointers by the time the are to be | |
311 | written, but this is not an obligation and readers must not rely on it. |
|
311 | written, but this is not an obligation and readers must not rely on it. | |
312 |
|
312 | |||
313 | A path is stored as a byte string anywhere in the file, without delimiter. |
|
313 | A path is stored as a byte string anywhere in the file, without delimiter. | |
314 | It is refered to by one or more node by a pseudo-pointer to its start, and its |
|
314 | It is refered to by one or more node by a pseudo-pointer to its start, and its | |
315 | length in bytes. Since there is no delimiter, |
|
315 | length in bytes. Since there is no delimiter, | |
316 | when a path is a substring of another the same bytes could be reused, |
|
316 | when a path is a substring of another the same bytes could be reused, | |
317 | although the implementation does not exploit this as of this writing. |
|
317 | although the implementation does not exploit this as of this writing. | |
318 |
|
318 | |||
319 | A node is stored on 43 bytes with components at fixed offsets. Paths and |
|
319 | A node is stored on 43 bytes with components at fixed offsets. Paths and | |
320 | child nodes relevant to a node are stored externally and referenced though |
|
320 | child nodes relevant to a node are stored externally and referenced though | |
321 | pseudo-pointers. |
|
321 | pseudo-pointers. | |
322 |
|
322 | |||
323 | All integers are stored in big-endian. All pseudo-pointers are 32-bit integers |
|
323 | All integers are stored in big-endian. All pseudo-pointers are 32-bit integers | |
324 | counting bytes from the start of the data file. Path lengths and positions |
|
324 | counting bytes from the start of the data file. Path lengths and positions | |
325 | are 16-bit integers, also counted in bytes. |
|
325 | are 16-bit integers, also counted in bytes. | |
326 |
|
326 | |||
327 | Node components are: |
|
327 | Node components are: | |
328 |
|
328 | |||
329 | * Offset 0: |
|
329 | * Offset 0: | |
330 | Pseudo-pointer to the full path of this node, |
|
330 | Pseudo-pointer to the full path of this node, | |
331 | from the working directory root. |
|
331 | from the working directory root. | |
332 |
|
332 | |||
333 | * Offset 4: |
|
333 | * Offset 4: | |
334 | Length of the full path. |
|
334 | Length of the full path. | |
335 |
|
335 | |||
336 | * Offset 6: |
|
336 | * Offset 6: | |
337 | Position of the last `/` path separator within the full path, |
|
337 | Position of the last `/` path separator within the full path, | |
338 | in bytes from the start of the full path, |
|
338 | in bytes from the start of the full path, | |
339 | or zero if there isn’t one. |
|
339 | or zero if there isn’t one. | |
340 | The part of the full path after this position is the "base name". |
|
340 | The part of the full path after this position is the "base name". | |
341 | Since sibling nodes have the same parent, only their base name vary |
|
341 | Since sibling nodes have the same parent, only their base name vary | |
342 | and needs to be considered when doing binary search to find a given path. |
|
342 | and needs to be considered when doing binary search to find a given path. | |
343 |
|
343 | |||
344 | * Offset 8: |
|
344 | * Offset 8: | |
345 | Pseudo-pointer to the "copy source" path for this node, |
|
345 | Pseudo-pointer to the "copy source" path for this node, | |
346 | or zero if there is no copy source. |
|
346 | or zero if there is no copy source. | |
347 |
|
347 | |||
348 | * Offset 12: |
|
348 | * Offset 12: | |
349 | Length of the copy source path, or zero if there isn’t one. |
|
349 | Length of the copy source path, or zero if there isn’t one. | |
350 |
|
350 | |||
351 | * Offset 14: |
|
351 | * Offset 14: | |
352 | Pseudo-pointer to the start of child nodes. |
|
352 | Pseudo-pointer to the start of child nodes. | |
353 |
|
353 | |||
354 | * Offset 18: |
|
354 | * Offset 18: | |
355 | Number of child nodes, as a 32-bit integer. |
|
355 | Number of child nodes, as a 32-bit integer. | |
356 | They occupy 43 times this number of bytes |
|
356 | They occupy 43 times this number of bytes | |
357 | (not counting space for paths, and further descendants). |
|
357 | (not counting space for paths, and further descendants). | |
358 |
|
358 | |||
359 | * Offset 22: |
|
359 | * Offset 22: | |
360 | Number as a 32-bit integer of descendant nodes in this subtree, |
|
360 | Number as a 32-bit integer of descendant nodes in this subtree, | |
361 | not including this node itself, |
|
361 | not including this node itself, | |
362 | that "have a dirstate entry". |
|
362 | that "have a dirstate entry". | |
363 | Those nodes represent files that would be present at all in `dirstate-v1`. |
|
363 | Those nodes represent files that would be present at all in `dirstate-v1`. | |
364 | This is typically less than the total number of descendants. |
|
364 | This is typically less than the total number of descendants. | |
365 | This counter is used to implement `has_dir`. |
|
365 | This counter is used to implement `has_dir`. | |
366 |
|
366 | |||
367 | * Offset 26: |
|
367 | * Offset 26: | |
368 | Number as a 32-bit integer of descendant nodes in this subtree, |
|
368 | Number as a 32-bit integer of descendant nodes in this subtree, | |
369 | not including this node itself, |
|
369 | not including this node itself, | |
370 | that represent files tracked in the working directory. |
|
370 | that represent files tracked in the working directory. | |
371 | (For example, `hg rm` makes a file untracked.) |
|
371 | (For example, `hg rm` makes a file untracked.) | |
372 | This counter is used to implement `has_tracked_dir`. |
|
372 | This counter is used to implement `has_tracked_dir`. | |
373 |
|
373 | |||
374 | * Offset 30: |
|
374 | * Offset 30: | |
375 | A `flags` fields that packs some boolean values as bits of a 16-bit integer. |
|
375 | A `flags` fields that packs some boolean values as bits of a 16-bit integer. | |
376 | Starting from least-significant, bit masks are:: |
|
376 | Starting from least-significant, bit masks are:: | |
377 |
|
377 | |||
378 | WDIR_TRACKED = 1 << 0 |
|
378 | WDIR_TRACKED = 1 << 0 | |
379 | P1_TRACKED = 1 << 1 |
|
379 | P1_TRACKED = 1 << 1 | |
380 | P2_INFO = 1 << 2 |
|
380 | P2_INFO = 1 << 2 | |
381 | MODE_EXEC_PERM = 1 << 3 |
|
381 | MODE_EXEC_PERM = 1 << 3 | |
382 | MODE_IS_SYMLINK = 1 << 4 |
|
382 | MODE_IS_SYMLINK = 1 << 4 | |
383 | HAS_FALLBACK_EXEC = 1 << 5 |
|
383 | HAS_FALLBACK_EXEC = 1 << 5 | |
384 | FALLBACK_EXEC = 1 << 6 |
|
384 | FALLBACK_EXEC = 1 << 6 | |
385 | HAS_FALLBACK_SYMLINK = 1 << 7 |
|
385 | HAS_FALLBACK_SYMLINK = 1 << 7 | |
386 | FALLBACK_SYMLINK = 1 << 8 |
|
386 | FALLBACK_SYMLINK = 1 << 8 | |
387 | EXPECTED_STATE_IS_MODIFIED = 1 << 9 |
|
387 | EXPECTED_STATE_IS_MODIFIED = 1 << 9 | |
388 | HAS_MODE_AND_SIZE = 1 << 10 |
|
388 | HAS_MODE_AND_SIZE = 1 << 10 | |
389 | HAS_MTIME = 1 << 11 |
|
389 | HAS_MTIME = 1 << 11 | |
390 | MTIME_SECOND_AMBIGUOUS = 1 << 12 |
|
390 | MTIME_SECOND_AMBIGUOUS = 1 << 12 | |
391 | DIRECTORY = 1 << 13 |
|
391 | DIRECTORY = 1 << 13 | |
392 | ALL_UNKNOWN_RECORDED = 1 << 14 |
|
392 | ALL_UNKNOWN_RECORDED = 1 << 14 | |
393 | ALL_IGNORED_RECORDED = 1 << 15 |
|
393 | ALL_IGNORED_RECORDED = 1 << 15 | |
394 |
|
394 | |||
395 | The meaning of each bit is described below. |
|
395 | The meaning of each bit is described below. | |
396 |
|
396 | |||
397 | Other bits are unset. |
|
397 | Other bits are unset. | |
398 | They may be assigned meaning if the future, |
|
398 | They may be assigned meaning if the future, | |
399 | with the limitation that Mercurial versions that pre-date such meaning |
|
399 | with the limitation that Mercurial versions that pre-date such meaning | |
400 | will always reset those bits to unset when writing nodes. |
|
400 | will always reset those bits to unset when writing nodes. | |
401 | (A new node is written for any mutation in its subtree, |
|
401 | (A new node is written for any mutation in its subtree, | |
402 | leaving the bytes of the old node unreachable |
|
402 | leaving the bytes of the old node unreachable | |
403 | until the data file is rewritten entirely.) |
|
403 | until the data file is rewritten entirely.) | |
404 |
|
404 | |||
405 | * Offset 32: |
|
405 | * Offset 32: | |
406 | A `size` field described below, as a 32-bit integer. |
|
406 | A `size` field described below, as a 32-bit integer. | |
407 | Unlike in dirstate-v1, negative values are not used. |
|
407 | Unlike in dirstate-v1, negative values are not used. | |
408 |
|
408 | |||
409 | * Offset 36: |
|
409 | * Offset 36: | |
410 | The seconds component of an `mtime` field described below, |
|
410 | The seconds component of an `mtime` field described below, | |
411 | as a 32-bit integer. |
|
411 | as a 32-bit integer. | |
412 | Unlike in dirstate-v1, negative values are not used. |
|
412 | Unlike in dirstate-v1, negative values are not used. | |
413 | When `mtime` is used, this is number of seconds since the Unix epoch |
|
413 | When `mtime` is used, this is number of seconds since the Unix epoch | |
414 | truncated to its lower 31 bits. |
|
414 | truncated to its lower 31 bits. | |
415 |
|
415 | |||
416 | * Offset 40: |
|
416 | * Offset 40: | |
417 | The nanoseconds component of an `mtime` field described below, |
|
417 | The nanoseconds component of an `mtime` field described below, | |
418 | as a 32-bit integer. |
|
418 | as a 32-bit integer. | |
419 | When `mtime` is used, |
|
419 | When `mtime` is used, | |
420 | this is the number of nanoseconds since `mtime.seconds`, |
|
420 | this is the number of nanoseconds since `mtime.seconds`, | |
421 | always stritctly less than one billion. |
|
421 | always stritctly less than one billion. | |
422 |
|
422 | |||
423 | This may be zero if more precision is not available. |
|
423 | This may be zero if more precision is not available. | |
424 | (This can happen because of limitations in any of Mercurial, Python, |
|
424 | (This can happen because of limitations in any of Mercurial, Python, | |
425 | libc, the operating system, …) |
|
425 | libc, the operating system, …) | |
426 |
|
426 | |||
427 | When comparing two mtimes and either has this component set to zero, |
|
427 | When comparing two mtimes and either has this component set to zero, | |
428 | the sub-second precision of both should be ignored. |
|
428 | the sub-second precision of both should be ignored. | |
429 | False positives when checking mtime equality due to clock resolution |
|
429 | False positives when checking mtime equality due to clock resolution | |
430 | are always possible and the status algorithm needs to deal with them, |
|
430 | are always possible and the status algorithm needs to deal with them, | |
431 | but having too many false negatives could be harmful too. |
|
431 | but having too many false negatives could be harmful too. | |
432 |
|
432 | |||
433 | * (Offset 44: end of this node) |
|
433 | * (Offset 44: end of this node) | |
434 |
|
434 | |||
435 | The meaning of the boolean values packed in `flags` is: |
|
435 | The meaning of the boolean values packed in `flags` is: | |
436 |
|
436 | |||
437 | `WDIR_TRACKED` |
|
437 | `WDIR_TRACKED` | |
438 | Set if the working directory contains a tracked file at this node’s path. |
|
438 | Set if the working directory contains a tracked file at this node’s path. | |
439 | This is typically set and unset by `hg add` and `hg rm`. |
|
439 | This is typically set and unset by `hg add` and `hg rm`. | |
440 |
|
440 | |||
441 | `P1_TRACKED` |
|
441 | `P1_TRACKED` | |
442 | Set if the working directory’s first parent changeset |
|
442 | Set if the working directory’s first parent changeset | |
443 | (whose node identifier is found in tree metadata) |
|
443 | (whose node identifier is found in tree metadata) | |
444 | contains a tracked file at this node’s path. |
|
444 | contains a tracked file at this node’s path. | |
445 | This is a cache to reduce manifest lookups. |
|
445 | This is a cache to reduce manifest lookups. | |
446 |
|
446 | |||
447 | `P2_INFO` |
|
447 | `P2_INFO` | |
448 | Set if the file has been involved in some merge operation. |
|
448 | Set if the file has been involved in some merge operation. | |
449 | Either because it was actually merged, |
|
449 | Either because it was actually merged, | |
450 | or because the version in the second parent p2 version was ahead, |
|
450 | or because the version in the second parent p2 version was ahead, | |
451 | or because some rename moved it there. |
|
451 | or because some rename moved it there. | |
452 | In either case `hg status` will want it displayed as modified. |
|
452 | In either case `hg status` will want it displayed as modified. | |
453 |
|
453 | |||
454 | Files that would be mentioned at all in the `dirstate-v1` file format |
|
454 | Files that would be mentioned at all in the `dirstate-v1` file format | |
455 | have a node with at least one of the above three bits set in `dirstate-v2`. |
|
455 | have a node with at least one of the above three bits set in `dirstate-v2`. | |
456 | Let’s call these files "tracked anywhere", |
|
456 | Let’s call these files "tracked anywhere", | |
457 | and "untracked" the nodes with all three of these bits unset. |
|
457 | and "untracked" the nodes with all three of these bits unset. | |
458 | Untracked nodes are typically for directories: |
|
458 | Untracked nodes are typically for directories: | |
459 | they hold child nodes and form the tree structure. |
|
459 | they hold child nodes and form the tree structure. | |
460 | Additional untracked nodes may also exist. |
|
460 | Additional untracked nodes may also exist. | |
461 | Although implementations should strive to clean up nodes |
|
461 | Although implementations should strive to clean up nodes | |
462 | that are entirely unused, other untracked nodes may also exist. |
|
462 | that are entirely unused, other untracked nodes may also exist. | |
463 | For example, a future version of Mercurial might in some cases |
|
463 | For example, a future version of Mercurial might in some cases | |
464 | add nodes for untracked files or/and ignored files in the working directory |
|
464 | add nodes for untracked files or/and ignored files in the working directory | |
465 | in order to optimize `hg status` |
|
465 | in order to optimize `hg status` | |
466 | by enabling it to skip `readdir` in more cases. |
|
466 | by enabling it to skip `readdir` in more cases. | |
467 |
|
467 | |||
468 | `HAS_MODE_AND_SIZE` |
|
468 | `HAS_MODE_AND_SIZE` | |
469 | Must be unset for untracked nodes. |
|
469 | Must be unset for untracked nodes. | |
470 | For files tracked anywhere, if this is set: |
|
470 | For files tracked anywhere, if this is set: | |
471 | - The `size` field is the expected file size, |
|
471 | - The `size` field is the expected file size, | |
472 | in bytes truncated its lower to 31 bits. |
|
472 | in bytes truncated its lower to 31 bits. | |
473 | - The expected execute permission for the file’s owner |
|
473 | - The expected execute permission for the file’s owner | |
474 | is given by `MODE_EXEC_PERM` |
|
474 | is given by `MODE_EXEC_PERM` | |
475 | - The expected file type is given by `MODE_IS_SIMLINK`: |
|
475 | - The expected file type is given by `MODE_IS_SIMLINK`: | |
476 | a symbolic link if set, or a normal file if unset. |
|
476 | a symbolic link if set, or a normal file if unset. | |
477 | If this is unset the expected size, permission, and file type are unknown. |
|
477 | If this is unset the expected size, permission, and file type are unknown. | |
478 | The `size` field is unused (set to zero). |
|
478 | The `size` field is unused (set to zero). | |
479 |
|
479 | |||
480 | `HAS_MTIME` |
|
480 | `HAS_MTIME` | |
481 | The nodes contains a "valid" last modification time in the `mtime` field. |
|
481 | The nodes contains a "valid" last modification time in the `mtime` field. | |
482 |
|
482 | |||
483 |
|
483 | |||
484 | It means the `mtime` was already strictly in the past when observed, |
|
484 | It means the `mtime` was already strictly in the past when observed, | |
485 | meaning that later changes cannot happen in the same clock tick |
|
485 | meaning that later changes cannot happen in the same clock tick | |
486 | and must cause a different modification time |
|
486 | and must cause a different modification time | |
487 | (unless the system clock jumps back and we get unlucky, |
|
487 | (unless the system clock jumps back and we get unlucky, | |
488 | which is not impossible but deemed unlikely enough). |
|
488 | which is not impossible but deemed unlikely enough). | |
489 |
|
489 | |||
490 | This means that if `std::fs::symlink_metadata` later reports |
|
490 | This means that if `std::fs::symlink_metadata` later reports | |
491 | the same modification time |
|
491 | the same modification time | |
492 | and ignored patterns haven’t changed, |
|
492 | and ignored patterns haven’t changed, | |
493 | we can assume the node to be unchanged on disk. |
|
493 | we can assume the node to be unchanged on disk. | |
494 |
|
494 | |||
495 | The `mtime` field can then be used to skip more expensive lookup when |
|
495 | The `mtime` field can then be used to skip more expensive lookup when | |
496 | checking the status of "tracked" nodes. |
|
496 | checking the status of "tracked" nodes. | |
497 |
|
497 | |||
498 | It can also be set for node where `DIRECTORY` is set. |
|
498 | It can also be set for node where `DIRECTORY` is set. | |
499 | See `DIRECTORY` documentation for details. |
|
499 | See `DIRECTORY` documentation for details. | |
500 |
|
500 | |||
501 | `DIRECTORY` |
|
501 | `DIRECTORY` | |
502 | When set, this entry will match a directory that exists or existed on the |
|
502 | When set, this entry will match a directory that exists or existed on the | |
503 | file system. |
|
503 | file system. | |
504 |
|
504 | |||
505 | * When `HAS_MTIME` is set a directory has been seen on the file system and |
|
505 | * When `HAS_MTIME` is set a directory has been seen on the file system and | |
506 | `mtime` matches its last modificiation time. However, `HAS_MTIME` not being set |
|
506 | `mtime` matches its last modificiation time. However, `HAS_MTIME` not being set | |
507 | does not indicate the lack of directory on the file system. |
|
507 | does not indicate the lack of directory on the file system. | |
508 |
|
508 | |||
509 | * When not tracked anywhere, this node does not represent an ignored or |
|
509 | * When not tracked anywhere, this node does not represent an ignored or | |
510 | unknown file on disk. |
|
510 | unknown file on disk. | |
511 |
|
511 | |||
512 | If `HAS_MTIME` is set |
|
512 | If `HAS_MTIME` is set | |
513 | and `mtime` matches the last modification time of the directory on disk, |
|
513 | and `mtime` matches the last modification time of the directory on disk, | |
514 | the directory is unchanged |
|
514 | the directory is unchanged | |
515 | and we can skip calling `std::fs::read_dir` again for this directory, |
|
515 | and we can skip calling `std::fs::read_dir` again for this directory, | |
516 | and iterate child dirstate nodes instead. |
|
516 | and iterate child dirstate nodes instead. | |
517 | (as long as `ALL_UNKNOWN_RECORDED` and `ALL_IGNORED_RECORDED` are taken |
|
517 | (as long as `ALL_UNKNOWN_RECORDED` and `ALL_IGNORED_RECORDED` are taken | |
518 | into account) |
|
518 | into account) | |
519 |
|
519 | |||
520 | `MODE_EXEC_PERM` |
|
520 | `MODE_EXEC_PERM` | |
521 | Must be unset if `HAS_MODE_AND_SIZE` is unset. |
|
521 | Must be unset if `HAS_MODE_AND_SIZE` is unset. | |
522 | If `HAS_MODE_AND_SIZE` is set, |
|
522 | If `HAS_MODE_AND_SIZE` is set, | |
523 | this indicates whether the file’s own is expected |
|
523 | this indicates whether the file’s own is expected | |
524 | to have execute permission. |
|
524 | to have execute permission. | |
525 |
|
525 | |||
526 | Beware that on system without fs support for this information, the value |
|
526 | Beware that on system without fs support for this information, the value | |
527 | stored in the dirstate might be wrong and should not be relied on. |
|
527 | stored in the dirstate might be wrong and should not be relied on. | |
528 |
|
528 | |||
529 | `MODE_IS_SYMLINK` |
|
529 | `MODE_IS_SYMLINK` | |
530 | Must be unset if `HAS_MODE_AND_SIZE` is unset. |
|
530 | Must be unset if `HAS_MODE_AND_SIZE` is unset. | |
531 | If `HAS_MODE_AND_SIZE` is set, |
|
531 | If `HAS_MODE_AND_SIZE` is set, | |
532 | this indicates whether the file is expected to be a symlink |
|
532 | this indicates whether the file is expected to be a symlink | |
533 | as opposed to a normal file. |
|
533 | as opposed to a normal file. | |
534 |
|
534 | |||
535 | Beware that on system without fs support for this information, the value |
|
535 | Beware that on system without fs support for this information, the value | |
536 | stored in the dirstate might be wrong and should not be relied on. |
|
536 | stored in the dirstate might be wrong and should not be relied on. | |
537 |
|
537 | |||
538 | `EXPECTED_STATE_IS_MODIFIED` |
|
538 | `EXPECTED_STATE_IS_MODIFIED` | |
539 | Must be unset for untracked nodes. |
|
539 | Must be unset for untracked nodes. | |
540 | For: |
|
540 | For: | |
541 | - a file tracked anywhere |
|
541 | - a file tracked anywhere | |
542 | - that has expected metadata (`HAS_MODE_AND_SIZE` and `HAS_MTIME`) |
|
542 | - that has expected metadata (`HAS_MODE_AND_SIZE` and `HAS_MTIME`) | |
543 | - if that metadata matches |
|
543 | - if that metadata matches | |
544 | metadata found in the working directory with `stat` |
|
544 | metadata found in the working directory with `stat` | |
545 | This bit indicates the status of the file. |
|
545 | This bit indicates the status of the file. | |
546 | If set, the status is modified. If unset, it is clean. |
|
546 | If set, the status is modified. If unset, it is clean. | |
547 |
|
547 | |||
548 | In cases where `hg status` needs to read the contents of a file |
|
548 | In cases where `hg status` needs to read the contents of a file | |
549 | because metadata is ambiguous, this bit lets it record the result |
|
549 | because metadata is ambiguous, this bit lets it record the result | |
550 | if the result is modified so that a future run of `hg status` |
|
550 | if the result is modified so that a future run of `hg status` | |
551 | does not need to do the same again. |
|
551 | does not need to do the same again. | |
552 | It is valid to never set this bit, |
|
552 | It is valid to never set this bit, | |
553 | and consider expected metadata ambiguous if it is set. |
|
553 | and consider expected metadata ambiguous if it is set. | |
554 |
|
554 | |||
555 | `ALL_UNKNOWN_RECORDED` |
|
555 | `ALL_UNKNOWN_RECORDED` | |
556 | If set, all "unknown" children existing on disk (at the time of the last |
|
556 | If set, all "unknown" children existing on disk (at the time of the last | |
557 | status) have been recorded and the `mtime` associated with |
|
557 | status) have been recorded and the `mtime` associated with | |
558 | `DIRECTORY` can be used for optimization even when "unknown" file |
|
558 | `DIRECTORY` can be used for optimization even when "unknown" file | |
559 | are listed. |
|
559 | are listed. | |
560 |
|
560 | |||
561 | Note that the amount recorded "unknown" children can still be zero if None |
|
561 | Note that the amount recorded "unknown" children can still be zero if None | |
562 | where present. |
|
562 | where present. | |
563 |
|
563 | |||
564 | Also note that having this flag unset does not imply that no "unknown" |
|
564 | Also note that having this flag unset does not imply that no "unknown" | |
565 | children have been recorded. Some might be present, but there is no garantee |
|
565 | children have been recorded. Some might be present, but there is no garantee | |
566 | that is will be all of them. |
|
566 | that is will be all of them. | |
567 |
|
567 | |||
568 | `ALL_IGNORED_RECORDED` |
|
568 | `ALL_IGNORED_RECORDED` | |
569 | If set, all "ignored" children existing on disk (at the time of the last |
|
569 | If set, all "ignored" children existing on disk (at the time of the last | |
570 | status) have been recorded and the `mtime` associated with |
|
570 | status) have been recorded and the `mtime` associated with | |
571 | `DIRECTORY` can be used for optimization even when "ignored" file |
|
571 | `DIRECTORY` can be used for optimization even when "ignored" file | |
572 | are listed. |
|
572 | are listed. | |
573 |
|
573 | |||
574 | Note that the amount recorded "ignored" children can still be zero if None |
|
574 | Note that the amount recorded "ignored" children can still be zero if None | |
575 | where present. |
|
575 | where present. | |
576 |
|
576 | |||
577 | Also note that having this flag unset does not imply that no "ignored" |
|
577 | Also note that having this flag unset does not imply that no "ignored" | |
578 | children have been recorded. Some might be present, but there is no garantee |
|
578 | children have been recorded. Some might be present, but there is no garantee | |
579 | that is will be all of them. |
|
579 | that is will be all of them. | |
580 |
|
580 | |||
581 | `HAS_FALLBACK_EXEC` |
|
581 | `HAS_FALLBACK_EXEC` | |
582 | If this flag is set, the entry carries "fallback" information for the |
|
582 | If this flag is set, the entry carries "fallback" information for the | |
583 | executable bit in the `FALLBACK_EXEC` flag. |
|
583 | executable bit in the `FALLBACK_EXEC` flag. | |
584 |
|
584 | |||
585 | Fallback information can be stored in the dirstate to keep track of |
|
585 | Fallback information can be stored in the dirstate to keep track of | |
586 | filesystem attribute tracked by Mercurial when the underlying file |
|
586 | filesystem attribute tracked by Mercurial when the underlying file | |
587 | system or operating system does not support that property, (e.g. |
|
587 | system or operating system does not support that property, (e.g. | |
588 | Windows). |
|
588 | Windows). | |
589 |
|
589 | |||
590 | `FALLBACK_EXEC` |
|
590 | `FALLBACK_EXEC` | |
591 | Should be ignored if `HAS_FALLBACK_EXEC` is unset. If set the file for this |
|
591 | Should be ignored if `HAS_FALLBACK_EXEC` is unset. If set the file for this | |
592 | entry should be considered executable if that information cannot be |
|
592 | entry should be considered executable if that information cannot be | |
593 | extracted from the file system. If unset it should be considered |
|
593 | extracted from the file system. If unset it should be considered | |
594 | non-executable instead. |
|
594 | non-executable instead. | |
595 |
|
595 | |||
596 | `HAS_FALLBACK_SYMLINK` |
|
596 | `HAS_FALLBACK_SYMLINK` | |
597 | If this flag is set, the entry carries "fallback" information for symbolic |
|
597 | If this flag is set, the entry carries "fallback" information for symbolic | |
598 | link status in the `FALLBACK_SYMLINK` flag. |
|
598 | link status in the `FALLBACK_SYMLINK` flag. | |
599 |
|
599 | |||
600 | Fallback information can be stored in the dirstate to keep track of |
|
600 | Fallback information can be stored in the dirstate to keep track of | |
601 | filesystem attribute tracked by Mercurial when the underlying file |
|
601 | filesystem attribute tracked by Mercurial when the underlying file | |
602 | system or operating system does not support that property, (e.g. |
|
602 | system or operating system does not support that property, (e.g. | |
603 | Windows). |
|
603 | Windows). | |
604 |
|
604 | |||
605 | `FALLBACK_SYMLINK` |
|
605 | `FALLBACK_SYMLINK` | |
606 | Should be ignored if `HAS_FALLBACK_SYMLINK` is unset. If set the file for |
|
606 | Should be ignored if `HAS_FALLBACK_SYMLINK` is unset. If set the file for | |
607 | this entry should be considered a symlink if that information cannot be |
|
607 | this entry should be considered a symlink if that information cannot be | |
608 | extracted from the file system. If unset it should be considered a normal |
|
608 | extracted from the file system. If unset it should be considered a normal | |
609 | file instead. |
|
609 | file instead. | |
610 |
|
610 | |||
611 | `MTIME_SECOND_AMBIGUOUS` |
|
611 | `MTIME_SECOND_AMBIGUOUS` | |
612 | This flag is relevant only when `HAS_FILE_MTIME` is set. When set, the |
|
612 | This flag is relevant only when `HAS_FILE_MTIME` is set. When set, the | |
613 | `mtime` stored in the entry is only valid for comparison with timestamps |
|
613 | `mtime` stored in the entry is only valid for comparison with timestamps | |
614 | that have nanosecond information. If available timestamp does not carries |
|
614 | that have nanosecond information. If available timestamp does not carries | |
615 | nanosecond information, the `mtime` should be ignored and no optimisation |
|
615 | nanosecond information, the `mtime` should be ignored and no optimisation | |
616 | can be applied. |
|
616 | can be applied. |
@@ -1,316 +1,316 b'' | |||||
1 | This test tries to exercise the ssh functionality with a dummy script |
|
1 | This test tries to exercise the ssh functionality with a dummy script | |
2 |
|
2 | |||
3 | $ checknewrepo() |
|
3 | $ checknewrepo() | |
4 | > { |
|
4 | > { | |
5 | > name=$1 |
|
5 | > name=$1 | |
6 | > if [ -d "$name"/.hg/store ]; then |
|
6 | > if [ -d "$name"/.hg/store ]; then | |
7 | > echo store created |
|
7 | > echo store created | |
8 | > fi |
|
8 | > fi | |
9 | > if [ -f "$name"/.hg/00changelog.i ]; then |
|
9 | > if [ -f "$name"/.hg/00changelog.i ]; then | |
10 | > echo 00changelog.i created |
|
10 | > echo 00changelog.i created | |
11 | > fi |
|
11 | > fi | |
12 | > cat "$name"/.hg/requires |
|
12 | > cat "$name"/.hg/requires | |
13 | > } |
|
13 | > } | |
14 |
|
14 | |||
15 | creating 'local' |
|
15 | creating 'local' | |
16 |
|
16 | |||
17 | $ hg init local |
|
17 | $ hg init local | |
18 | $ checknewrepo local |
|
18 | $ checknewrepo local | |
19 | store created |
|
19 | store created | |
20 | 00changelog.i created |
|
20 | 00changelog.i created | |
21 | dotencode |
|
21 | dotencode | |
22 |
|
|
22 | dirstate-v2 (dirstate-v2 !) | |
23 | fncache |
|
23 | fncache | |
24 | generaldelta |
|
24 | generaldelta | |
25 | persistent-nodemap (rust !) |
|
25 | persistent-nodemap (rust !) | |
26 | revlog-compression-zstd (zstd !) |
|
26 | revlog-compression-zstd (zstd !) | |
27 | revlogv1 |
|
27 | revlogv1 | |
28 | sparserevlog |
|
28 | sparserevlog | |
29 | store |
|
29 | store | |
30 | testonly-simplestore (reposimplestore !) |
|
30 | testonly-simplestore (reposimplestore !) | |
31 | $ echo this > local/foo |
|
31 | $ echo this > local/foo | |
32 | $ hg ci --cwd local -A -m "init" |
|
32 | $ hg ci --cwd local -A -m "init" | |
33 | adding foo |
|
33 | adding foo | |
34 |
|
34 | |||
35 | test custom revlog chunk cache sizes |
|
35 | test custom revlog chunk cache sizes | |
36 |
|
36 | |||
37 | $ hg --config format.chunkcachesize=0 log -R local -pv |
|
37 | $ hg --config format.chunkcachesize=0 log -R local -pv | |
38 | abort: revlog chunk cache size 0 is not greater than 0 |
|
38 | abort: revlog chunk cache size 0 is not greater than 0 | |
39 | [50] |
|
39 | [50] | |
40 | $ hg --config format.chunkcachesize=1023 log -R local -pv |
|
40 | $ hg --config format.chunkcachesize=1023 log -R local -pv | |
41 | abort: revlog chunk cache size 1023 is not a power of 2 |
|
41 | abort: revlog chunk cache size 1023 is not a power of 2 | |
42 | [50] |
|
42 | [50] | |
43 | $ hg --config format.chunkcachesize=1024 log -R local -pv |
|
43 | $ hg --config format.chunkcachesize=1024 log -R local -pv | |
44 | changeset: 0:08b9e9f63b32 |
|
44 | changeset: 0:08b9e9f63b32 | |
45 | tag: tip |
|
45 | tag: tip | |
46 | user: test |
|
46 | user: test | |
47 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
47 | date: Thu Jan 01 00:00:00 1970 +0000 | |
48 | files: foo |
|
48 | files: foo | |
49 | description: |
|
49 | description: | |
50 | init |
|
50 | init | |
51 |
|
51 | |||
52 |
|
52 | |||
53 | diff -r 000000000000 -r 08b9e9f63b32 foo |
|
53 | diff -r 000000000000 -r 08b9e9f63b32 foo | |
54 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
54 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
55 | +++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
|
55 | +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |
56 | @@ -0,0 +1,1 @@ |
|
56 | @@ -0,0 +1,1 @@ | |
57 | +this |
|
57 | +this | |
58 |
|
58 | |||
59 |
|
59 | |||
60 | creating repo with format.usestore=false |
|
60 | creating repo with format.usestore=false | |
61 |
|
61 | |||
62 | $ hg --config format.usestore=false init old |
|
62 | $ hg --config format.usestore=false init old | |
63 | $ checknewrepo old |
|
63 | $ checknewrepo old | |
64 |
|
|
64 | dirstate-v2 (dirstate-v2 !) | |
65 | generaldelta |
|
65 | generaldelta | |
66 | persistent-nodemap (rust !) |
|
66 | persistent-nodemap (rust !) | |
67 | revlog-compression-zstd (zstd !) |
|
67 | revlog-compression-zstd (zstd !) | |
68 | revlogv1 |
|
68 | revlogv1 | |
69 | testonly-simplestore (reposimplestore !) |
|
69 | testonly-simplestore (reposimplestore !) | |
70 | sparserevlog |
|
70 | sparserevlog | |
71 |
|
71 | |||
72 | creating repo with format.usefncache=false |
|
72 | creating repo with format.usefncache=false | |
73 |
|
73 | |||
74 | $ hg --config format.usefncache=false init old2 |
|
74 | $ hg --config format.usefncache=false init old2 | |
75 | $ checknewrepo old2 |
|
75 | $ checknewrepo old2 | |
76 | store created |
|
76 | store created | |
77 | 00changelog.i created |
|
77 | 00changelog.i created | |
78 |
|
|
78 | dirstate-v2 (dirstate-v2 !) | |
79 | generaldelta |
|
79 | generaldelta | |
80 | persistent-nodemap (rust !) |
|
80 | persistent-nodemap (rust !) | |
81 | revlog-compression-zstd (zstd !) |
|
81 | revlog-compression-zstd (zstd !) | |
82 | revlogv1 |
|
82 | revlogv1 | |
83 | sparserevlog |
|
83 | sparserevlog | |
84 | store |
|
84 | store | |
85 | testonly-simplestore (reposimplestore !) |
|
85 | testonly-simplestore (reposimplestore !) | |
86 |
|
86 | |||
87 | creating repo with format.dotencode=false |
|
87 | creating repo with format.dotencode=false | |
88 |
|
88 | |||
89 | $ hg --config format.dotencode=false init old3 |
|
89 | $ hg --config format.dotencode=false init old3 | |
90 | $ checknewrepo old3 |
|
90 | $ checknewrepo old3 | |
91 | store created |
|
91 | store created | |
92 | 00changelog.i created |
|
92 | 00changelog.i created | |
93 |
|
|
93 | dirstate-v2 (dirstate-v2 !) | |
94 | fncache |
|
94 | fncache | |
95 | generaldelta |
|
95 | generaldelta | |
96 | persistent-nodemap (rust !) |
|
96 | persistent-nodemap (rust !) | |
97 | revlog-compression-zstd (zstd !) |
|
97 | revlog-compression-zstd (zstd !) | |
98 | revlogv1 |
|
98 | revlogv1 | |
99 | sparserevlog |
|
99 | sparserevlog | |
100 | store |
|
100 | store | |
101 | testonly-simplestore (reposimplestore !) |
|
101 | testonly-simplestore (reposimplestore !) | |
102 |
|
102 | |||
103 | creating repo with format.dotencode=false |
|
103 | creating repo with format.dotencode=false | |
104 |
|
104 | |||
105 | $ hg --config format.generaldelta=false --config format.usegeneraldelta=false --config format.sparse-revlog=no init old4 |
|
105 | $ hg --config format.generaldelta=false --config format.usegeneraldelta=false --config format.sparse-revlog=no init old4 | |
106 | $ checknewrepo old4 |
|
106 | $ checknewrepo old4 | |
107 | store created |
|
107 | store created | |
108 | 00changelog.i created |
|
108 | 00changelog.i created | |
109 | dotencode |
|
109 | dotencode | |
110 |
|
|
110 | dirstate-v2 (dirstate-v2 !) | |
111 | fncache |
|
111 | fncache | |
112 | persistent-nodemap (rust !) |
|
112 | persistent-nodemap (rust !) | |
113 | revlog-compression-zstd (zstd !) |
|
113 | revlog-compression-zstd (zstd !) | |
114 | revlogv1 |
|
114 | revlogv1 | |
115 | store |
|
115 | store | |
116 | testonly-simplestore (reposimplestore !) |
|
116 | testonly-simplestore (reposimplestore !) | |
117 |
|
117 | |||
118 | test failure |
|
118 | test failure | |
119 |
|
119 | |||
120 | $ hg init local |
|
120 | $ hg init local | |
121 | abort: repository local already exists |
|
121 | abort: repository local already exists | |
122 | [255] |
|
122 | [255] | |
123 |
|
123 | |||
124 | init+push to remote2 |
|
124 | init+push to remote2 | |
125 |
|
125 | |||
126 | $ hg init ssh://user@dummy/remote2 |
|
126 | $ hg init ssh://user@dummy/remote2 | |
127 | $ hg incoming -R remote2 local |
|
127 | $ hg incoming -R remote2 local | |
128 | comparing with local |
|
128 | comparing with local | |
129 | changeset: 0:08b9e9f63b32 |
|
129 | changeset: 0:08b9e9f63b32 | |
130 | tag: tip |
|
130 | tag: tip | |
131 | user: test |
|
131 | user: test | |
132 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
132 | date: Thu Jan 01 00:00:00 1970 +0000 | |
133 | summary: init |
|
133 | summary: init | |
134 |
|
134 | |||
135 |
|
135 | |||
136 | $ hg push -R local ssh://user@dummy/remote2 |
|
136 | $ hg push -R local ssh://user@dummy/remote2 | |
137 | pushing to ssh://user@dummy/remote2 |
|
137 | pushing to ssh://user@dummy/remote2 | |
138 | searching for changes |
|
138 | searching for changes | |
139 | remote: adding changesets |
|
139 | remote: adding changesets | |
140 | remote: adding manifests |
|
140 | remote: adding manifests | |
141 | remote: adding file changes |
|
141 | remote: adding file changes | |
142 | remote: added 1 changesets with 1 changes to 1 files |
|
142 | remote: added 1 changesets with 1 changes to 1 files | |
143 |
|
143 | |||
144 | clone to remote1 |
|
144 | clone to remote1 | |
145 |
|
145 | |||
146 | $ hg clone local ssh://user@dummy/remote1 |
|
146 | $ hg clone local ssh://user@dummy/remote1 | |
147 | searching for changes |
|
147 | searching for changes | |
148 | remote: adding changesets |
|
148 | remote: adding changesets | |
149 | remote: adding manifests |
|
149 | remote: adding manifests | |
150 | remote: adding file changes |
|
150 | remote: adding file changes | |
151 | remote: added 1 changesets with 1 changes to 1 files |
|
151 | remote: added 1 changesets with 1 changes to 1 files | |
152 |
|
152 | |||
153 | The largefiles extension doesn't crash |
|
153 | The largefiles extension doesn't crash | |
154 | $ hg clone local ssh://user@dummy/remotelf --config extensions.largefiles= |
|
154 | $ hg clone local ssh://user@dummy/remotelf --config extensions.largefiles= | |
155 | The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) |
|
155 | The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) | |
156 | The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) |
|
156 | The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) | |
157 | searching for changes |
|
157 | searching for changes | |
158 | remote: adding changesets |
|
158 | remote: adding changesets | |
159 | remote: adding manifests |
|
159 | remote: adding manifests | |
160 | remote: adding file changes |
|
160 | remote: adding file changes | |
161 | remote: added 1 changesets with 1 changes to 1 files |
|
161 | remote: added 1 changesets with 1 changes to 1 files | |
162 |
|
162 | |||
163 | init to existing repo |
|
163 | init to existing repo | |
164 |
|
164 | |||
165 | $ hg init ssh://user@dummy/remote1 |
|
165 | $ hg init ssh://user@dummy/remote1 | |
166 | abort: repository remote1 already exists |
|
166 | abort: repository remote1 already exists | |
167 | abort: could not create remote repo |
|
167 | abort: could not create remote repo | |
168 | [255] |
|
168 | [255] | |
169 |
|
169 | |||
170 | clone to existing repo |
|
170 | clone to existing repo | |
171 |
|
171 | |||
172 | $ hg clone local ssh://user@dummy/remote1 |
|
172 | $ hg clone local ssh://user@dummy/remote1 | |
173 | abort: repository remote1 already exists |
|
173 | abort: repository remote1 already exists | |
174 | abort: could not create remote repo |
|
174 | abort: could not create remote repo | |
175 | [255] |
|
175 | [255] | |
176 |
|
176 | |||
177 | output of dummyssh |
|
177 | output of dummyssh | |
178 |
|
178 | |||
179 | $ cat dummylog |
|
179 | $ cat dummylog | |
180 | Got arguments 1:user@dummy 2:hg init remote2 |
|
180 | Got arguments 1:user@dummy 2:hg init remote2 | |
181 | Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio |
|
181 | Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio | |
182 | Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio |
|
182 | Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio | |
183 | Got arguments 1:user@dummy 2:hg init remote1 |
|
183 | Got arguments 1:user@dummy 2:hg init remote1 | |
184 | Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio |
|
184 | Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio | |
185 | Got arguments 1:user@dummy 2:hg init remotelf |
|
185 | Got arguments 1:user@dummy 2:hg init remotelf | |
186 | Got arguments 1:user@dummy 2:hg -R remotelf serve --stdio |
|
186 | Got arguments 1:user@dummy 2:hg -R remotelf serve --stdio | |
187 | Got arguments 1:user@dummy 2:hg init remote1 |
|
187 | Got arguments 1:user@dummy 2:hg init remote1 | |
188 | Got arguments 1:user@dummy 2:hg init remote1 |
|
188 | Got arguments 1:user@dummy 2:hg init remote1 | |
189 |
|
189 | |||
190 | comparing repositories |
|
190 | comparing repositories | |
191 |
|
191 | |||
192 | $ hg tip -q -R local |
|
192 | $ hg tip -q -R local | |
193 | 0:08b9e9f63b32 |
|
193 | 0:08b9e9f63b32 | |
194 | $ hg tip -q -R remote1 |
|
194 | $ hg tip -q -R remote1 | |
195 | 0:08b9e9f63b32 |
|
195 | 0:08b9e9f63b32 | |
196 | $ hg tip -q -R remote2 |
|
196 | $ hg tip -q -R remote2 | |
197 | 0:08b9e9f63b32 |
|
197 | 0:08b9e9f63b32 | |
198 |
|
198 | |||
199 | check names for repositories (clashes with URL schemes, special chars) |
|
199 | check names for repositories (clashes with URL schemes, special chars) | |
200 |
|
200 | |||
201 | $ for i in bundle file hg http https old-http ssh static-http "with space"; do |
|
201 | $ for i in bundle file hg http https old-http ssh static-http "with space"; do | |
202 | > printf "hg init \"$i\"... " |
|
202 | > printf "hg init \"$i\"... " | |
203 | > hg init "$i" |
|
203 | > hg init "$i" | |
204 | > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed" |
|
204 | > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed" | |
205 | > done |
|
205 | > done | |
206 | hg init "bundle"... ok |
|
206 | hg init "bundle"... ok | |
207 | hg init "file"... ok |
|
207 | hg init "file"... ok | |
208 | hg init "hg"... ok |
|
208 | hg init "hg"... ok | |
209 | hg init "http"... ok |
|
209 | hg init "http"... ok | |
210 | hg init "https"... ok |
|
210 | hg init "https"... ok | |
211 | hg init "old-http"... ok |
|
211 | hg init "old-http"... ok | |
212 | hg init "ssh"... ok |
|
212 | hg init "ssh"... ok | |
213 | hg init "static-http"... ok |
|
213 | hg init "static-http"... ok | |
214 | hg init "with space"... ok |
|
214 | hg init "with space"... ok | |
215 | #if eol-in-paths |
|
215 | #if eol-in-paths | |
216 | /* " " is not a valid name for a directory on Windows */ |
|
216 | /* " " is not a valid name for a directory on Windows */ | |
217 | $ hg init " " |
|
217 | $ hg init " " | |
218 | $ test -d " " |
|
218 | $ test -d " " | |
219 | $ test -d " /.hg" |
|
219 | $ test -d " /.hg" | |
220 | #endif |
|
220 | #endif | |
221 |
|
221 | |||
222 | creating 'local/sub/repo' |
|
222 | creating 'local/sub/repo' | |
223 |
|
223 | |||
224 | $ hg init local/sub/repo |
|
224 | $ hg init local/sub/repo | |
225 | $ checknewrepo local/sub/repo |
|
225 | $ checknewrepo local/sub/repo | |
226 | store created |
|
226 | store created | |
227 | 00changelog.i created |
|
227 | 00changelog.i created | |
228 | dotencode |
|
228 | dotencode | |
229 |
|
|
229 | dirstate-v2 (dirstate-v2 !) | |
230 | fncache |
|
230 | fncache | |
231 | generaldelta |
|
231 | generaldelta | |
232 | persistent-nodemap (rust !) |
|
232 | persistent-nodemap (rust !) | |
233 | revlog-compression-zstd (zstd !) |
|
233 | revlog-compression-zstd (zstd !) | |
234 | revlogv1 |
|
234 | revlogv1 | |
235 | sparserevlog |
|
235 | sparserevlog | |
236 | store |
|
236 | store | |
237 | testonly-simplestore (reposimplestore !) |
|
237 | testonly-simplestore (reposimplestore !) | |
238 |
|
238 | |||
239 | prepare test of init of url configured from paths |
|
239 | prepare test of init of url configured from paths | |
240 |
|
240 | |||
241 | $ echo '[paths]' >> $HGRCPATH |
|
241 | $ echo '[paths]' >> $HGRCPATH | |
242 | $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH |
|
242 | $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH | |
243 | $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH |
|
243 | $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH | |
244 |
|
244 | |||
245 | init should (for consistency with clone) expand the url |
|
245 | init should (for consistency with clone) expand the url | |
246 |
|
246 | |||
247 | $ hg init somewhere |
|
247 | $ hg init somewhere | |
248 | $ checknewrepo "url from paths" |
|
248 | $ checknewrepo "url from paths" | |
249 | store created |
|
249 | store created | |
250 | 00changelog.i created |
|
250 | 00changelog.i created | |
251 | dotencode |
|
251 | dotencode | |
252 |
|
|
252 | dirstate-v2 (dirstate-v2 !) | |
253 | fncache |
|
253 | fncache | |
254 | generaldelta |
|
254 | generaldelta | |
255 | persistent-nodemap (rust !) |
|
255 | persistent-nodemap (rust !) | |
256 | revlog-compression-zstd (zstd !) |
|
256 | revlog-compression-zstd (zstd !) | |
257 | revlogv1 |
|
257 | revlogv1 | |
258 | sparserevlog |
|
258 | sparserevlog | |
259 | store |
|
259 | store | |
260 | testonly-simplestore (reposimplestore !) |
|
260 | testonly-simplestore (reposimplestore !) | |
261 |
|
261 | |||
262 | verify that clone also expand urls |
|
262 | verify that clone also expand urls | |
263 |
|
263 | |||
264 | $ hg clone somewhere elsewhere |
|
264 | $ hg clone somewhere elsewhere | |
265 | updating to branch default |
|
265 | updating to branch default | |
266 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
266 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
267 | $ checknewrepo "another paths url" |
|
267 | $ checknewrepo "another paths url" | |
268 | store created |
|
268 | store created | |
269 | 00changelog.i created |
|
269 | 00changelog.i created | |
270 | dotencode |
|
270 | dotencode | |
271 |
|
|
271 | dirstate-v2 (dirstate-v2 !) | |
272 | fncache |
|
272 | fncache | |
273 | generaldelta |
|
273 | generaldelta | |
274 | persistent-nodemap (rust !) |
|
274 | persistent-nodemap (rust !) | |
275 | revlog-compression-zstd (zstd !) |
|
275 | revlog-compression-zstd (zstd !) | |
276 | revlogv1 |
|
276 | revlogv1 | |
277 | sparserevlog |
|
277 | sparserevlog | |
278 | store |
|
278 | store | |
279 | testonly-simplestore (reposimplestore !) |
|
279 | testonly-simplestore (reposimplestore !) | |
280 |
|
280 | |||
281 | clone bookmarks |
|
281 | clone bookmarks | |
282 |
|
282 | |||
283 | $ hg -R local bookmark test |
|
283 | $ hg -R local bookmark test | |
284 | $ hg -R local bookmarks |
|
284 | $ hg -R local bookmarks | |
285 | * test 0:08b9e9f63b32 |
|
285 | * test 0:08b9e9f63b32 | |
286 | $ hg clone local ssh://user@dummy/remote-bookmarks |
|
286 | $ hg clone local ssh://user@dummy/remote-bookmarks | |
287 | searching for changes |
|
287 | searching for changes | |
288 | remote: adding changesets |
|
288 | remote: adding changesets | |
289 | remote: adding manifests |
|
289 | remote: adding manifests | |
290 | remote: adding file changes |
|
290 | remote: adding file changes | |
291 | remote: added 1 changesets with 1 changes to 1 files |
|
291 | remote: added 1 changesets with 1 changes to 1 files | |
292 | exporting bookmark test |
|
292 | exporting bookmark test | |
293 | $ hg -R remote-bookmarks bookmarks |
|
293 | $ hg -R remote-bookmarks bookmarks | |
294 | test 0:08b9e9f63b32 |
|
294 | test 0:08b9e9f63b32 | |
295 |
|
295 | |||
296 | Check format constraint |
|
296 | Check format constraint | |
297 | ----------------------- |
|
297 | ----------------------- | |
298 |
|
298 | |||
299 | $ hg init issue6056 --config format.usegeneraldelta=0 --config format.sparse-revlog=0 |
|
299 | $ hg init issue6056 --config format.usegeneraldelta=0 --config format.sparse-revlog=0 | |
300 | $ cd issue6056 |
|
300 | $ cd issue6056 | |
301 | $ echo foo > 1 |
|
301 | $ echo foo > 1 | |
302 | $ echo foo > 2 |
|
302 | $ echo foo > 2 | |
303 | $ echo foo > 3 |
|
303 | $ echo foo > 3 | |
304 | $ echo foo > 4 |
|
304 | $ echo foo > 4 | |
305 | $ echo foo > 5 |
|
305 | $ echo foo > 5 | |
306 | $ hg add * |
|
306 | $ hg add * | |
307 |
|
307 | |||
308 | Build a bogus repository (sparserevlog without general delta) |
|
308 | Build a bogus repository (sparserevlog without general delta) | |
309 |
|
309 | |||
310 | $ hg commit -m 'initial changesets' |
|
310 | $ hg commit -m 'initial changesets' | |
311 | $ echo 'sparserevlog' >> .hg/requires |
|
311 | $ echo 'sparserevlog' >> .hg/requires | |
312 | $ for x in `$TESTDIR/seq.py 100`; do |
|
312 | $ for x in `$TESTDIR/seq.py 100`; do | |
313 | > echo $x >> `expr $x % 5 + 1` |
|
313 | > echo $x >> `expr $x % 5 + 1` | |
314 | > hg commit -m $x |
|
314 | > hg commit -m $x | |
315 | > done |
|
315 | > done | |
316 | $ cd .. |
|
316 | $ cd .. |
@@ -1,411 +1,411 b'' | |||||
1 | $ USERCACHE="$TESTTMP/cache"; export USERCACHE |
|
1 | $ USERCACHE="$TESTTMP/cache"; export USERCACHE | |
2 | $ mkdir "${USERCACHE}" |
|
2 | $ mkdir "${USERCACHE}" | |
3 | $ cat >> $HGRCPATH <<EOF |
|
3 | $ cat >> $HGRCPATH <<EOF | |
4 | > [extensions] |
|
4 | > [extensions] | |
5 | > largefiles = |
|
5 | > largefiles = | |
6 | > share = |
|
6 | > share = | |
7 | > strip = |
|
7 | > strip = | |
8 | > convert = |
|
8 | > convert = | |
9 | > [largefiles] |
|
9 | > [largefiles] | |
10 | > minsize = 0.5 |
|
10 | > minsize = 0.5 | |
11 | > patterns = **.other |
|
11 | > patterns = **.other | |
12 | > **.dat |
|
12 | > **.dat | |
13 | > usercache=${USERCACHE} |
|
13 | > usercache=${USERCACHE} | |
14 | > EOF |
|
14 | > EOF | |
15 |
|
15 | |||
16 | "lfconvert" works |
|
16 | "lfconvert" works | |
17 | $ hg init bigfile-repo |
|
17 | $ hg init bigfile-repo | |
18 | $ cd bigfile-repo |
|
18 | $ cd bigfile-repo | |
19 | $ cat >> .hg/hgrc <<EOF |
|
19 | $ cat >> .hg/hgrc <<EOF | |
20 | > [extensions] |
|
20 | > [extensions] | |
21 | > largefiles = ! |
|
21 | > largefiles = ! | |
22 | > EOF |
|
22 | > EOF | |
23 | $ mkdir sub |
|
23 | $ mkdir sub | |
24 | $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null |
|
24 | $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null | |
25 | $ dd if=/dev/zero bs=1k count=256 > large2 2> /dev/null |
|
25 | $ dd if=/dev/zero bs=1k count=256 > large2 2> /dev/null | |
26 | $ echo normal > normal1 |
|
26 | $ echo normal > normal1 | |
27 | $ echo alsonormal > sub/normal2 |
|
27 | $ echo alsonormal > sub/normal2 | |
28 | $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null |
|
28 | $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null | |
29 | $ hg addremove |
|
29 | $ hg addremove | |
30 | adding large |
|
30 | adding large | |
31 | adding large2 |
|
31 | adding large2 | |
32 | adding normal1 |
|
32 | adding normal1 | |
33 | adding sub/maybelarge.dat |
|
33 | adding sub/maybelarge.dat | |
34 | adding sub/normal2 |
|
34 | adding sub/normal2 | |
35 | $ hg commit -m"add large, normal1" large normal1 |
|
35 | $ hg commit -m"add large, normal1" large normal1 | |
36 | $ hg commit -m"add sub/*" sub |
|
36 | $ hg commit -m"add sub/*" sub | |
37 |
|
37 | |||
38 | Test tag parsing |
|
38 | Test tag parsing | |
39 | $ cat >> .hgtags <<EOF |
|
39 | $ cat >> .hgtags <<EOF | |
40 | > IncorrectlyFormattedTag! |
|
40 | > IncorrectlyFormattedTag! | |
41 | > invalidhash sometag |
|
41 | > invalidhash sometag | |
42 | > 0123456789abcdef anothertag |
|
42 | > 0123456789abcdef anothertag | |
43 | > EOF |
|
43 | > EOF | |
44 | $ hg add .hgtags |
|
44 | $ hg add .hgtags | |
45 | $ hg commit -m"add large2" large2 .hgtags |
|
45 | $ hg commit -m"add large2" large2 .hgtags | |
46 |
|
46 | |||
47 | Test link+rename largefile codepath |
|
47 | Test link+rename largefile codepath | |
48 | $ [ -d .hg/largefiles ] && echo fail || echo pass |
|
48 | $ [ -d .hg/largefiles ] && echo fail || echo pass | |
49 | pass |
|
49 | pass | |
50 | $ cd .. |
|
50 | $ cd .. | |
51 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo |
|
51 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo | |
52 | initializing destination largefiles-repo |
|
52 | initializing destination largefiles-repo | |
53 | skipping incorrectly formatted tag IncorrectlyFormattedTag! |
|
53 | skipping incorrectly formatted tag IncorrectlyFormattedTag! | |
54 | skipping incorrectly formatted id invalidhash |
|
54 | skipping incorrectly formatted id invalidhash | |
55 | no mapping for id 0123456789abcdef |
|
55 | no mapping for id 0123456789abcdef | |
56 | #if symlink |
|
56 | #if symlink | |
57 | $ hg --cwd bigfile-repo rename large2 large3 |
|
57 | $ hg --cwd bigfile-repo rename large2 large3 | |
58 | $ ln -sf large bigfile-repo/large3 |
|
58 | $ ln -sf large bigfile-repo/large3 | |
59 | $ hg --cwd bigfile-repo commit -m"make large2 a symlink" large2 large3 |
|
59 | $ hg --cwd bigfile-repo commit -m"make large2 a symlink" large2 large3 | |
60 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo-symlink |
|
60 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo-symlink | |
61 | initializing destination largefiles-repo-symlink |
|
61 | initializing destination largefiles-repo-symlink | |
62 | skipping incorrectly formatted tag IncorrectlyFormattedTag! |
|
62 | skipping incorrectly formatted tag IncorrectlyFormattedTag! | |
63 | skipping incorrectly formatted id invalidhash |
|
63 | skipping incorrectly formatted id invalidhash | |
64 | no mapping for id 0123456789abcdef |
|
64 | no mapping for id 0123456789abcdef | |
65 | abort: renamed/copied largefile large3 becomes symlink |
|
65 | abort: renamed/copied largefile large3 becomes symlink | |
66 | [255] |
|
66 | [255] | |
67 | #endif |
|
67 | #endif | |
68 | $ cd bigfile-repo |
|
68 | $ cd bigfile-repo | |
69 | $ hg strip --no-backup 2 |
|
69 | $ hg strip --no-backup 2 | |
70 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
70 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
71 | $ cd .. |
|
71 | $ cd .. | |
72 | $ rm -rf largefiles-repo largefiles-repo-symlink |
|
72 | $ rm -rf largefiles-repo largefiles-repo-symlink | |
73 |
|
73 | |||
74 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo |
|
74 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo | |
75 | initializing destination largefiles-repo |
|
75 | initializing destination largefiles-repo | |
76 |
|
76 | |||
77 | "lfconvert" converts content correctly |
|
77 | "lfconvert" converts content correctly | |
78 | $ cd largefiles-repo |
|
78 | $ cd largefiles-repo | |
79 | $ hg up |
|
79 | $ hg up | |
80 | getting changed largefiles |
|
80 | getting changed largefiles | |
81 | 2 largefiles updated, 0 removed |
|
81 | 2 largefiles updated, 0 removed | |
82 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
82 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
83 | $ hg locate |
|
83 | $ hg locate | |
84 | .hglf/large |
|
84 | .hglf/large | |
85 | .hglf/sub/maybelarge.dat |
|
85 | .hglf/sub/maybelarge.dat | |
86 | normal1 |
|
86 | normal1 | |
87 | sub/normal2 |
|
87 | sub/normal2 | |
88 | $ cat normal1 |
|
88 | $ cat normal1 | |
89 | normal |
|
89 | normal | |
90 | $ cat sub/normal2 |
|
90 | $ cat sub/normal2 | |
91 | alsonormal |
|
91 | alsonormal | |
92 | $ md5sum.py large sub/maybelarge.dat |
|
92 | $ md5sum.py large sub/maybelarge.dat | |
93 | ec87a838931d4d5d2e94a04644788a55 large |
|
93 | ec87a838931d4d5d2e94a04644788a55 large | |
94 | 1276481102f218c981e0324180bafd9f sub/maybelarge.dat |
|
94 | 1276481102f218c981e0324180bafd9f sub/maybelarge.dat | |
95 |
|
95 | |||
96 | "lfconvert" adds 'largefiles' to .hg/requires. |
|
96 | "lfconvert" adds 'largefiles' to .hg/requires. | |
97 | $ cat .hg/requires |
|
97 | $ cat .hg/requires | |
98 | dotencode |
|
98 | dotencode | |
99 |
|
|
99 | dirstate-v2 (dirstate-v2 !) | |
100 | fncache |
|
100 | fncache | |
101 | generaldelta |
|
101 | generaldelta | |
102 | largefiles |
|
102 | largefiles | |
103 | persistent-nodemap (rust !) |
|
103 | persistent-nodemap (rust !) | |
104 | revlog-compression-zstd (zstd !) |
|
104 | revlog-compression-zstd (zstd !) | |
105 | revlogv1 |
|
105 | revlogv1 | |
106 | sparserevlog |
|
106 | sparserevlog | |
107 | store |
|
107 | store | |
108 | testonly-simplestore (reposimplestore !) |
|
108 | testonly-simplestore (reposimplestore !) | |
109 |
|
109 | |||
110 | "lfconvert" includes a newline at the end of the standin files. |
|
110 | "lfconvert" includes a newline at the end of the standin files. | |
111 | $ cat .hglf/large .hglf/sub/maybelarge.dat |
|
111 | $ cat .hglf/large .hglf/sub/maybelarge.dat | |
112 | 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 |
|
112 | 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 | |
113 | 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c |
|
113 | 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c | |
114 | $ cd .. |
|
114 | $ cd .. | |
115 |
|
115 | |||
116 | add some changesets to rename/remove/merge |
|
116 | add some changesets to rename/remove/merge | |
117 | $ cd bigfile-repo |
|
117 | $ cd bigfile-repo | |
118 | $ hg mv -q sub stuff |
|
118 | $ hg mv -q sub stuff | |
119 | $ hg commit -m"rename sub/ to stuff/" |
|
119 | $ hg commit -m"rename sub/ to stuff/" | |
120 | $ hg update -q 1 |
|
120 | $ hg update -q 1 | |
121 | $ echo blah >> normal3 |
|
121 | $ echo blah >> normal3 | |
122 | $ echo blah >> sub/normal2 |
|
122 | $ echo blah >> sub/normal2 | |
123 | $ echo blah >> sub/maybelarge.dat |
|
123 | $ echo blah >> sub/maybelarge.dat | |
124 | $ md5sum.py sub/maybelarge.dat |
|
124 | $ md5sum.py sub/maybelarge.dat | |
125 | 1dd0b99ff80e19cff409702a1d3f5e15 sub/maybelarge.dat |
|
125 | 1dd0b99ff80e19cff409702a1d3f5e15 sub/maybelarge.dat | |
126 | $ hg commit -A -m"add normal3, modify sub/*" |
|
126 | $ hg commit -A -m"add normal3, modify sub/*" | |
127 | adding normal3 |
|
127 | adding normal3 | |
128 | created new head |
|
128 | created new head | |
129 | $ hg rm large normal3 |
|
129 | $ hg rm large normal3 | |
130 | $ hg commit -q -m"remove large, normal3" |
|
130 | $ hg commit -q -m"remove large, normal3" | |
131 | $ hg merge |
|
131 | $ hg merge | |
132 | tool internal:merge (for pattern stuff/maybelarge.dat) can't handle binary |
|
132 | tool internal:merge (for pattern stuff/maybelarge.dat) can't handle binary | |
133 | no tool found to merge stuff/maybelarge.dat |
|
133 | no tool found to merge stuff/maybelarge.dat | |
134 | file 'stuff/maybelarge.dat' needs to be resolved. |
|
134 | file 'stuff/maybelarge.dat' needs to be resolved. | |
135 | You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. |
|
135 | You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | |
136 | What do you want to do? u |
|
136 | What do you want to do? u | |
137 | merging sub/normal2 and stuff/normal2 to stuff/normal2 |
|
137 | merging sub/normal2 and stuff/normal2 to stuff/normal2 | |
138 | 0 files updated, 1 files merged, 0 files removed, 1 files unresolved |
|
138 | 0 files updated, 1 files merged, 0 files removed, 1 files unresolved | |
139 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
139 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | |
140 | [1] |
|
140 | [1] | |
141 | $ hg cat -r . sub/maybelarge.dat > stuff/maybelarge.dat |
|
141 | $ hg cat -r . sub/maybelarge.dat > stuff/maybelarge.dat | |
142 | $ hg resolve -m stuff/maybelarge.dat |
|
142 | $ hg resolve -m stuff/maybelarge.dat | |
143 | (no more unresolved files) |
|
143 | (no more unresolved files) | |
144 | $ hg commit -m"merge" |
|
144 | $ hg commit -m"merge" | |
145 | $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n" |
|
145 | $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n" | |
146 | @ 5:4884f215abda merge |
|
146 | @ 5:4884f215abda merge | |
147 | |\ |
|
147 | |\ | |
148 | | o 4:7285f817b77e remove large, normal3 |
|
148 | | o 4:7285f817b77e remove large, normal3 | |
149 | | | |
|
149 | | | | |
150 | | o 3:67e3892e3534 add normal3, modify sub/* |
|
150 | | o 3:67e3892e3534 add normal3, modify sub/* | |
151 | | | |
|
151 | | | | |
152 | o | 2:c96c8beb5d56 rename sub/ to stuff/ |
|
152 | o | 2:c96c8beb5d56 rename sub/ to stuff/ | |
153 | |/ |
|
153 | |/ | |
154 | o 1:020c65d24e11 add sub/* |
|
154 | o 1:020c65d24e11 add sub/* | |
155 | | |
|
155 | | | |
156 | o 0:117b8328f97a add large, normal1 |
|
156 | o 0:117b8328f97a add large, normal1 | |
157 |
|
157 | |||
158 | $ cd .. |
|
158 | $ cd .. | |
159 |
|
159 | |||
160 | lfconvert with rename, merge, and remove |
|
160 | lfconvert with rename, merge, and remove | |
161 | $ rm -rf largefiles-repo |
|
161 | $ rm -rf largefiles-repo | |
162 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo |
|
162 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo | |
163 | initializing destination largefiles-repo |
|
163 | initializing destination largefiles-repo | |
164 | $ cd largefiles-repo |
|
164 | $ cd largefiles-repo | |
165 | $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n" |
|
165 | $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n" | |
166 | o 5:9cc5aa7204f0 merge |
|
166 | o 5:9cc5aa7204f0 merge | |
167 | |\ |
|
167 | |\ | |
168 | | o 4:a5a02de7a8e4 remove large, normal3 |
|
168 | | o 4:a5a02de7a8e4 remove large, normal3 | |
169 | | | |
|
169 | | | | |
170 | | o 3:55759520c76f add normal3, modify sub/* |
|
170 | | o 3:55759520c76f add normal3, modify sub/* | |
171 | | | |
|
171 | | | | |
172 | o | 2:261ad3f3f037 rename sub/ to stuff/ |
|
172 | o | 2:261ad3f3f037 rename sub/ to stuff/ | |
173 | |/ |
|
173 | |/ | |
174 | o 1:334e5237836d add sub/* |
|
174 | o 1:334e5237836d add sub/* | |
175 | | |
|
175 | | | |
176 | o 0:d4892ec57ce2 add large, normal1 |
|
176 | o 0:d4892ec57ce2 add large, normal1 | |
177 |
|
177 | |||
178 | $ hg locate -r 2 |
|
178 | $ hg locate -r 2 | |
179 | .hglf/large |
|
179 | .hglf/large | |
180 | .hglf/stuff/maybelarge.dat |
|
180 | .hglf/stuff/maybelarge.dat | |
181 | normal1 |
|
181 | normal1 | |
182 | stuff/normal2 |
|
182 | stuff/normal2 | |
183 | $ hg locate -r 3 |
|
183 | $ hg locate -r 3 | |
184 | .hglf/large |
|
184 | .hglf/large | |
185 | .hglf/sub/maybelarge.dat |
|
185 | .hglf/sub/maybelarge.dat | |
186 | normal1 |
|
186 | normal1 | |
187 | normal3 |
|
187 | normal3 | |
188 | sub/normal2 |
|
188 | sub/normal2 | |
189 | $ hg locate -r 4 |
|
189 | $ hg locate -r 4 | |
190 | .hglf/sub/maybelarge.dat |
|
190 | .hglf/sub/maybelarge.dat | |
191 | normal1 |
|
191 | normal1 | |
192 | sub/normal2 |
|
192 | sub/normal2 | |
193 | $ hg locate -r 5 |
|
193 | $ hg locate -r 5 | |
194 | .hglf/stuff/maybelarge.dat |
|
194 | .hglf/stuff/maybelarge.dat | |
195 | normal1 |
|
195 | normal1 | |
196 | stuff/normal2 |
|
196 | stuff/normal2 | |
197 | $ hg update |
|
197 | $ hg update | |
198 | getting changed largefiles |
|
198 | getting changed largefiles | |
199 | 1 largefiles updated, 0 removed |
|
199 | 1 largefiles updated, 0 removed | |
200 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
200 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
201 | $ cat stuff/normal2 |
|
201 | $ cat stuff/normal2 | |
202 | alsonormal |
|
202 | alsonormal | |
203 | blah |
|
203 | blah | |
204 | $ md5sum.py stuff/maybelarge.dat |
|
204 | $ md5sum.py stuff/maybelarge.dat | |
205 | 1dd0b99ff80e19cff409702a1d3f5e15 stuff/maybelarge.dat |
|
205 | 1dd0b99ff80e19cff409702a1d3f5e15 stuff/maybelarge.dat | |
206 | $ cat .hglf/stuff/maybelarge.dat |
|
206 | $ cat .hglf/stuff/maybelarge.dat | |
207 | 76236b6a2c6102826c61af4297dd738fb3b1de38 |
|
207 | 76236b6a2c6102826c61af4297dd738fb3b1de38 | |
208 | $ cd .. |
|
208 | $ cd .. | |
209 |
|
209 | |||
210 | "lfconvert" error cases |
|
210 | "lfconvert" error cases | |
211 | $ hg lfconvert http://localhost/foo foo |
|
211 | $ hg lfconvert http://localhost/foo foo | |
212 | abort: http://localhost/foo is not a local Mercurial repo |
|
212 | abort: http://localhost/foo is not a local Mercurial repo | |
213 | [255] |
|
213 | [255] | |
214 | $ hg lfconvert foo ssh://localhost/foo |
|
214 | $ hg lfconvert foo ssh://localhost/foo | |
215 | abort: ssh://localhost/foo is not a local Mercurial repo |
|
215 | abort: ssh://localhost/foo is not a local Mercurial repo | |
216 | [255] |
|
216 | [255] | |
217 | $ hg lfconvert nosuchrepo foo |
|
217 | $ hg lfconvert nosuchrepo foo | |
218 | abort: repository nosuchrepo not found |
|
218 | abort: repository nosuchrepo not found | |
219 | [255] |
|
219 | [255] | |
220 | $ hg share -q -U bigfile-repo shared |
|
220 | $ hg share -q -U bigfile-repo shared | |
221 | $ printf 'bogus' > shared/.hg/sharedpath |
|
221 | $ printf 'bogus' > shared/.hg/sharedpath | |
222 | $ hg lfconvert shared foo |
|
222 | $ hg lfconvert shared foo | |
223 | abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus |
|
223 | abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus | |
224 | [255] |
|
224 | [255] | |
225 | $ hg lfconvert bigfile-repo largefiles-repo |
|
225 | $ hg lfconvert bigfile-repo largefiles-repo | |
226 | initializing destination largefiles-repo |
|
226 | initializing destination largefiles-repo | |
227 | abort: repository largefiles-repo already exists |
|
227 | abort: repository largefiles-repo already exists | |
228 | [255] |
|
228 | [255] | |
229 |
|
229 | |||
230 | add another largefile to the new largefiles repo |
|
230 | add another largefile to the new largefiles repo | |
231 | $ cd largefiles-repo |
|
231 | $ cd largefiles-repo | |
232 | $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null |
|
232 | $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null | |
233 | $ hg add --lfsize=1 anotherlarge |
|
233 | $ hg add --lfsize=1 anotherlarge | |
234 | $ hg commit -m "add anotherlarge (should be a largefile)" |
|
234 | $ hg commit -m "add anotherlarge (should be a largefile)" | |
235 | $ cat .hglf/anotherlarge |
|
235 | $ cat .hglf/anotherlarge | |
236 | 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 |
|
236 | 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 | |
237 | $ hg tag mytag |
|
237 | $ hg tag mytag | |
238 | $ cd .. |
|
238 | $ cd .. | |
239 |
|
239 | |||
240 | round-trip: converting back to a normal (non-largefiles) repo with |
|
240 | round-trip: converting back to a normal (non-largefiles) repo with | |
241 | "lfconvert --to-normal" should give the same as ../bigfile-repo. The |
|
241 | "lfconvert --to-normal" should give the same as ../bigfile-repo. The | |
242 | convert extension is disabled to show config items can be loaded without it. |
|
242 | convert extension is disabled to show config items can be loaded without it. | |
243 | $ cd largefiles-repo |
|
243 | $ cd largefiles-repo | |
244 | $ hg --config extensions.convert=! lfconvert --to-normal . ../normal-repo |
|
244 | $ hg --config extensions.convert=! lfconvert --to-normal . ../normal-repo | |
245 | initializing destination ../normal-repo |
|
245 | initializing destination ../normal-repo | |
246 | 0 additional largefiles cached |
|
246 | 0 additional largefiles cached | |
247 | scanning source... |
|
247 | scanning source... | |
248 | sorting... |
|
248 | sorting... | |
249 | converting... |
|
249 | converting... | |
250 | 7 add large, normal1 |
|
250 | 7 add large, normal1 | |
251 | 6 add sub/* |
|
251 | 6 add sub/* | |
252 | 5 rename sub/ to stuff/ |
|
252 | 5 rename sub/ to stuff/ | |
253 | 4 add normal3, modify sub/* |
|
253 | 4 add normal3, modify sub/* | |
254 | 3 remove large, normal3 |
|
254 | 3 remove large, normal3 | |
255 | 2 merge |
|
255 | 2 merge | |
256 | 1 add anotherlarge (should be a largefile) |
|
256 | 1 add anotherlarge (should be a largefile) | |
257 | 0 Added tag mytag for changeset 17126745edfd |
|
257 | 0 Added tag mytag for changeset 17126745edfd | |
258 | $ cd ../normal-repo |
|
258 | $ cd ../normal-repo | |
259 | $ cat >> .hg/hgrc <<EOF |
|
259 | $ cat >> .hg/hgrc <<EOF | |
260 | > [extensions] |
|
260 | > [extensions] | |
261 | > largefiles = ! |
|
261 | > largefiles = ! | |
262 | > EOF |
|
262 | > EOF | |
263 |
|
263 | |||
264 | $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n" |
|
264 | $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n" | |
265 | o 7:b5fedc110b9d Added tag mytag for changeset 867ab992ecf4 |
|
265 | o 7:b5fedc110b9d Added tag mytag for changeset 867ab992ecf4 | |
266 | | |
|
266 | | | |
267 | o 6:867ab992ecf4 add anotherlarge (should be a largefile) |
|
267 | o 6:867ab992ecf4 add anotherlarge (should be a largefile) | |
268 | | |
|
268 | | | |
269 | o 5:4884f215abda merge |
|
269 | o 5:4884f215abda merge | |
270 | |\ |
|
270 | |\ | |
271 | | o 4:7285f817b77e remove large, normal3 |
|
271 | | o 4:7285f817b77e remove large, normal3 | |
272 | | | |
|
272 | | | | |
273 | | o 3:67e3892e3534 add normal3, modify sub/* |
|
273 | | o 3:67e3892e3534 add normal3, modify sub/* | |
274 | | | |
|
274 | | | | |
275 | o | 2:c96c8beb5d56 rename sub/ to stuff/ |
|
275 | o | 2:c96c8beb5d56 rename sub/ to stuff/ | |
276 | |/ |
|
276 | |/ | |
277 | o 1:020c65d24e11 add sub/* |
|
277 | o 1:020c65d24e11 add sub/* | |
278 | | |
|
278 | | | |
279 | o 0:117b8328f97a add large, normal1 |
|
279 | o 0:117b8328f97a add large, normal1 | |
280 |
|
280 | |||
281 | $ hg update |
|
281 | $ hg update | |
282 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
282 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
283 | $ hg locate |
|
283 | $ hg locate | |
284 | .hgtags |
|
284 | .hgtags | |
285 | anotherlarge |
|
285 | anotherlarge | |
286 | normal1 |
|
286 | normal1 | |
287 | stuff/maybelarge.dat |
|
287 | stuff/maybelarge.dat | |
288 | stuff/normal2 |
|
288 | stuff/normal2 | |
289 | $ [ -d .hg/largefiles ] && echo fail || echo pass |
|
289 | $ [ -d .hg/largefiles ] && echo fail || echo pass | |
290 | pass |
|
290 | pass | |
291 |
|
291 | |||
292 | $ cd .. |
|
292 | $ cd .. | |
293 |
|
293 | |||
294 | Clearing the usercache ensures that commitctx doesn't try to cache largefiles |
|
294 | Clearing the usercache ensures that commitctx doesn't try to cache largefiles | |
295 | from the working dir on a convert. |
|
295 | from the working dir on a convert. | |
296 | $ rm "${USERCACHE}"/* |
|
296 | $ rm "${USERCACHE}"/* | |
297 | $ hg convert largefiles-repo |
|
297 | $ hg convert largefiles-repo | |
298 | assuming destination largefiles-repo-hg |
|
298 | assuming destination largefiles-repo-hg | |
299 | initializing destination largefiles-repo-hg repository |
|
299 | initializing destination largefiles-repo-hg repository | |
300 | scanning source... |
|
300 | scanning source... | |
301 | sorting... |
|
301 | sorting... | |
302 | converting... |
|
302 | converting... | |
303 | 7 add large, normal1 |
|
303 | 7 add large, normal1 | |
304 | 6 add sub/* |
|
304 | 6 add sub/* | |
305 | 5 rename sub/ to stuff/ |
|
305 | 5 rename sub/ to stuff/ | |
306 | 4 add normal3, modify sub/* |
|
306 | 4 add normal3, modify sub/* | |
307 | 3 remove large, normal3 |
|
307 | 3 remove large, normal3 | |
308 | 2 merge |
|
308 | 2 merge | |
309 | 1 add anotherlarge (should be a largefile) |
|
309 | 1 add anotherlarge (should be a largefile) | |
310 | 0 Added tag mytag for changeset 17126745edfd |
|
310 | 0 Added tag mytag for changeset 17126745edfd | |
311 |
|
311 | |||
312 | $ hg -R largefiles-repo-hg log -G --template "{rev}:{node|short} {desc|firstline}\n" |
|
312 | $ hg -R largefiles-repo-hg log -G --template "{rev}:{node|short} {desc|firstline}\n" | |
313 | o 7:2f08f66459b7 Added tag mytag for changeset 17126745edfd |
|
313 | o 7:2f08f66459b7 Added tag mytag for changeset 17126745edfd | |
314 | | |
|
314 | | | |
315 | o 6:17126745edfd add anotherlarge (should be a largefile) |
|
315 | o 6:17126745edfd add anotherlarge (should be a largefile) | |
316 | | |
|
316 | | | |
317 | o 5:9cc5aa7204f0 merge |
|
317 | o 5:9cc5aa7204f0 merge | |
318 | |\ |
|
318 | |\ | |
319 | | o 4:a5a02de7a8e4 remove large, normal3 |
|
319 | | o 4:a5a02de7a8e4 remove large, normal3 | |
320 | | | |
|
320 | | | | |
321 | | o 3:55759520c76f add normal3, modify sub/* |
|
321 | | o 3:55759520c76f add normal3, modify sub/* | |
322 | | | |
|
322 | | | | |
323 | o | 2:261ad3f3f037 rename sub/ to stuff/ |
|
323 | o | 2:261ad3f3f037 rename sub/ to stuff/ | |
324 | |/ |
|
324 | |/ | |
325 | o 1:334e5237836d add sub/* |
|
325 | o 1:334e5237836d add sub/* | |
326 | | |
|
326 | | | |
327 | o 0:d4892ec57ce2 add large, normal1 |
|
327 | o 0:d4892ec57ce2 add large, normal1 | |
328 |
|
328 | |||
329 | Verify will fail (for now) if the usercache is purged before converting, since |
|
329 | Verify will fail (for now) if the usercache is purged before converting, since | |
330 | largefiles are not cached in the converted repo's local store by the conversion |
|
330 | largefiles are not cached in the converted repo's local store by the conversion | |
331 | process. |
|
331 | process. | |
332 | $ cd largefiles-repo-hg |
|
332 | $ cd largefiles-repo-hg | |
333 | $ cat >> .hg/hgrc <<EOF |
|
333 | $ cat >> .hg/hgrc <<EOF | |
334 | > [experimental] |
|
334 | > [experimental] | |
335 | > evolution.createmarkers=True |
|
335 | > evolution.createmarkers=True | |
336 | > EOF |
|
336 | > EOF | |
337 | $ hg debugobsolete `hg log -r tip -T "{node}"` |
|
337 | $ hg debugobsolete `hg log -r tip -T "{node}"` | |
338 | 1 new obsolescence markers |
|
338 | 1 new obsolescence markers | |
339 | obsoleted 1 changesets |
|
339 | obsoleted 1 changesets | |
340 | $ cd .. |
|
340 | $ cd .. | |
341 |
|
341 | |||
342 | $ hg -R largefiles-repo-hg verify --large --lfa |
|
342 | $ hg -R largefiles-repo-hg verify --large --lfa | |
343 | checking changesets |
|
343 | checking changesets | |
344 | checking manifests |
|
344 | checking manifests | |
345 | crosschecking files in changesets and manifests |
|
345 | crosschecking files in changesets and manifests | |
346 | checking files |
|
346 | checking files | |
347 | checked 8 changesets with 13 changes to 9 files |
|
347 | checked 8 changesets with 13 changes to 9 files | |
348 | searching 7 changesets for largefiles |
|
348 | searching 7 changesets for largefiles | |
349 | changeset 0:d4892ec57ce2: large references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/2e000fa7e85759c7f4c254d4d9c33ef481e459a7 |
|
349 | changeset 0:d4892ec57ce2: large references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/2e000fa7e85759c7f4c254d4d9c33ef481e459a7 | |
350 | changeset 1:334e5237836d: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c |
|
350 | changeset 1:334e5237836d: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c | |
351 | changeset 2:261ad3f3f037: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c |
|
351 | changeset 2:261ad3f3f037: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c | |
352 | changeset 3:55759520c76f: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38 |
|
352 | changeset 3:55759520c76f: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38 | |
353 | changeset 5:9cc5aa7204f0: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38 |
|
353 | changeset 5:9cc5aa7204f0: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38 | |
354 | changeset 6:17126745edfd: anotherlarge references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 |
|
354 | changeset 6:17126745edfd: anotherlarge references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 | |
355 | verified existence of 6 revisions of 4 largefiles |
|
355 | verified existence of 6 revisions of 4 largefiles | |
356 | [1] |
|
356 | [1] | |
357 | $ hg -R largefiles-repo-hg showconfig paths |
|
357 | $ hg -R largefiles-repo-hg showconfig paths | |
358 | [1] |
|
358 | [1] | |
359 |
|
359 | |||
360 |
|
360 | |||
361 | Avoid a traceback if a largefile isn't available (issue3519) |
|
361 | Avoid a traceback if a largefile isn't available (issue3519) | |
362 |
|
362 | |||
363 | Ensure the largefile can be cached in the source if necessary |
|
363 | Ensure the largefile can be cached in the source if necessary | |
364 | $ hg clone -U largefiles-repo issue3519 |
|
364 | $ hg clone -U largefiles-repo issue3519 | |
365 | $ rm -f "${USERCACHE}"/* |
|
365 | $ rm -f "${USERCACHE}"/* | |
366 | $ hg -R issue3519 branch -q mybranch |
|
366 | $ hg -R issue3519 branch -q mybranch | |
367 | $ hg -R issue3519 ci -m 'change branch name only' |
|
367 | $ hg -R issue3519 ci -m 'change branch name only' | |
368 | $ hg lfconvert --to-normal issue3519 normalized3519 |
|
368 | $ hg lfconvert --to-normal issue3519 normalized3519 | |
369 | initializing destination normalized3519 |
|
369 | initializing destination normalized3519 | |
370 | 4 additional largefiles cached |
|
370 | 4 additional largefiles cached | |
371 | scanning source... |
|
371 | scanning source... | |
372 | sorting... |
|
372 | sorting... | |
373 | converting... |
|
373 | converting... | |
374 | 8 add large, normal1 |
|
374 | 8 add large, normal1 | |
375 | 7 add sub/* |
|
375 | 7 add sub/* | |
376 | 6 rename sub/ to stuff/ |
|
376 | 6 rename sub/ to stuff/ | |
377 | 5 add normal3, modify sub/* |
|
377 | 5 add normal3, modify sub/* | |
378 | 4 remove large, normal3 |
|
378 | 4 remove large, normal3 | |
379 | 3 merge |
|
379 | 3 merge | |
380 | 2 add anotherlarge (should be a largefile) |
|
380 | 2 add anotherlarge (should be a largefile) | |
381 | 1 Added tag mytag for changeset 17126745edfd |
|
381 | 1 Added tag mytag for changeset 17126745edfd | |
382 | 0 change branch name only |
|
382 | 0 change branch name only | |
383 |
|
383 | |||
384 | Ensure empty commits aren't lost in the conversion |
|
384 | Ensure empty commits aren't lost in the conversion | |
385 | $ hg -R normalized3519 log -r tip -T '{desc}\n' |
|
385 | $ hg -R normalized3519 log -r tip -T '{desc}\n' | |
386 | change branch name only |
|
386 | change branch name only | |
387 |
|
387 | |||
388 | Ensure the abort message is useful if a largefile is entirely unavailable |
|
388 | Ensure the abort message is useful if a largefile is entirely unavailable | |
389 | $ rm -rf normalized3519 |
|
389 | $ rm -rf normalized3519 | |
390 | $ rm "${USERCACHE}"/* |
|
390 | $ rm "${USERCACHE}"/* | |
391 | $ rm issue3519/.hg/largefiles/* |
|
391 | $ rm issue3519/.hg/largefiles/* | |
392 | $ rm largefiles-repo/.hg/largefiles/* |
|
392 | $ rm largefiles-repo/.hg/largefiles/* | |
393 | $ hg lfconvert --to-normal issue3519 normalized3519 |
|
393 | $ hg lfconvert --to-normal issue3519 normalized3519 | |
394 | initializing destination normalized3519 |
|
394 | initializing destination normalized3519 | |
395 | large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob) |
|
395 | large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob) | |
396 | large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob) |
|
396 | large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob) | |
397 | sub/maybelarge.dat: largefile 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c not available from file:/*/$TESTTMP/largefiles-repo (glob) |
|
397 | sub/maybelarge.dat: largefile 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c not available from file:/*/$TESTTMP/largefiles-repo (glob) | |
398 | large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob) |
|
398 | large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob) | |
399 | stuff/maybelarge.dat: largefile 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c not available from file:/*/$TESTTMP/largefiles-repo (glob) |
|
399 | stuff/maybelarge.dat: largefile 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c not available from file:/*/$TESTTMP/largefiles-repo (glob) | |
400 | large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob) |
|
400 | large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob) | |
401 | sub/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob) |
|
401 | sub/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob) | |
402 | sub/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob) |
|
402 | sub/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob) | |
403 | stuff/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob) |
|
403 | stuff/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob) | |
404 | anotherlarge: largefile 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 not available from file:/*/$TESTTMP/largefiles-repo (glob) |
|
404 | anotherlarge: largefile 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 not available from file:/*/$TESTTMP/largefiles-repo (glob) | |
405 | stuff/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob) |
|
405 | stuff/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob) | |
406 | 0 additional largefiles cached |
|
406 | 0 additional largefiles cached | |
407 | 11 largefiles failed to download |
|
407 | 11 largefiles failed to download | |
408 | abort: all largefiles must be present locally |
|
408 | abort: all largefiles must be present locally | |
409 | [255] |
|
409 | [255] | |
410 |
|
410 | |||
411 |
|
411 |
@@ -1,360 +1,360 b'' | |||||
1 | #require no-reposimplestore no-chg |
|
1 | #require no-reposimplestore no-chg | |
2 |
|
2 | |||
3 | This tests the interaction between the largefiles and lfs extensions, and |
|
3 | This tests the interaction between the largefiles and lfs extensions, and | |
4 | conversion from largefiles -> lfs. |
|
4 | conversion from largefiles -> lfs. | |
5 |
|
5 | |||
6 | $ cat >> $HGRCPATH << EOF |
|
6 | $ cat >> $HGRCPATH << EOF | |
7 | > [extensions] |
|
7 | > [extensions] | |
8 | > largefiles = |
|
8 | > largefiles = | |
9 | > |
|
9 | > | |
10 | > [lfs] |
|
10 | > [lfs] | |
11 | > # standin files are 41 bytes. Stay bigger for clarity. |
|
11 | > # standin files are 41 bytes. Stay bigger for clarity. | |
12 | > threshold = 42 |
|
12 | > threshold = 42 | |
13 | > EOF |
|
13 | > EOF | |
14 |
|
14 | |||
15 | Setup a repo with a normal file and a largefile, above and below the lfs |
|
15 | Setup a repo with a normal file and a largefile, above and below the lfs | |
16 | threshold to test lfconvert. *.txt start life as a normal file; *.bin start as |
|
16 | threshold to test lfconvert. *.txt start life as a normal file; *.bin start as | |
17 | an lfs/largefile. |
|
17 | an lfs/largefile. | |
18 |
|
18 | |||
19 | $ hg init largefiles |
|
19 | $ hg init largefiles | |
20 | $ cd largefiles |
|
20 | $ cd largefiles | |
21 | $ echo 'normal' > normal.txt |
|
21 | $ echo 'normal' > normal.txt | |
22 | $ echo 'normal above lfs threshold 0000000000000000000000000' > lfs.txt |
|
22 | $ echo 'normal above lfs threshold 0000000000000000000000000' > lfs.txt | |
23 | $ hg ci -Am 'normal.txt' |
|
23 | $ hg ci -Am 'normal.txt' | |
24 | adding lfs.txt |
|
24 | adding lfs.txt | |
25 | adding normal.txt |
|
25 | adding normal.txt | |
26 | $ echo 'largefile' > large.bin |
|
26 | $ echo 'largefile' > large.bin | |
27 | $ echo 'largefile above lfs threshold 0000000000000000000000' > lfs.bin |
|
27 | $ echo 'largefile above lfs threshold 0000000000000000000000' > lfs.bin | |
28 | $ hg add --large large.bin lfs.bin |
|
28 | $ hg add --large large.bin lfs.bin | |
29 | $ hg ci -m 'add largefiles' |
|
29 | $ hg ci -m 'add largefiles' | |
30 |
|
30 | |||
31 | $ cat >> $HGRCPATH << EOF |
|
31 | $ cat >> $HGRCPATH << EOF | |
32 | > [extensions] |
|
32 | > [extensions] | |
33 | > lfs = |
|
33 | > lfs = | |
34 | > EOF |
|
34 | > EOF | |
35 |
|
35 | |||
36 | Add an lfs file and normal file that collide with files on the other branch. |
|
36 | Add an lfs file and normal file that collide with files on the other branch. | |
37 | large.bin is added as a normal file, and is named as such only to clash with the |
|
37 | large.bin is added as a normal file, and is named as such only to clash with the | |
38 | largefile on the other branch. |
|
38 | largefile on the other branch. | |
39 |
|
39 | |||
40 | $ hg up -q '.^' |
|
40 | $ hg up -q '.^' | |
41 | $ echo 'below lfs threshold' > large.bin |
|
41 | $ echo 'below lfs threshold' > large.bin | |
42 | $ echo 'lfs above the lfs threshold for length 0000000000000' > lfs.bin |
|
42 | $ echo 'lfs above the lfs threshold for length 0000000000000' > lfs.bin | |
43 | $ hg ci -Am 'add with lfs extension' |
|
43 | $ hg ci -Am 'add with lfs extension' | |
44 | adding large.bin |
|
44 | adding large.bin | |
45 | adding lfs.bin |
|
45 | adding lfs.bin | |
46 | created new head |
|
46 | created new head | |
47 |
|
47 | |||
48 | $ hg log -G |
|
48 | $ hg log -G | |
49 | @ changeset: 2:e989d0fa3764 |
|
49 | @ changeset: 2:e989d0fa3764 | |
50 | | tag: tip |
|
50 | | tag: tip | |
51 | | parent: 0:29361292f54d |
|
51 | | parent: 0:29361292f54d | |
52 | | user: test |
|
52 | | user: test | |
53 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
53 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
54 | | summary: add with lfs extension |
|
54 | | summary: add with lfs extension | |
55 | | |
|
55 | | | |
56 | | o changeset: 1:6513aaab9ca0 |
|
56 | | o changeset: 1:6513aaab9ca0 | |
57 | |/ user: test |
|
57 | |/ user: test | |
58 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
58 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
59 | | summary: add largefiles |
|
59 | | summary: add largefiles | |
60 | | |
|
60 | | | |
61 | o changeset: 0:29361292f54d |
|
61 | o changeset: 0:29361292f54d | |
62 | user: test |
|
62 | user: test | |
63 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
63 | date: Thu Jan 01 00:00:00 1970 +0000 | |
64 | summary: normal.txt |
|
64 | summary: normal.txt | |
65 |
|
65 | |||
66 | -------------------------------------------------------------------------------- |
|
66 | -------------------------------------------------------------------------------- | |
67 | Merge largefiles into lfs branch |
|
67 | Merge largefiles into lfs branch | |
68 |
|
68 | |||
69 | The largefiles extension will prompt to use the normal or largefile when merged |
|
69 | The largefiles extension will prompt to use the normal or largefile when merged | |
70 | into the lfs files. `hg manifest` will show standins if present. They aren't, |
|
70 | into the lfs files. `hg manifest` will show standins if present. They aren't, | |
71 | because largefiles merge doesn't merge content. If it did, selecting (n)ormal |
|
71 | because largefiles merge doesn't merge content. If it did, selecting (n)ormal | |
72 | would convert to lfs on commit, if appropriate. |
|
72 | would convert to lfs on commit, if appropriate. | |
73 |
|
73 | |||
74 | BUG: Largefiles isn't running the merge tool, like when two lfs files are |
|
74 | BUG: Largefiles isn't running the merge tool, like when two lfs files are | |
75 | merged. This is probably by design, but it should probably at least prompt if |
|
75 | merged. This is probably by design, but it should probably at least prompt if | |
76 | content should be taken from (l)ocal or (o)ther as well. |
|
76 | content should be taken from (l)ocal or (o)ther as well. | |
77 |
|
77 | |||
78 | $ hg --config ui.interactive=True merge 6513aaab9ca0 <<EOF |
|
78 | $ hg --config ui.interactive=True merge 6513aaab9ca0 <<EOF | |
79 | > n |
|
79 | > n | |
80 | > n |
|
80 | > n | |
81 | > EOF |
|
81 | > EOF | |
82 | remote turned local normal file large.bin into a largefile |
|
82 | remote turned local normal file large.bin into a largefile | |
83 | use (l)argefile or keep (n)ormal file? n |
|
83 | use (l)argefile or keep (n)ormal file? n | |
84 | remote turned local normal file lfs.bin into a largefile |
|
84 | remote turned local normal file lfs.bin into a largefile | |
85 | use (l)argefile or keep (n)ormal file? n |
|
85 | use (l)argefile or keep (n)ormal file? n | |
86 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
86 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
87 | (branch merge, don't forget to commit) |
|
87 | (branch merge, don't forget to commit) | |
88 | $ hg ci -m 'merge lfs with largefiles -> normal' |
|
88 | $ hg ci -m 'merge lfs with largefiles -> normal' | |
89 | $ hg manifest |
|
89 | $ hg manifest | |
90 | large.bin |
|
90 | large.bin | |
91 | lfs.bin |
|
91 | lfs.bin | |
92 | lfs.txt |
|
92 | lfs.txt | |
93 | normal.txt |
|
93 | normal.txt | |
94 |
|
94 | |||
95 | The merged lfs.bin resolved to lfs because the (n)ormal option was picked. The |
|
95 | The merged lfs.bin resolved to lfs because the (n)ormal option was picked. The | |
96 | lfs.txt file is unchanged by the merge, because it was added before lfs was |
|
96 | lfs.txt file is unchanged by the merge, because it was added before lfs was | |
97 | enabled, and the content didn't change. |
|
97 | enabled, and the content didn't change. | |
98 | $ hg debugdata lfs.bin 0 |
|
98 | $ hg debugdata lfs.bin 0 | |
99 | version https://git-lfs.github.com/spec/v1 |
|
99 | version https://git-lfs.github.com/spec/v1 | |
100 | oid sha256:81c7492b2c05e130431f65a87651b54a30c5da72c99ce35a1e9b9872a807312b |
|
100 | oid sha256:81c7492b2c05e130431f65a87651b54a30c5da72c99ce35a1e9b9872a807312b | |
101 | size 53 |
|
101 | size 53 | |
102 | x-is-binary 0 |
|
102 | x-is-binary 0 | |
103 | $ hg debugdata lfs.txt 0 |
|
103 | $ hg debugdata lfs.txt 0 | |
104 | normal above lfs threshold 0000000000000000000000000 |
|
104 | normal above lfs threshold 0000000000000000000000000 | |
105 |
|
105 | |||
106 | Another filelog entry is NOT made by the merge, so nothing is committed as lfs. |
|
106 | Another filelog entry is NOT made by the merge, so nothing is committed as lfs. | |
107 | $ hg log -r . -T '{join(lfs_files, ", ")}\n' |
|
107 | $ hg log -r . -T '{join(lfs_files, ", ")}\n' | |
108 |
|
108 | |||
109 |
|
109 | |||
110 | Replay the last merge, but pick (l)arge this time. The manifest will show any |
|
110 | Replay the last merge, but pick (l)arge this time. The manifest will show any | |
111 | standins. |
|
111 | standins. | |
112 |
|
112 | |||
113 | $ hg up -Cq e989d0fa3764 |
|
113 | $ hg up -Cq e989d0fa3764 | |
114 |
|
114 | |||
115 | $ hg --config ui.interactive=True merge 6513aaab9ca0 <<EOF |
|
115 | $ hg --config ui.interactive=True merge 6513aaab9ca0 <<EOF | |
116 | > l |
|
116 | > l | |
117 | > l |
|
117 | > l | |
118 | > EOF |
|
118 | > EOF | |
119 | remote turned local normal file large.bin into a largefile |
|
119 | remote turned local normal file large.bin into a largefile | |
120 | use (l)argefile or keep (n)ormal file? l |
|
120 | use (l)argefile or keep (n)ormal file? l | |
121 | remote turned local normal file lfs.bin into a largefile |
|
121 | remote turned local normal file lfs.bin into a largefile | |
122 | use (l)argefile or keep (n)ormal file? l |
|
122 | use (l)argefile or keep (n)ormal file? l | |
123 | getting changed largefiles |
|
123 | getting changed largefiles | |
124 | 2 largefiles updated, 0 removed |
|
124 | 2 largefiles updated, 0 removed | |
125 | 2 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
125 | 2 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
126 | (branch merge, don't forget to commit) |
|
126 | (branch merge, don't forget to commit) | |
127 | $ hg ci -m 'merge lfs with largefiles -> large' |
|
127 | $ hg ci -m 'merge lfs with largefiles -> large' | |
128 | created new head |
|
128 | created new head | |
129 | $ hg manifest |
|
129 | $ hg manifest | |
130 | .hglf/large.bin |
|
130 | .hglf/large.bin | |
131 | .hglf/lfs.bin |
|
131 | .hglf/lfs.bin | |
132 | lfs.txt |
|
132 | lfs.txt | |
133 | normal.txt |
|
133 | normal.txt | |
134 |
|
134 | |||
135 | -------------------------------------------------------------------------------- |
|
135 | -------------------------------------------------------------------------------- | |
136 | Merge lfs into largefiles branch |
|
136 | Merge lfs into largefiles branch | |
137 |
|
137 | |||
138 | $ hg up -Cq 6513aaab9ca0 |
|
138 | $ hg up -Cq 6513aaab9ca0 | |
139 | $ hg --config ui.interactive=True merge e989d0fa3764 <<EOF |
|
139 | $ hg --config ui.interactive=True merge e989d0fa3764 <<EOF | |
140 | > n |
|
140 | > n | |
141 | > n |
|
141 | > n | |
142 | > EOF |
|
142 | > EOF | |
143 | remote turned local largefile large.bin into a normal file |
|
143 | remote turned local largefile large.bin into a normal file | |
144 | keep (l)argefile or use (n)ormal file? n |
|
144 | keep (l)argefile or use (n)ormal file? n | |
145 | remote turned local largefile lfs.bin into a normal file |
|
145 | remote turned local largefile lfs.bin into a normal file | |
146 | keep (l)argefile or use (n)ormal file? n |
|
146 | keep (l)argefile or use (n)ormal file? n | |
147 | getting changed largefiles |
|
147 | getting changed largefiles | |
148 | 0 largefiles updated, 0 removed |
|
148 | 0 largefiles updated, 0 removed | |
149 | 2 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
149 | 2 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
150 | (branch merge, don't forget to commit) |
|
150 | (branch merge, don't forget to commit) | |
151 | $ hg ci -m 'merge largefiles with lfs -> normal' |
|
151 | $ hg ci -m 'merge largefiles with lfs -> normal' | |
152 | created new head |
|
152 | created new head | |
153 | $ hg manifest |
|
153 | $ hg manifest | |
154 | large.bin |
|
154 | large.bin | |
155 | lfs.bin |
|
155 | lfs.bin | |
156 | lfs.txt |
|
156 | lfs.txt | |
157 | normal.txt |
|
157 | normal.txt | |
158 |
|
158 | |||
159 | The merged lfs.bin got converted to lfs because the (n)ormal option was picked. |
|
159 | The merged lfs.bin got converted to lfs because the (n)ormal option was picked. | |
160 | The lfs.txt file is unchanged by the merge, because it was added before lfs was |
|
160 | The lfs.txt file is unchanged by the merge, because it was added before lfs was | |
161 | enabled. |
|
161 | enabled. | |
162 | $ hg debugdata lfs.bin 0 |
|
162 | $ hg debugdata lfs.bin 0 | |
163 | version https://git-lfs.github.com/spec/v1 |
|
163 | version https://git-lfs.github.com/spec/v1 | |
164 | oid sha256:81c7492b2c05e130431f65a87651b54a30c5da72c99ce35a1e9b9872a807312b |
|
164 | oid sha256:81c7492b2c05e130431f65a87651b54a30c5da72c99ce35a1e9b9872a807312b | |
165 | size 53 |
|
165 | size 53 | |
166 | x-is-binary 0 |
|
166 | x-is-binary 0 | |
167 | $ hg debugdata lfs.txt 0 |
|
167 | $ hg debugdata lfs.txt 0 | |
168 | normal above lfs threshold 0000000000000000000000000 |
|
168 | normal above lfs threshold 0000000000000000000000000 | |
169 |
|
169 | |||
170 | Another filelog entry is NOT made by the merge, so nothing is committed as lfs. |
|
170 | Another filelog entry is NOT made by the merge, so nothing is committed as lfs. | |
171 | $ hg log -r . -T '{join(lfs_files, ", ")}\n' |
|
171 | $ hg log -r . -T '{join(lfs_files, ", ")}\n' | |
172 |
|
172 | |||
173 |
|
173 | |||
174 | Replay the last merge, but pick (l)arge this time. The manifest will show the |
|
174 | Replay the last merge, but pick (l)arge this time. The manifest will show the | |
175 | standins. |
|
175 | standins. | |
176 |
|
176 | |||
177 | $ hg up -Cq 6513aaab9ca0 |
|
177 | $ hg up -Cq 6513aaab9ca0 | |
178 |
|
178 | |||
179 | $ hg --config ui.interactive=True merge e989d0fa3764 <<EOF |
|
179 | $ hg --config ui.interactive=True merge e989d0fa3764 <<EOF | |
180 | > l |
|
180 | > l | |
181 | > l |
|
181 | > l | |
182 | > EOF |
|
182 | > EOF | |
183 | remote turned local largefile large.bin into a normal file |
|
183 | remote turned local largefile large.bin into a normal file | |
184 | keep (l)argefile or use (n)ormal file? l |
|
184 | keep (l)argefile or use (n)ormal file? l | |
185 | remote turned local largefile lfs.bin into a normal file |
|
185 | remote turned local largefile lfs.bin into a normal file | |
186 | keep (l)argefile or use (n)ormal file? l |
|
186 | keep (l)argefile or use (n)ormal file? l | |
187 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
187 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
188 | (branch merge, don't forget to commit) |
|
188 | (branch merge, don't forget to commit) | |
189 | $ hg ci -m 'merge largefiles with lfs -> large' |
|
189 | $ hg ci -m 'merge largefiles with lfs -> large' | |
190 | created new head |
|
190 | created new head | |
191 | $ hg manifest |
|
191 | $ hg manifest | |
192 | .hglf/large.bin |
|
192 | .hglf/large.bin | |
193 | .hglf/lfs.bin |
|
193 | .hglf/lfs.bin | |
194 | lfs.txt |
|
194 | lfs.txt | |
195 | normal.txt |
|
195 | normal.txt | |
196 |
|
196 | |||
197 | -------------------------------------------------------------------------------- |
|
197 | -------------------------------------------------------------------------------- | |
198 |
|
198 | |||
199 | When both largefiles and lfs are configured to add by size, the tie goes to |
|
199 | When both largefiles and lfs are configured to add by size, the tie goes to | |
200 | largefiles since it hooks cmdutil.add() and lfs hooks the filelog write in the |
|
200 | largefiles since it hooks cmdutil.add() and lfs hooks the filelog write in the | |
201 | commit. By the time the commit occurs, the tracked file is smaller than the |
|
201 | commit. By the time the commit occurs, the tracked file is smaller than the | |
202 | threshold (assuming it is > 41, so the standins don't become lfs objects). |
|
202 | threshold (assuming it is > 41, so the standins don't become lfs objects). | |
203 |
|
203 | |||
204 | $ "$PYTHON" -c 'import sys ; sys.stdout.write("y\n" * 1048576)' > large_by_size.bin |
|
204 | $ "$PYTHON" -c 'import sys ; sys.stdout.write("y\n" * 1048576)' > large_by_size.bin | |
205 | $ hg --config largefiles.minsize=1 ci -Am 'large by size' |
|
205 | $ hg --config largefiles.minsize=1 ci -Am 'large by size' | |
206 | adding large_by_size.bin as a largefile |
|
206 | adding large_by_size.bin as a largefile | |
207 | $ hg manifest |
|
207 | $ hg manifest | |
208 | .hglf/large.bin |
|
208 | .hglf/large.bin | |
209 | .hglf/large_by_size.bin |
|
209 | .hglf/large_by_size.bin | |
210 | .hglf/lfs.bin |
|
210 | .hglf/lfs.bin | |
211 | lfs.txt |
|
211 | lfs.txt | |
212 | normal.txt |
|
212 | normal.txt | |
213 |
|
213 | |||
214 | $ hg rm large_by_size.bin |
|
214 | $ hg rm large_by_size.bin | |
215 | $ hg ci -m 'remove large_by_size.bin' |
|
215 | $ hg ci -m 'remove large_by_size.bin' | |
216 |
|
216 | |||
217 | Largefiles doesn't do anything special with diff, so it falls back to diffing |
|
217 | Largefiles doesn't do anything special with diff, so it falls back to diffing | |
218 | the standins. Extdiff also is standin based comparison. Diff and extdiff both |
|
218 | the standins. Extdiff also is standin based comparison. Diff and extdiff both | |
219 | work on the original file for lfs objects. |
|
219 | work on the original file for lfs objects. | |
220 |
|
220 | |||
221 | Largefile -> lfs transition |
|
221 | Largefile -> lfs transition | |
222 | $ hg diff -r 1 -r 3 |
|
222 | $ hg diff -r 1 -r 3 | |
223 | diff -r 6513aaab9ca0 -r dcc5ce63e252 .hglf/large.bin |
|
223 | diff -r 6513aaab9ca0 -r dcc5ce63e252 .hglf/large.bin | |
224 | --- a/.hglf/large.bin Thu Jan 01 00:00:00 1970 +0000 |
|
224 | --- a/.hglf/large.bin Thu Jan 01 00:00:00 1970 +0000 | |
225 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
225 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
226 | @@ -1,1 +0,0 @@ |
|
226 | @@ -1,1 +0,0 @@ | |
227 | -cef9a458373df9b0743a0d3c14d0c66fb19b8629 |
|
227 | -cef9a458373df9b0743a0d3c14d0c66fb19b8629 | |
228 | diff -r 6513aaab9ca0 -r dcc5ce63e252 .hglf/lfs.bin |
|
228 | diff -r 6513aaab9ca0 -r dcc5ce63e252 .hglf/lfs.bin | |
229 | --- a/.hglf/lfs.bin Thu Jan 01 00:00:00 1970 +0000 |
|
229 | --- a/.hglf/lfs.bin Thu Jan 01 00:00:00 1970 +0000 | |
230 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
230 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
231 | @@ -1,1 +0,0 @@ |
|
231 | @@ -1,1 +0,0 @@ | |
232 | -557fb6309cef935e1ac2c8296508379e4b15a6e6 |
|
232 | -557fb6309cef935e1ac2c8296508379e4b15a6e6 | |
233 | diff -r 6513aaab9ca0 -r dcc5ce63e252 large.bin |
|
233 | diff -r 6513aaab9ca0 -r dcc5ce63e252 large.bin | |
234 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
234 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
235 | +++ b/large.bin Thu Jan 01 00:00:00 1970 +0000 |
|
235 | +++ b/large.bin Thu Jan 01 00:00:00 1970 +0000 | |
236 | @@ -0,0 +1,1 @@ |
|
236 | @@ -0,0 +1,1 @@ | |
237 | +below lfs threshold |
|
237 | +below lfs threshold | |
238 | diff -r 6513aaab9ca0 -r dcc5ce63e252 lfs.bin |
|
238 | diff -r 6513aaab9ca0 -r dcc5ce63e252 lfs.bin | |
239 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
239 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
240 | +++ b/lfs.bin Thu Jan 01 00:00:00 1970 +0000 |
|
240 | +++ b/lfs.bin Thu Jan 01 00:00:00 1970 +0000 | |
241 | @@ -0,0 +1,1 @@ |
|
241 | @@ -0,0 +1,1 @@ | |
242 | +lfs above the lfs threshold for length 0000000000000 |
|
242 | +lfs above the lfs threshold for length 0000000000000 | |
243 |
|
243 | |||
244 | lfs -> largefiles transition |
|
244 | lfs -> largefiles transition | |
245 | $ hg diff -r 2 -r 6 |
|
245 | $ hg diff -r 2 -r 6 | |
246 | diff -r e989d0fa3764 -r 95e1e80325c8 .hglf/large.bin |
|
246 | diff -r e989d0fa3764 -r 95e1e80325c8 .hglf/large.bin | |
247 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
247 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
248 | +++ b/.hglf/large.bin Thu Jan 01 00:00:00 1970 +0000 |
|
248 | +++ b/.hglf/large.bin Thu Jan 01 00:00:00 1970 +0000 | |
249 | @@ -0,0 +1,1 @@ |
|
249 | @@ -0,0 +1,1 @@ | |
250 | +cef9a458373df9b0743a0d3c14d0c66fb19b8629 |
|
250 | +cef9a458373df9b0743a0d3c14d0c66fb19b8629 | |
251 | diff -r e989d0fa3764 -r 95e1e80325c8 .hglf/lfs.bin |
|
251 | diff -r e989d0fa3764 -r 95e1e80325c8 .hglf/lfs.bin | |
252 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
252 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
253 | +++ b/.hglf/lfs.bin Thu Jan 01 00:00:00 1970 +0000 |
|
253 | +++ b/.hglf/lfs.bin Thu Jan 01 00:00:00 1970 +0000 | |
254 | @@ -0,0 +1,1 @@ |
|
254 | @@ -0,0 +1,1 @@ | |
255 | +557fb6309cef935e1ac2c8296508379e4b15a6e6 |
|
255 | +557fb6309cef935e1ac2c8296508379e4b15a6e6 | |
256 | diff -r e989d0fa3764 -r 95e1e80325c8 large.bin |
|
256 | diff -r e989d0fa3764 -r 95e1e80325c8 large.bin | |
257 | --- a/large.bin Thu Jan 01 00:00:00 1970 +0000 |
|
257 | --- a/large.bin Thu Jan 01 00:00:00 1970 +0000 | |
258 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
258 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
259 | @@ -1,1 +0,0 @@ |
|
259 | @@ -1,1 +0,0 @@ | |
260 | -below lfs threshold |
|
260 | -below lfs threshold | |
261 | diff -r e989d0fa3764 -r 95e1e80325c8 lfs.bin |
|
261 | diff -r e989d0fa3764 -r 95e1e80325c8 lfs.bin | |
262 | --- a/lfs.bin Thu Jan 01 00:00:00 1970 +0000 |
|
262 | --- a/lfs.bin Thu Jan 01 00:00:00 1970 +0000 | |
263 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
263 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
264 | @@ -1,1 +0,0 @@ |
|
264 | @@ -1,1 +0,0 @@ | |
265 | -lfs above the lfs threshold for length 0000000000000 |
|
265 | -lfs above the lfs threshold for length 0000000000000 | |
266 |
|
266 | |||
267 | A largefiles repo can be converted to lfs. The lfconvert command uses the |
|
267 | A largefiles repo can be converted to lfs. The lfconvert command uses the | |
268 | convert extension under the hood with --to-normal. So the --config based |
|
268 | convert extension under the hood with --to-normal. So the --config based | |
269 | parameters are available, but not --authormap, --branchmap, etc. |
|
269 | parameters are available, but not --authormap, --branchmap, etc. | |
270 |
|
270 | |||
271 | $ cd .. |
|
271 | $ cd .. | |
272 | $ hg lfconvert --to-normal largefiles nolargefiles 2>&1 |
|
272 | $ hg lfconvert --to-normal largefiles nolargefiles 2>&1 | |
273 | initializing destination nolargefiles |
|
273 | initializing destination nolargefiles | |
274 | 0 additional largefiles cached |
|
274 | 0 additional largefiles cached | |
275 | scanning source... |
|
275 | scanning source... | |
276 | sorting... |
|
276 | sorting... | |
277 | converting... |
|
277 | converting... | |
278 | 8 normal.txt |
|
278 | 8 normal.txt | |
279 | 7 add largefiles |
|
279 | 7 add largefiles | |
280 | 6 add with lfs extension |
|
280 | 6 add with lfs extension | |
281 | 5 merge lfs with largefiles -> normal |
|
281 | 5 merge lfs with largefiles -> normal | |
282 | 4 merge lfs with largefiles -> large |
|
282 | 4 merge lfs with largefiles -> large | |
283 | 3 merge largefiles with lfs -> normal |
|
283 | 3 merge largefiles with lfs -> normal | |
284 | 2 merge largefiles with lfs -> large |
|
284 | 2 merge largefiles with lfs -> large | |
285 | 1 large by size |
|
285 | 1 large by size | |
286 | 0 remove large_by_size.bin |
|
286 | 0 remove large_by_size.bin | |
287 | $ cd nolargefiles |
|
287 | $ cd nolargefiles | |
288 |
|
288 | |||
289 | The requirement is added to the destination repo. |
|
289 | The requirement is added to the destination repo. | |
290 |
|
290 | |||
291 | $ cat .hg/requires |
|
291 | $ cat .hg/requires | |
292 | dotencode |
|
292 | dotencode | |
293 |
|
|
293 | dirstate-v2 (dirstate-v2 !) | |
294 | fncache |
|
294 | fncache | |
295 | generaldelta |
|
295 | generaldelta | |
296 | lfs |
|
296 | lfs | |
297 | persistent-nodemap (rust !) |
|
297 | persistent-nodemap (rust !) | |
298 | revlog-compression-zstd (zstd !) |
|
298 | revlog-compression-zstd (zstd !) | |
299 | revlogv1 |
|
299 | revlogv1 | |
300 | sparserevlog |
|
300 | sparserevlog | |
301 | store |
|
301 | store | |
302 |
|
302 | |||
303 | $ hg log -r 'all()' -G -T '{rev} {join(lfs_files, ", ")} ({desc})\n' |
|
303 | $ hg log -r 'all()' -G -T '{rev} {join(lfs_files, ", ")} ({desc})\n' | |
304 | o 8 large_by_size.bin (remove large_by_size.bin) |
|
304 | o 8 large_by_size.bin (remove large_by_size.bin) | |
305 | | |
|
305 | | | |
306 | o 7 large_by_size.bin (large by size) |
|
306 | o 7 large_by_size.bin (large by size) | |
307 | | |
|
307 | | | |
308 | o 6 (merge largefiles with lfs -> large) |
|
308 | o 6 (merge largefiles with lfs -> large) | |
309 | |\ |
|
309 | |\ | |
310 | +---o 5 (merge largefiles with lfs -> normal) |
|
310 | +---o 5 (merge largefiles with lfs -> normal) | |
311 | | |/ |
|
311 | | |/ | |
312 | +---o 4 lfs.bin (merge lfs with largefiles -> large) |
|
312 | +---o 4 lfs.bin (merge lfs with largefiles -> large) | |
313 | | |/ |
|
313 | | |/ | |
314 | +---o 3 (merge lfs with largefiles -> normal) |
|
314 | +---o 3 (merge lfs with largefiles -> normal) | |
315 | | |/ |
|
315 | | |/ | |
316 | | o 2 lfs.bin (add with lfs extension) |
|
316 | | o 2 lfs.bin (add with lfs extension) | |
317 | | | |
|
317 | | | | |
318 | o | 1 lfs.bin (add largefiles) |
|
318 | o | 1 lfs.bin (add largefiles) | |
319 | |/ |
|
319 | |/ | |
320 | o 0 lfs.txt (normal.txt) |
|
320 | o 0 lfs.txt (normal.txt) | |
321 |
|
321 | |||
322 | $ hg debugdata lfs.bin 0 |
|
322 | $ hg debugdata lfs.bin 0 | |
323 | version https://git-lfs.github.com/spec/v1 |
|
323 | version https://git-lfs.github.com/spec/v1 | |
324 | oid sha256:2172a5bd492dd41ec533b9bb695f7691b6351719407ac797f0ccad5348c81e62 |
|
324 | oid sha256:2172a5bd492dd41ec533b9bb695f7691b6351719407ac797f0ccad5348c81e62 | |
325 | size 53 |
|
325 | size 53 | |
326 | x-is-binary 0 |
|
326 | x-is-binary 0 | |
327 | $ hg debugdata lfs.bin 1 |
|
327 | $ hg debugdata lfs.bin 1 | |
328 | version https://git-lfs.github.com/spec/v1 |
|
328 | version https://git-lfs.github.com/spec/v1 | |
329 | oid sha256:81c7492b2c05e130431f65a87651b54a30c5da72c99ce35a1e9b9872a807312b |
|
329 | oid sha256:81c7492b2c05e130431f65a87651b54a30c5da72c99ce35a1e9b9872a807312b | |
330 | size 53 |
|
330 | size 53 | |
331 | x-is-binary 0 |
|
331 | x-is-binary 0 | |
332 | $ hg debugdata lfs.bin 2 |
|
332 | $ hg debugdata lfs.bin 2 | |
333 | version https://git-lfs.github.com/spec/v1 |
|
333 | version https://git-lfs.github.com/spec/v1 | |
334 | oid sha256:2172a5bd492dd41ec533b9bb695f7691b6351719407ac797f0ccad5348c81e62 |
|
334 | oid sha256:2172a5bd492dd41ec533b9bb695f7691b6351719407ac797f0ccad5348c81e62 | |
335 | size 53 |
|
335 | size 53 | |
336 | x-is-binary 0 |
|
336 | x-is-binary 0 | |
337 | $ hg debugdata lfs.bin 3 |
|
337 | $ hg debugdata lfs.bin 3 | |
338 | abort: invalid revision identifier 3 |
|
338 | abort: invalid revision identifier 3 | |
339 | [255] |
|
339 | [255] | |
340 |
|
340 | |||
341 | No diffs when comparing merge and p1 that kept p1's changes. Diff of lfs to |
|
341 | No diffs when comparing merge and p1 that kept p1's changes. Diff of lfs to | |
342 | largefiles no longer operates in standin files. |
|
342 | largefiles no longer operates in standin files. | |
343 |
|
343 | |||
344 | This `head -n 20` looks dumb (since we expect no output), but if something |
|
344 | This `head -n 20` looks dumb (since we expect no output), but if something | |
345 | breaks you can get 1048576 lines of +y in the output, which takes a looooooong |
|
345 | breaks you can get 1048576 lines of +y in the output, which takes a looooooong | |
346 | time to print. |
|
346 | time to print. | |
347 | $ hg diff -r 2:3 | head -n 20 |
|
347 | $ hg diff -r 2:3 | head -n 20 | |
348 | $ hg diff -r 2:6 |
|
348 | $ hg diff -r 2:6 | |
349 | diff -r e989d0fa3764 -r 752e3a0d8488 large.bin |
|
349 | diff -r e989d0fa3764 -r 752e3a0d8488 large.bin | |
350 | --- a/large.bin Thu Jan 01 00:00:00 1970 +0000 |
|
350 | --- a/large.bin Thu Jan 01 00:00:00 1970 +0000 | |
351 | +++ b/large.bin Thu Jan 01 00:00:00 1970 +0000 |
|
351 | +++ b/large.bin Thu Jan 01 00:00:00 1970 +0000 | |
352 | @@ -1,1 +1,1 @@ |
|
352 | @@ -1,1 +1,1 @@ | |
353 | -below lfs threshold |
|
353 | -below lfs threshold | |
354 | +largefile |
|
354 | +largefile | |
355 | diff -r e989d0fa3764 -r 752e3a0d8488 lfs.bin |
|
355 | diff -r e989d0fa3764 -r 752e3a0d8488 lfs.bin | |
356 | --- a/lfs.bin Thu Jan 01 00:00:00 1970 +0000 |
|
356 | --- a/lfs.bin Thu Jan 01 00:00:00 1970 +0000 | |
357 | +++ b/lfs.bin Thu Jan 01 00:00:00 1970 +0000 |
|
357 | +++ b/lfs.bin Thu Jan 01 00:00:00 1970 +0000 | |
358 | @@ -1,1 +1,1 @@ |
|
358 | @@ -1,1 +1,1 @@ | |
359 | -lfs above the lfs threshold for length 0000000000000 |
|
359 | -lfs above the lfs threshold for length 0000000000000 | |
360 | +largefile above lfs threshold 0000000000000000000000 |
|
360 | +largefile above lfs threshold 0000000000000000000000 |
@@ -1,165 +1,165 b'' | |||||
1 | $ . "$TESTDIR/narrow-library.sh" |
|
1 | $ . "$TESTDIR/narrow-library.sh" | |
2 |
|
2 | |||
3 | $ hg init master |
|
3 | $ hg init master | |
4 | $ cd master |
|
4 | $ cd master | |
5 | $ mkdir dir |
|
5 | $ mkdir dir | |
6 | $ mkdir dir/src |
|
6 | $ mkdir dir/src | |
7 | $ cd dir/src |
|
7 | $ cd dir/src | |
8 | $ for x in `$TESTDIR/seq.py 20`; do echo $x > "f$x"; hg add "f$x"; hg commit -m "Commit src $x"; done |
|
8 | $ for x in `$TESTDIR/seq.py 20`; do echo $x > "f$x"; hg add "f$x"; hg commit -m "Commit src $x"; done | |
9 | $ cd .. |
|
9 | $ cd .. | |
10 | $ mkdir tests |
|
10 | $ mkdir tests | |
11 | $ cd tests |
|
11 | $ cd tests | |
12 | $ for x in `$TESTDIR/seq.py 20`; do echo $x > "t$x"; hg add "t$x"; hg commit -m "Commit test $x"; done |
|
12 | $ for x in `$TESTDIR/seq.py 20`; do echo $x > "t$x"; hg add "t$x"; hg commit -m "Commit test $x"; done | |
13 | $ cd ../../.. |
|
13 | $ cd ../../.. | |
14 |
|
14 | |||
15 | narrow clone a file, f10 |
|
15 | narrow clone a file, f10 | |
16 |
|
16 | |||
17 | $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/f10" |
|
17 | $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/f10" | |
18 | requesting all changes |
|
18 | requesting all changes | |
19 | adding changesets |
|
19 | adding changesets | |
20 | adding manifests |
|
20 | adding manifests | |
21 | adding file changes |
|
21 | adding file changes | |
22 | added 40 changesets with 1 changes to 1 files |
|
22 | added 40 changesets with 1 changes to 1 files | |
23 | new changesets *:* (glob) |
|
23 | new changesets *:* (glob) | |
24 | $ cd narrow |
|
24 | $ cd narrow | |
25 | $ cat .hg/requires | grep -v generaldelta |
|
25 | $ cat .hg/requires | grep -v generaldelta | |
26 | dotencode |
|
26 | dotencode | |
27 |
|
|
27 | dirstate-v2 (dirstate-v2 !) | |
28 | fncache |
|
28 | fncache | |
29 | narrowhg-experimental |
|
29 | narrowhg-experimental | |
30 | persistent-nodemap (rust !) |
|
30 | persistent-nodemap (rust !) | |
31 | revlog-compression-zstd (zstd !) |
|
31 | revlog-compression-zstd (zstd !) | |
32 | revlogv1 |
|
32 | revlogv1 | |
33 | sparserevlog |
|
33 | sparserevlog | |
34 | store |
|
34 | store | |
35 | testonly-simplestore (reposimplestore !) |
|
35 | testonly-simplestore (reposimplestore !) | |
36 |
|
36 | |||
37 | $ hg tracked |
|
37 | $ hg tracked | |
38 | I path:dir/src/f10 |
|
38 | I path:dir/src/f10 | |
39 | $ hg update |
|
39 | $ hg update | |
40 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
40 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
41 | $ find * | sort |
|
41 | $ find * | sort | |
42 | dir |
|
42 | dir | |
43 | dir/src |
|
43 | dir/src | |
44 | dir/src/f10 |
|
44 | dir/src/f10 | |
45 | $ cat dir/src/f10 |
|
45 | $ cat dir/src/f10 | |
46 | 10 |
|
46 | 10 | |
47 |
|
47 | |||
48 | $ cd .. |
|
48 | $ cd .. | |
49 |
|
49 | |||
50 | narrow clone a directory, tests/, except tests/t19 |
|
50 | narrow clone a directory, tests/, except tests/t19 | |
51 |
|
51 | |||
52 | $ hg clone --narrow ssh://user@dummy/master narrowdir --noupdate --include "dir/tests/" --exclude "dir/tests/t19" |
|
52 | $ hg clone --narrow ssh://user@dummy/master narrowdir --noupdate --include "dir/tests/" --exclude "dir/tests/t19" | |
53 | requesting all changes |
|
53 | requesting all changes | |
54 | adding changesets |
|
54 | adding changesets | |
55 | adding manifests |
|
55 | adding manifests | |
56 | adding file changes |
|
56 | adding file changes | |
57 | added 40 changesets with 19 changes to 19 files |
|
57 | added 40 changesets with 19 changes to 19 files | |
58 | new changesets *:* (glob) |
|
58 | new changesets *:* (glob) | |
59 | $ cd narrowdir |
|
59 | $ cd narrowdir | |
60 | $ hg tracked |
|
60 | $ hg tracked | |
61 | I path:dir/tests |
|
61 | I path:dir/tests | |
62 | X path:dir/tests/t19 |
|
62 | X path:dir/tests/t19 | |
63 | $ hg update |
|
63 | $ hg update | |
64 | 19 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
64 | 19 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
65 | $ find * | sort |
|
65 | $ find * | sort | |
66 | dir |
|
66 | dir | |
67 | dir/tests |
|
67 | dir/tests | |
68 | dir/tests/t1 |
|
68 | dir/tests/t1 | |
69 | dir/tests/t10 |
|
69 | dir/tests/t10 | |
70 | dir/tests/t11 |
|
70 | dir/tests/t11 | |
71 | dir/tests/t12 |
|
71 | dir/tests/t12 | |
72 | dir/tests/t13 |
|
72 | dir/tests/t13 | |
73 | dir/tests/t14 |
|
73 | dir/tests/t14 | |
74 | dir/tests/t15 |
|
74 | dir/tests/t15 | |
75 | dir/tests/t16 |
|
75 | dir/tests/t16 | |
76 | dir/tests/t17 |
|
76 | dir/tests/t17 | |
77 | dir/tests/t18 |
|
77 | dir/tests/t18 | |
78 | dir/tests/t2 |
|
78 | dir/tests/t2 | |
79 | dir/tests/t20 |
|
79 | dir/tests/t20 | |
80 | dir/tests/t3 |
|
80 | dir/tests/t3 | |
81 | dir/tests/t4 |
|
81 | dir/tests/t4 | |
82 | dir/tests/t5 |
|
82 | dir/tests/t5 | |
83 | dir/tests/t6 |
|
83 | dir/tests/t6 | |
84 | dir/tests/t7 |
|
84 | dir/tests/t7 | |
85 | dir/tests/t8 |
|
85 | dir/tests/t8 | |
86 | dir/tests/t9 |
|
86 | dir/tests/t9 | |
87 |
|
87 | |||
88 | $ cd .. |
|
88 | $ cd .. | |
89 |
|
89 | |||
90 | narrow clone everything but a directory (tests/) |
|
90 | narrow clone everything but a directory (tests/) | |
91 |
|
91 | |||
92 | $ hg clone --narrow ssh://user@dummy/master narrowroot --noupdate --exclude "dir/tests" |
|
92 | $ hg clone --narrow ssh://user@dummy/master narrowroot --noupdate --exclude "dir/tests" | |
93 | requesting all changes |
|
93 | requesting all changes | |
94 | adding changesets |
|
94 | adding changesets | |
95 | adding manifests |
|
95 | adding manifests | |
96 | adding file changes |
|
96 | adding file changes | |
97 | added 40 changesets with 20 changes to 20 files |
|
97 | added 40 changesets with 20 changes to 20 files | |
98 | new changesets *:* (glob) |
|
98 | new changesets *:* (glob) | |
99 | $ cd narrowroot |
|
99 | $ cd narrowroot | |
100 | $ hg tracked |
|
100 | $ hg tracked | |
101 | I path:. |
|
101 | I path:. | |
102 | X path:dir/tests |
|
102 | X path:dir/tests | |
103 | $ hg update |
|
103 | $ hg update | |
104 | 20 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
104 | 20 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
105 | $ find * | sort |
|
105 | $ find * | sort | |
106 | dir |
|
106 | dir | |
107 | dir/src |
|
107 | dir/src | |
108 | dir/src/f1 |
|
108 | dir/src/f1 | |
109 | dir/src/f10 |
|
109 | dir/src/f10 | |
110 | dir/src/f11 |
|
110 | dir/src/f11 | |
111 | dir/src/f12 |
|
111 | dir/src/f12 | |
112 | dir/src/f13 |
|
112 | dir/src/f13 | |
113 | dir/src/f14 |
|
113 | dir/src/f14 | |
114 | dir/src/f15 |
|
114 | dir/src/f15 | |
115 | dir/src/f16 |
|
115 | dir/src/f16 | |
116 | dir/src/f17 |
|
116 | dir/src/f17 | |
117 | dir/src/f18 |
|
117 | dir/src/f18 | |
118 | dir/src/f19 |
|
118 | dir/src/f19 | |
119 | dir/src/f2 |
|
119 | dir/src/f2 | |
120 | dir/src/f20 |
|
120 | dir/src/f20 | |
121 | dir/src/f3 |
|
121 | dir/src/f3 | |
122 | dir/src/f4 |
|
122 | dir/src/f4 | |
123 | dir/src/f5 |
|
123 | dir/src/f5 | |
124 | dir/src/f6 |
|
124 | dir/src/f6 | |
125 | dir/src/f7 |
|
125 | dir/src/f7 | |
126 | dir/src/f8 |
|
126 | dir/src/f8 | |
127 | dir/src/f9 |
|
127 | dir/src/f9 | |
128 |
|
128 | |||
129 | $ cd .. |
|
129 | $ cd .. | |
130 |
|
130 | |||
131 | Testing the --narrowspec flag to clone |
|
131 | Testing the --narrowspec flag to clone | |
132 |
|
132 | |||
133 | $ cat >> narrowspecs <<EOF |
|
133 | $ cat >> narrowspecs <<EOF | |
134 | > %include foo |
|
134 | > %include foo | |
135 | > [include] |
|
135 | > [include] | |
136 | > path:dir/tests/ |
|
136 | > path:dir/tests/ | |
137 | > path:dir/src/f12 |
|
137 | > path:dir/src/f12 | |
138 | > EOF |
|
138 | > EOF | |
139 |
|
139 | |||
140 | $ hg clone ssh://user@dummy/master specfile --narrowspec narrowspecs |
|
140 | $ hg clone ssh://user@dummy/master specfile --narrowspec narrowspecs | |
141 | reading narrowspec from '$TESTTMP/narrowspecs' |
|
141 | reading narrowspec from '$TESTTMP/narrowspecs' | |
142 | config error: cannot specify other files using '%include' in narrowspec |
|
142 | config error: cannot specify other files using '%include' in narrowspec | |
143 | [30] |
|
143 | [30] | |
144 |
|
144 | |||
145 | $ cat > narrowspecs <<EOF |
|
145 | $ cat > narrowspecs <<EOF | |
146 | > [include] |
|
146 | > [include] | |
147 | > path:dir/tests/ |
|
147 | > path:dir/tests/ | |
148 | > path:dir/src/f12 |
|
148 | > path:dir/src/f12 | |
149 | > EOF |
|
149 | > EOF | |
150 |
|
150 | |||
151 | $ hg clone ssh://user@dummy/master specfile --narrowspec narrowspecs |
|
151 | $ hg clone ssh://user@dummy/master specfile --narrowspec narrowspecs | |
152 | reading narrowspec from '$TESTTMP/narrowspecs' |
|
152 | reading narrowspec from '$TESTTMP/narrowspecs' | |
153 | requesting all changes |
|
153 | requesting all changes | |
154 | adding changesets |
|
154 | adding changesets | |
155 | adding manifests |
|
155 | adding manifests | |
156 | adding file changes |
|
156 | adding file changes | |
157 | added 40 changesets with 21 changes to 21 files |
|
157 | added 40 changesets with 21 changes to 21 files | |
158 | new changesets 681085829a73:26ce255d5b5d |
|
158 | new changesets 681085829a73:26ce255d5b5d | |
159 | updating to branch default |
|
159 | updating to branch default | |
160 | 21 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
160 | 21 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
161 | $ cd specfile |
|
161 | $ cd specfile | |
162 | $ hg tracked |
|
162 | $ hg tracked | |
163 | I path:dir/src/f12 |
|
163 | I path:dir/src/f12 | |
164 | I path:dir/tests |
|
164 | I path:dir/tests | |
165 | $ cd .. |
|
165 | $ cd .. |
@@ -1,102 +1,102 b'' | |||||
1 | #testcases tree flat-fncache flat-nofncache |
|
1 | #testcases tree flat-fncache flat-nofncache | |
2 |
|
2 | |||
3 | Tests narrow stream clones |
|
3 | Tests narrow stream clones | |
4 |
|
4 | |||
5 | $ . "$TESTDIR/narrow-library.sh" |
|
5 | $ . "$TESTDIR/narrow-library.sh" | |
6 |
|
6 | |||
7 | #if tree |
|
7 | #if tree | |
8 | $ cat << EOF >> $HGRCPATH |
|
8 | $ cat << EOF >> $HGRCPATH | |
9 | > [experimental] |
|
9 | > [experimental] | |
10 | > treemanifest = 1 |
|
10 | > treemanifest = 1 | |
11 | > EOF |
|
11 | > EOF | |
12 | #endif |
|
12 | #endif | |
13 |
|
13 | |||
14 | #if flat-nofncache |
|
14 | #if flat-nofncache | |
15 | $ cat << EOF >> $HGRCPATH |
|
15 | $ cat << EOF >> $HGRCPATH | |
16 | > [format] |
|
16 | > [format] | |
17 | > usefncache = 0 |
|
17 | > usefncache = 0 | |
18 | > EOF |
|
18 | > EOF | |
19 | #endif |
|
19 | #endif | |
20 |
|
20 | |||
21 | Server setup |
|
21 | Server setup | |
22 |
|
22 | |||
23 | $ hg init master |
|
23 | $ hg init master | |
24 | $ cd master |
|
24 | $ cd master | |
25 | $ mkdir dir |
|
25 | $ mkdir dir | |
26 | $ mkdir dir/src |
|
26 | $ mkdir dir/src | |
27 | $ cd dir/src |
|
27 | $ cd dir/src | |
28 | $ for x in `$TESTDIR/seq.py 20`; do echo $x > "F$x"; hg add "F$x"; hg commit -m "Commit src $x"; done |
|
28 | $ for x in `$TESTDIR/seq.py 20`; do echo $x > "F$x"; hg add "F$x"; hg commit -m "Commit src $x"; done | |
29 |
|
29 | |||
30 | $ cd .. |
|
30 | $ cd .. | |
31 | $ mkdir tests |
|
31 | $ mkdir tests | |
32 | $ cd tests |
|
32 | $ cd tests | |
33 | $ for x in `$TESTDIR/seq.py 20`; do echo $x > "F$x"; hg add "F$x"; hg commit -m "Commit src $x"; done |
|
33 | $ for x in `$TESTDIR/seq.py 20`; do echo $x > "F$x"; hg add "F$x"; hg commit -m "Commit src $x"; done | |
34 | $ cd ../../.. |
|
34 | $ cd ../../.. | |
35 |
|
35 | |||
36 | Trying to stream clone when the server does not support it |
|
36 | Trying to stream clone when the server does not support it | |
37 |
|
37 | |||
38 | $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/F10" --stream |
|
38 | $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/F10" --stream | |
39 | streaming all changes |
|
39 | streaming all changes | |
40 | remote: abort: server does not support narrow stream clones |
|
40 | remote: abort: server does not support narrow stream clones | |
41 | abort: pull failed on remote |
|
41 | abort: pull failed on remote | |
42 | [100] |
|
42 | [100] | |
43 |
|
43 | |||
44 | Enable stream clone on the server |
|
44 | Enable stream clone on the server | |
45 |
|
45 | |||
46 | $ echo "[experimental]" >> master/.hg/hgrc |
|
46 | $ echo "[experimental]" >> master/.hg/hgrc | |
47 | $ echo "server.stream-narrow-clones=True" >> master/.hg/hgrc |
|
47 | $ echo "server.stream-narrow-clones=True" >> master/.hg/hgrc | |
48 |
|
48 | |||
49 | Cloning a specific file when stream clone is supported |
|
49 | Cloning a specific file when stream clone is supported | |
50 |
|
50 | |||
51 | $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/F10" --stream |
|
51 | $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/F10" --stream | |
52 | streaming all changes |
|
52 | streaming all changes | |
53 | * files to transfer, * KB of data (glob) |
|
53 | * files to transfer, * KB of data (glob) | |
54 | transferred * KB in * seconds (* */sec) (glob) |
|
54 | transferred * KB in * seconds (* */sec) (glob) | |
55 |
|
55 | |||
56 | $ cd narrow |
|
56 | $ cd narrow | |
57 | $ ls -A |
|
57 | $ ls -A | |
58 | .hg |
|
58 | .hg | |
59 | $ hg tracked |
|
59 | $ hg tracked | |
60 | I path:dir/src/F10 |
|
60 | I path:dir/src/F10 | |
61 |
|
61 | |||
62 | Making sure we have the correct set of requirements |
|
62 | Making sure we have the correct set of requirements | |
63 |
|
63 | |||
64 | $ cat .hg/requires |
|
64 | $ cat .hg/requires | |
65 | dotencode (tree !) |
|
65 | dotencode (tree !) | |
66 | dotencode (flat-fncache !) |
|
66 | dotencode (flat-fncache !) | |
67 |
|
|
67 | dirstate-v2 (dirstate-v2 !) | |
68 | fncache (tree !) |
|
68 | fncache (tree !) | |
69 | fncache (flat-fncache !) |
|
69 | fncache (flat-fncache !) | |
70 | generaldelta |
|
70 | generaldelta | |
71 | narrowhg-experimental |
|
71 | narrowhg-experimental | |
72 | persistent-nodemap (rust !) |
|
72 | persistent-nodemap (rust !) | |
73 | revlog-compression-zstd (zstd !) |
|
73 | revlog-compression-zstd (zstd !) | |
74 | revlogv1 |
|
74 | revlogv1 | |
75 | sparserevlog |
|
75 | sparserevlog | |
76 | store |
|
76 | store | |
77 | treemanifest (tree !) |
|
77 | treemanifest (tree !) | |
78 |
|
78 | |||
79 | Making sure store has the required files |
|
79 | Making sure store has the required files | |
80 |
|
80 | |||
81 | $ ls .hg/store/ |
|
81 | $ ls .hg/store/ | |
82 | 00changelog.i |
|
82 | 00changelog.i | |
83 | 00manifest.i |
|
83 | 00manifest.i | |
84 | data |
|
84 | data | |
85 | fncache (tree !) |
|
85 | fncache (tree !) | |
86 | fncache (flat-fncache !) |
|
86 | fncache (flat-fncache !) | |
87 | meta (tree !) |
|
87 | meta (tree !) | |
88 | narrowspec |
|
88 | narrowspec | |
89 | undo |
|
89 | undo | |
90 | undo.backupfiles |
|
90 | undo.backupfiles | |
91 | undo.narrowspec |
|
91 | undo.narrowspec | |
92 | undo.phaseroots |
|
92 | undo.phaseroots | |
93 |
|
93 | |||
94 | Checking that repository has all the required data and not broken |
|
94 | Checking that repository has all the required data and not broken | |
95 |
|
95 | |||
96 | $ hg verify |
|
96 | $ hg verify | |
97 | checking changesets |
|
97 | checking changesets | |
98 | checking manifests |
|
98 | checking manifests | |
99 | checking directory manifests (tree !) |
|
99 | checking directory manifests (tree !) | |
100 | crosschecking files in changesets and manifests |
|
100 | crosschecking files in changesets and manifests | |
101 | checking files |
|
101 | checking files | |
102 | checked 40 changesets with 1 changes to 1 files |
|
102 | checked 40 changesets with 1 changes to 1 files |
@@ -1,298 +1,298 b'' | |||||
1 | $ . "$TESTDIR/narrow-library.sh" |
|
1 | $ . "$TESTDIR/narrow-library.sh" | |
2 |
|
2 | |||
3 | $ hg init master |
|
3 | $ hg init master | |
4 | $ cd master |
|
4 | $ cd master | |
5 | $ cat >> .hg/hgrc <<EOF |
|
5 | $ cat >> .hg/hgrc <<EOF | |
6 | > [narrow] |
|
6 | > [narrow] | |
7 | > serveellipses=True |
|
7 | > serveellipses=True | |
8 | > EOF |
|
8 | > EOF | |
9 | $ mkdir dir |
|
9 | $ mkdir dir | |
10 | $ mkdir dir/src |
|
10 | $ mkdir dir/src | |
11 | $ cd dir/src |
|
11 | $ cd dir/src | |
12 | $ for x in `$TESTDIR/seq.py 20`; do echo $x > "f$x"; hg add "f$x"; hg commit -m "Commit src $x"; done |
|
12 | $ for x in `$TESTDIR/seq.py 20`; do echo $x > "f$x"; hg add "f$x"; hg commit -m "Commit src $x"; done | |
13 | $ cd .. |
|
13 | $ cd .. | |
14 | $ mkdir tests |
|
14 | $ mkdir tests | |
15 | $ cd tests |
|
15 | $ cd tests | |
16 | $ for x in `$TESTDIR/seq.py 20`; do echo $x > "t$x"; hg add "t$x"; hg commit -m "Commit test $x"; done |
|
16 | $ for x in `$TESTDIR/seq.py 20`; do echo $x > "t$x"; hg add "t$x"; hg commit -m "Commit test $x"; done | |
17 | $ cd ../../.. |
|
17 | $ cd ../../.. | |
18 |
|
18 | |||
19 | Only path: and rootfilesin: pattern prefixes are allowed |
|
19 | Only path: and rootfilesin: pattern prefixes are allowed | |
20 |
|
20 | |||
21 | $ hg clone --narrow ssh://user@dummy/master badnarrow --noupdate --include 'glob:**' |
|
21 | $ hg clone --narrow ssh://user@dummy/master badnarrow --noupdate --include 'glob:**' | |
22 | abort: invalid prefix on narrow pattern: glob:** |
|
22 | abort: invalid prefix on narrow pattern: glob:** | |
23 | (narrow patterns must begin with one of the following: path:, rootfilesin:) |
|
23 | (narrow patterns must begin with one of the following: path:, rootfilesin:) | |
24 | [255] |
|
24 | [255] | |
25 |
|
25 | |||
26 | $ hg clone --narrow ssh://user@dummy/master badnarrow --noupdate --exclude 'set:ignored' |
|
26 | $ hg clone --narrow ssh://user@dummy/master badnarrow --noupdate --exclude 'set:ignored' | |
27 | abort: invalid prefix on narrow pattern: set:ignored |
|
27 | abort: invalid prefix on narrow pattern: set:ignored | |
28 | (narrow patterns must begin with one of the following: path:, rootfilesin:) |
|
28 | (narrow patterns must begin with one of the following: path:, rootfilesin:) | |
29 | [255] |
|
29 | [255] | |
30 |
|
30 | |||
31 | narrow clone a file, f10 |
|
31 | narrow clone a file, f10 | |
32 |
|
32 | |||
33 | $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/f10" |
|
33 | $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/f10" | |
34 | requesting all changes |
|
34 | requesting all changes | |
35 | adding changesets |
|
35 | adding changesets | |
36 | adding manifests |
|
36 | adding manifests | |
37 | adding file changes |
|
37 | adding file changes | |
38 | added 3 changesets with 1 changes to 1 files |
|
38 | added 3 changesets with 1 changes to 1 files | |
39 | new changesets *:* (glob) |
|
39 | new changesets *:* (glob) | |
40 | $ cd narrow |
|
40 | $ cd narrow | |
41 | $ cat .hg/requires | grep -v generaldelta |
|
41 | $ cat .hg/requires | grep -v generaldelta | |
42 | dotencode |
|
42 | dotencode | |
43 |
|
|
43 | dirstate-v2 (dirstate-v2 !) | |
44 | fncache |
|
44 | fncache | |
45 | narrowhg-experimental |
|
45 | narrowhg-experimental | |
46 | persistent-nodemap (rust !) |
|
46 | persistent-nodemap (rust !) | |
47 | revlog-compression-zstd (zstd !) |
|
47 | revlog-compression-zstd (zstd !) | |
48 | revlogv1 |
|
48 | revlogv1 | |
49 | sparserevlog |
|
49 | sparserevlog | |
50 | store |
|
50 | store | |
51 | testonly-simplestore (reposimplestore !) |
|
51 | testonly-simplestore (reposimplestore !) | |
52 |
|
52 | |||
53 | $ hg tracked |
|
53 | $ hg tracked | |
54 | I path:dir/src/f10 |
|
54 | I path:dir/src/f10 | |
55 | $ hg tracked |
|
55 | $ hg tracked | |
56 | I path:dir/src/f10 |
|
56 | I path:dir/src/f10 | |
57 | $ hg update |
|
57 | $ hg update | |
58 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
58 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
59 | $ find * | sort |
|
59 | $ find * | sort | |
60 | dir |
|
60 | dir | |
61 | dir/src |
|
61 | dir/src | |
62 | dir/src/f10 |
|
62 | dir/src/f10 | |
63 | $ cat dir/src/f10 |
|
63 | $ cat dir/src/f10 | |
64 | 10 |
|
64 | 10 | |
65 |
|
65 | |||
66 | $ cd .. |
|
66 | $ cd .. | |
67 |
|
67 | |||
68 | local-to-local narrow clones work |
|
68 | local-to-local narrow clones work | |
69 |
|
69 | |||
70 | $ hg clone --narrow master narrow-via-localpeer --noupdate --include "dir/src/f10" |
|
70 | $ hg clone --narrow master narrow-via-localpeer --noupdate --include "dir/src/f10" | |
71 | requesting all changes |
|
71 | requesting all changes | |
72 | adding changesets |
|
72 | adding changesets | |
73 | adding manifests |
|
73 | adding manifests | |
74 | adding file changes |
|
74 | adding file changes | |
75 | added 3 changesets with 1 changes to 1 files |
|
75 | added 3 changesets with 1 changes to 1 files | |
76 | new changesets 5d21aaea77f8:26ce255d5b5d |
|
76 | new changesets 5d21aaea77f8:26ce255d5b5d | |
77 | $ hg tracked -R narrow-via-localpeer |
|
77 | $ hg tracked -R narrow-via-localpeer | |
78 | I path:dir/src/f10 |
|
78 | I path:dir/src/f10 | |
79 | $ rm -Rf narrow-via-localpeer |
|
79 | $ rm -Rf narrow-via-localpeer | |
80 |
|
80 | |||
81 | narrow clone with a newline should fail |
|
81 | narrow clone with a newline should fail | |
82 |
|
82 | |||
83 | $ hg clone --narrow ssh://user@dummy/master narrow_fail --noupdate --include 'dir/src/f10 |
|
83 | $ hg clone --narrow ssh://user@dummy/master narrow_fail --noupdate --include 'dir/src/f10 | |
84 | > ' |
|
84 | > ' | |
85 | abort: newlines are not allowed in narrowspec paths |
|
85 | abort: newlines are not allowed in narrowspec paths | |
86 | [255] |
|
86 | [255] | |
87 |
|
87 | |||
88 | narrow clone a directory, tests/, except tests/t19 |
|
88 | narrow clone a directory, tests/, except tests/t19 | |
89 |
|
89 | |||
90 | $ hg clone --narrow ssh://user@dummy/master narrowdir --noupdate --include "dir/tests/" --exclude "dir/tests/t19" |
|
90 | $ hg clone --narrow ssh://user@dummy/master narrowdir --noupdate --include "dir/tests/" --exclude "dir/tests/t19" | |
91 | requesting all changes |
|
91 | requesting all changes | |
92 | adding changesets |
|
92 | adding changesets | |
93 | adding manifests |
|
93 | adding manifests | |
94 | adding file changes |
|
94 | adding file changes | |
95 | added 21 changesets with 19 changes to 19 files |
|
95 | added 21 changesets with 19 changes to 19 files | |
96 | new changesets *:* (glob) |
|
96 | new changesets *:* (glob) | |
97 | $ cd narrowdir |
|
97 | $ cd narrowdir | |
98 | $ hg tracked |
|
98 | $ hg tracked | |
99 | I path:dir/tests |
|
99 | I path:dir/tests | |
100 | X path:dir/tests/t19 |
|
100 | X path:dir/tests/t19 | |
101 | $ hg tracked |
|
101 | $ hg tracked | |
102 | I path:dir/tests |
|
102 | I path:dir/tests | |
103 | X path:dir/tests/t19 |
|
103 | X path:dir/tests/t19 | |
104 | $ hg update |
|
104 | $ hg update | |
105 | 19 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
105 | 19 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
106 | $ find * | sort |
|
106 | $ find * | sort | |
107 | dir |
|
107 | dir | |
108 | dir/tests |
|
108 | dir/tests | |
109 | dir/tests/t1 |
|
109 | dir/tests/t1 | |
110 | dir/tests/t10 |
|
110 | dir/tests/t10 | |
111 | dir/tests/t11 |
|
111 | dir/tests/t11 | |
112 | dir/tests/t12 |
|
112 | dir/tests/t12 | |
113 | dir/tests/t13 |
|
113 | dir/tests/t13 | |
114 | dir/tests/t14 |
|
114 | dir/tests/t14 | |
115 | dir/tests/t15 |
|
115 | dir/tests/t15 | |
116 | dir/tests/t16 |
|
116 | dir/tests/t16 | |
117 | dir/tests/t17 |
|
117 | dir/tests/t17 | |
118 | dir/tests/t18 |
|
118 | dir/tests/t18 | |
119 | dir/tests/t2 |
|
119 | dir/tests/t2 | |
120 | dir/tests/t20 |
|
120 | dir/tests/t20 | |
121 | dir/tests/t3 |
|
121 | dir/tests/t3 | |
122 | dir/tests/t4 |
|
122 | dir/tests/t4 | |
123 | dir/tests/t5 |
|
123 | dir/tests/t5 | |
124 | dir/tests/t6 |
|
124 | dir/tests/t6 | |
125 | dir/tests/t7 |
|
125 | dir/tests/t7 | |
126 | dir/tests/t8 |
|
126 | dir/tests/t8 | |
127 | dir/tests/t9 |
|
127 | dir/tests/t9 | |
128 |
|
128 | |||
129 | $ cd .. |
|
129 | $ cd .. | |
130 |
|
130 | |||
131 | narrow clone everything but a directory (tests/) |
|
131 | narrow clone everything but a directory (tests/) | |
132 |
|
132 | |||
133 | $ hg clone --narrow ssh://user@dummy/master narrowroot --noupdate --exclude "dir/tests" |
|
133 | $ hg clone --narrow ssh://user@dummy/master narrowroot --noupdate --exclude "dir/tests" | |
134 | requesting all changes |
|
134 | requesting all changes | |
135 | adding changesets |
|
135 | adding changesets | |
136 | adding manifests |
|
136 | adding manifests | |
137 | adding file changes |
|
137 | adding file changes | |
138 | added 21 changesets with 20 changes to 20 files |
|
138 | added 21 changesets with 20 changes to 20 files | |
139 | new changesets *:* (glob) |
|
139 | new changesets *:* (glob) | |
140 | $ cd narrowroot |
|
140 | $ cd narrowroot | |
141 | $ hg tracked |
|
141 | $ hg tracked | |
142 | I path:. |
|
142 | I path:. | |
143 | X path:dir/tests |
|
143 | X path:dir/tests | |
144 | $ hg tracked |
|
144 | $ hg tracked | |
145 | I path:. |
|
145 | I path:. | |
146 | X path:dir/tests |
|
146 | X path:dir/tests | |
147 | $ hg update |
|
147 | $ hg update | |
148 | 20 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
148 | 20 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
149 | $ find * | sort |
|
149 | $ find * | sort | |
150 | dir |
|
150 | dir | |
151 | dir/src |
|
151 | dir/src | |
152 | dir/src/f1 |
|
152 | dir/src/f1 | |
153 | dir/src/f10 |
|
153 | dir/src/f10 | |
154 | dir/src/f11 |
|
154 | dir/src/f11 | |
155 | dir/src/f12 |
|
155 | dir/src/f12 | |
156 | dir/src/f13 |
|
156 | dir/src/f13 | |
157 | dir/src/f14 |
|
157 | dir/src/f14 | |
158 | dir/src/f15 |
|
158 | dir/src/f15 | |
159 | dir/src/f16 |
|
159 | dir/src/f16 | |
160 | dir/src/f17 |
|
160 | dir/src/f17 | |
161 | dir/src/f18 |
|
161 | dir/src/f18 | |
162 | dir/src/f19 |
|
162 | dir/src/f19 | |
163 | dir/src/f2 |
|
163 | dir/src/f2 | |
164 | dir/src/f20 |
|
164 | dir/src/f20 | |
165 | dir/src/f3 |
|
165 | dir/src/f3 | |
166 | dir/src/f4 |
|
166 | dir/src/f4 | |
167 | dir/src/f5 |
|
167 | dir/src/f5 | |
168 | dir/src/f6 |
|
168 | dir/src/f6 | |
169 | dir/src/f7 |
|
169 | dir/src/f7 | |
170 | dir/src/f8 |
|
170 | dir/src/f8 | |
171 | dir/src/f9 |
|
171 | dir/src/f9 | |
172 |
|
172 | |||
173 | $ cd .. |
|
173 | $ cd .. | |
174 |
|
174 | |||
175 | narrow clone no paths at all |
|
175 | narrow clone no paths at all | |
176 |
|
176 | |||
177 | $ hg clone --narrow ssh://user@dummy/master narrowempty --noupdate |
|
177 | $ hg clone --narrow ssh://user@dummy/master narrowempty --noupdate | |
178 | requesting all changes |
|
178 | requesting all changes | |
179 | adding changesets |
|
179 | adding changesets | |
180 | adding manifests |
|
180 | adding manifests | |
181 | adding file changes |
|
181 | adding file changes | |
182 | added 1 changesets with 0 changes to 0 files |
|
182 | added 1 changesets with 0 changes to 0 files | |
183 | new changesets * (glob) |
|
183 | new changesets * (glob) | |
184 | $ cd narrowempty |
|
184 | $ cd narrowempty | |
185 | $ hg tracked |
|
185 | $ hg tracked | |
186 | $ hg update |
|
186 | $ hg update | |
187 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
187 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
188 | $ ls -A |
|
188 | $ ls -A | |
189 | .hg |
|
189 | .hg | |
190 |
|
190 | |||
191 | $ cd .. |
|
191 | $ cd .. | |
192 |
|
192 | |||
193 | simple clone |
|
193 | simple clone | |
194 | $ hg clone ssh://user@dummy/master simpleclone |
|
194 | $ hg clone ssh://user@dummy/master simpleclone | |
195 | requesting all changes |
|
195 | requesting all changes | |
196 | adding changesets |
|
196 | adding changesets | |
197 | adding manifests |
|
197 | adding manifests | |
198 | adding file changes |
|
198 | adding file changes | |
199 | added 40 changesets with 40 changes to 40 files |
|
199 | added 40 changesets with 40 changes to 40 files | |
200 | new changesets * (glob) |
|
200 | new changesets * (glob) | |
201 | updating to branch default |
|
201 | updating to branch default | |
202 | 40 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
202 | 40 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
203 | $ cd simpleclone |
|
203 | $ cd simpleclone | |
204 | $ find * | sort |
|
204 | $ find * | sort | |
205 | dir |
|
205 | dir | |
206 | dir/src |
|
206 | dir/src | |
207 | dir/src/f1 |
|
207 | dir/src/f1 | |
208 | dir/src/f10 |
|
208 | dir/src/f10 | |
209 | dir/src/f11 |
|
209 | dir/src/f11 | |
210 | dir/src/f12 |
|
210 | dir/src/f12 | |
211 | dir/src/f13 |
|
211 | dir/src/f13 | |
212 | dir/src/f14 |
|
212 | dir/src/f14 | |
213 | dir/src/f15 |
|
213 | dir/src/f15 | |
214 | dir/src/f16 |
|
214 | dir/src/f16 | |
215 | dir/src/f17 |
|
215 | dir/src/f17 | |
216 | dir/src/f18 |
|
216 | dir/src/f18 | |
217 | dir/src/f19 |
|
217 | dir/src/f19 | |
218 | dir/src/f2 |
|
218 | dir/src/f2 | |
219 | dir/src/f20 |
|
219 | dir/src/f20 | |
220 | dir/src/f3 |
|
220 | dir/src/f3 | |
221 | dir/src/f4 |
|
221 | dir/src/f4 | |
222 | dir/src/f5 |
|
222 | dir/src/f5 | |
223 | dir/src/f6 |
|
223 | dir/src/f6 | |
224 | dir/src/f7 |
|
224 | dir/src/f7 | |
225 | dir/src/f8 |
|
225 | dir/src/f8 | |
226 | dir/src/f9 |
|
226 | dir/src/f9 | |
227 | dir/tests |
|
227 | dir/tests | |
228 | dir/tests/t1 |
|
228 | dir/tests/t1 | |
229 | dir/tests/t10 |
|
229 | dir/tests/t10 | |
230 | dir/tests/t11 |
|
230 | dir/tests/t11 | |
231 | dir/tests/t12 |
|
231 | dir/tests/t12 | |
232 | dir/tests/t13 |
|
232 | dir/tests/t13 | |
233 | dir/tests/t14 |
|
233 | dir/tests/t14 | |
234 | dir/tests/t15 |
|
234 | dir/tests/t15 | |
235 | dir/tests/t16 |
|
235 | dir/tests/t16 | |
236 | dir/tests/t17 |
|
236 | dir/tests/t17 | |
237 | dir/tests/t18 |
|
237 | dir/tests/t18 | |
238 | dir/tests/t19 |
|
238 | dir/tests/t19 | |
239 | dir/tests/t2 |
|
239 | dir/tests/t2 | |
240 | dir/tests/t20 |
|
240 | dir/tests/t20 | |
241 | dir/tests/t3 |
|
241 | dir/tests/t3 | |
242 | dir/tests/t4 |
|
242 | dir/tests/t4 | |
243 | dir/tests/t5 |
|
243 | dir/tests/t5 | |
244 | dir/tests/t6 |
|
244 | dir/tests/t6 | |
245 | dir/tests/t7 |
|
245 | dir/tests/t7 | |
246 | dir/tests/t8 |
|
246 | dir/tests/t8 | |
247 | dir/tests/t9 |
|
247 | dir/tests/t9 | |
248 |
|
248 | |||
249 | $ cd .. |
|
249 | $ cd .. | |
250 |
|
250 | |||
251 | Testing the --narrowspec flag to clone |
|
251 | Testing the --narrowspec flag to clone | |
252 |
|
252 | |||
253 | $ cat >> narrowspecs <<EOF |
|
253 | $ cat >> narrowspecs <<EOF | |
254 | > %include foo |
|
254 | > %include foo | |
255 | > [include] |
|
255 | > [include] | |
256 | > path:dir/tests/ |
|
256 | > path:dir/tests/ | |
257 | > path:dir/src/f12 |
|
257 | > path:dir/src/f12 | |
258 | > EOF |
|
258 | > EOF | |
259 |
|
259 | |||
260 | $ hg clone ssh://user@dummy/master specfile --narrowspec narrowspecs |
|
260 | $ hg clone ssh://user@dummy/master specfile --narrowspec narrowspecs | |
261 | reading narrowspec from '$TESTTMP/narrowspecs' |
|
261 | reading narrowspec from '$TESTTMP/narrowspecs' | |
262 | config error: cannot specify other files using '%include' in narrowspec |
|
262 | config error: cannot specify other files using '%include' in narrowspec | |
263 | [30] |
|
263 | [30] | |
264 |
|
264 | |||
265 | $ cat > narrowspecs <<EOF |
|
265 | $ cat > narrowspecs <<EOF | |
266 | > [include] |
|
266 | > [include] | |
267 | > path:dir/tests/ |
|
267 | > path:dir/tests/ | |
268 | > path:dir/src/f12 |
|
268 | > path:dir/src/f12 | |
269 | > EOF |
|
269 | > EOF | |
270 |
|
270 | |||
271 | $ hg clone ssh://user@dummy/master specfile --narrowspec narrowspecs |
|
271 | $ hg clone ssh://user@dummy/master specfile --narrowspec narrowspecs | |
272 | reading narrowspec from '$TESTTMP/narrowspecs' |
|
272 | reading narrowspec from '$TESTTMP/narrowspecs' | |
273 | requesting all changes |
|
273 | requesting all changes | |
274 | adding changesets |
|
274 | adding changesets | |
275 | adding manifests |
|
275 | adding manifests | |
276 | adding file changes |
|
276 | adding file changes | |
277 | added 23 changesets with 21 changes to 21 files |
|
277 | added 23 changesets with 21 changes to 21 files | |
278 | new changesets c13e3773edb4:26ce255d5b5d |
|
278 | new changesets c13e3773edb4:26ce255d5b5d | |
279 | updating to branch default |
|
279 | updating to branch default | |
280 | 21 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
280 | 21 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
281 | $ cd specfile |
|
281 | $ cd specfile | |
282 | $ hg tracked |
|
282 | $ hg tracked | |
283 | I path:dir/src/f12 |
|
283 | I path:dir/src/f12 | |
284 | I path:dir/tests |
|
284 | I path:dir/tests | |
285 | $ cd .. |
|
285 | $ cd .. | |
286 |
|
286 | |||
287 | Narrow spec with invalid patterns is rejected |
|
287 | Narrow spec with invalid patterns is rejected | |
288 |
|
288 | |||
289 | $ cat > narrowspecs <<EOF |
|
289 | $ cat > narrowspecs <<EOF | |
290 | > [include] |
|
290 | > [include] | |
291 | > glob:** |
|
291 | > glob:** | |
292 | > EOF |
|
292 | > EOF | |
293 |
|
293 | |||
294 | $ hg clone ssh://user@dummy/master badspecfile --narrowspec narrowspecs |
|
294 | $ hg clone ssh://user@dummy/master badspecfile --narrowspec narrowspecs | |
295 | reading narrowspec from '$TESTTMP/narrowspecs' |
|
295 | reading narrowspec from '$TESTTMP/narrowspecs' | |
296 | abort: invalid prefix on narrow pattern: glob:** |
|
296 | abort: invalid prefix on narrow pattern: glob:** | |
297 | (narrow patterns must begin with one of the following: path:, rootfilesin:) |
|
297 | (narrow patterns must begin with one of the following: path:, rootfilesin:) | |
298 | [255] |
|
298 | [255] |
@@ -1,97 +1,97 b'' | |||||
1 | Testing interaction of sparse and narrow when both are enabled on the client |
|
1 | Testing interaction of sparse and narrow when both are enabled on the client | |
2 | side and we do a non-ellipsis clone |
|
2 | side and we do a non-ellipsis clone | |
3 |
|
3 | |||
4 | #testcases tree flat |
|
4 | #testcases tree flat | |
5 | $ . "$TESTDIR/narrow-library.sh" |
|
5 | $ . "$TESTDIR/narrow-library.sh" | |
6 | $ cat << EOF >> $HGRCPATH |
|
6 | $ cat << EOF >> $HGRCPATH | |
7 | > [extensions] |
|
7 | > [extensions] | |
8 | > sparse = |
|
8 | > sparse = | |
9 | > EOF |
|
9 | > EOF | |
10 |
|
10 | |||
11 | #if tree |
|
11 | #if tree | |
12 | $ cat << EOF >> $HGRCPATH |
|
12 | $ cat << EOF >> $HGRCPATH | |
13 | > [experimental] |
|
13 | > [experimental] | |
14 | > treemanifest = 1 |
|
14 | > treemanifest = 1 | |
15 | > EOF |
|
15 | > EOF | |
16 | #endif |
|
16 | #endif | |
17 |
|
17 | |||
18 | $ hg init master |
|
18 | $ hg init master | |
19 | $ cd master |
|
19 | $ cd master | |
20 |
|
20 | |||
21 | $ mkdir inside |
|
21 | $ mkdir inside | |
22 | $ echo 'inside' > inside/f |
|
22 | $ echo 'inside' > inside/f | |
23 | $ hg add inside/f |
|
23 | $ hg add inside/f | |
24 | $ hg commit -m 'add inside' |
|
24 | $ hg commit -m 'add inside' | |
25 |
|
25 | |||
26 | $ mkdir widest |
|
26 | $ mkdir widest | |
27 | $ echo 'widest' > widest/f |
|
27 | $ echo 'widest' > widest/f | |
28 | $ hg add widest/f |
|
28 | $ hg add widest/f | |
29 | $ hg commit -m 'add widest' |
|
29 | $ hg commit -m 'add widest' | |
30 |
|
30 | |||
31 | $ mkdir outside |
|
31 | $ mkdir outside | |
32 | $ echo 'outside' > outside/f |
|
32 | $ echo 'outside' > outside/f | |
33 | $ hg add outside/f |
|
33 | $ hg add outside/f | |
34 | $ hg commit -m 'add outside' |
|
34 | $ hg commit -m 'add outside' | |
35 |
|
35 | |||
36 | $ cd .. |
|
36 | $ cd .. | |
37 |
|
37 | |||
38 | narrow clone the inside file |
|
38 | narrow clone the inside file | |
39 |
|
39 | |||
40 | $ hg clone --narrow ssh://user@dummy/master narrow --include inside/f |
|
40 | $ hg clone --narrow ssh://user@dummy/master narrow --include inside/f | |
41 | requesting all changes |
|
41 | requesting all changes | |
42 | adding changesets |
|
42 | adding changesets | |
43 | adding manifests |
|
43 | adding manifests | |
44 | adding file changes |
|
44 | adding file changes | |
45 | added 3 changesets with 1 changes to 1 files |
|
45 | added 3 changesets with 1 changes to 1 files | |
46 | new changesets *:* (glob) |
|
46 | new changesets *:* (glob) | |
47 | updating to branch default |
|
47 | updating to branch default | |
48 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
48 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
49 | $ cd narrow |
|
49 | $ cd narrow | |
50 | $ hg tracked |
|
50 | $ hg tracked | |
51 | I path:inside/f |
|
51 | I path:inside/f | |
52 | $ hg files |
|
52 | $ hg files | |
53 | inside/f |
|
53 | inside/f | |
54 |
|
54 | |||
55 | XXX: we should have a flag in `hg debugsparse` to list the sparse profile |
|
55 | XXX: we should have a flag in `hg debugsparse` to list the sparse profile | |
56 | $ test -f .hg/sparse |
|
56 | $ test -f .hg/sparse | |
57 | [1] |
|
57 | [1] | |
58 |
|
58 | |||
59 | $ cat .hg/requires |
|
59 | $ cat .hg/requires | |
60 | dotencode |
|
60 | dotencode | |
61 |
|
|
61 | dirstate-v2 (dirstate-v2 !) | |
62 | fncache |
|
62 | fncache | |
63 | generaldelta |
|
63 | generaldelta | |
64 | narrowhg-experimental |
|
64 | narrowhg-experimental | |
65 | persistent-nodemap (rust !) |
|
65 | persistent-nodemap (rust !) | |
66 | revlog-compression-zstd (zstd !) |
|
66 | revlog-compression-zstd (zstd !) | |
67 | revlogv1 |
|
67 | revlogv1 | |
68 | sparserevlog |
|
68 | sparserevlog | |
69 | store |
|
69 | store | |
70 | treemanifest (tree !) |
|
70 | treemanifest (tree !) | |
71 |
|
71 | |||
72 | $ hg debugrebuilddirstate |
|
72 | $ hg debugrebuilddirstate | |
73 |
|
73 | |||
74 | We only make the following assertions for the flat test case since in the |
|
74 | We only make the following assertions for the flat test case since in the | |
75 | treemanifest test case debugsparse fails with "path ends in directory |
|
75 | treemanifest test case debugsparse fails with "path ends in directory | |
76 | separator: outside/" which seems like a bug unrelated to the regression this is |
|
76 | separator: outside/" which seems like a bug unrelated to the regression this is | |
77 | testing for. |
|
77 | testing for. | |
78 |
|
78 | |||
79 | #if flat |
|
79 | #if flat | |
80 | widening with both sparse and narrow is possible |
|
80 | widening with both sparse and narrow is possible | |
81 |
|
81 | |||
82 | $ cat >> .hg/hgrc <<EOF |
|
82 | $ cat >> .hg/hgrc <<EOF | |
83 | > [extensions] |
|
83 | > [extensions] | |
84 | > sparse = |
|
84 | > sparse = | |
85 | > narrow = |
|
85 | > narrow = | |
86 | > EOF |
|
86 | > EOF | |
87 |
|
87 | |||
88 | $ hg debugsparse -X outside/f -X widest/f |
|
88 | $ hg debugsparse -X outside/f -X widest/f | |
89 | $ hg tracked -q --addinclude outside/f |
|
89 | $ hg tracked -q --addinclude outside/f | |
90 | $ find . -name .hg -prune -o -type f -print | sort |
|
90 | $ find . -name .hg -prune -o -type f -print | sort | |
91 | ./inside/f |
|
91 | ./inside/f | |
92 |
|
92 | |||
93 | $ hg debugsparse -d outside/f |
|
93 | $ hg debugsparse -d outside/f | |
94 | $ find . -name .hg -prune -o -type f -print | sort |
|
94 | $ find . -name .hg -prune -o -type f -print | sort | |
95 | ./inside/f |
|
95 | ./inside/f | |
96 | ./outside/f |
|
96 | ./outside/f | |
97 | #endif |
|
97 | #endif |
@@ -1,1060 +1,1060 b'' | |||||
1 | $ cat > $TESTTMP/hook.sh << 'EOF' |
|
1 | $ cat > $TESTTMP/hook.sh << 'EOF' | |
2 | > echo "test-hook-close-phase: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE" |
|
2 | > echo "test-hook-close-phase: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE" | |
3 | > EOF |
|
3 | > EOF | |
4 |
|
4 | |||
5 | $ cat >> $HGRCPATH << EOF |
|
5 | $ cat >> $HGRCPATH << EOF | |
6 | > [extensions] |
|
6 | > [extensions] | |
7 | > phasereport=$TESTDIR/testlib/ext-phase-report.py |
|
7 | > phasereport=$TESTDIR/testlib/ext-phase-report.py | |
8 | > [hooks] |
|
8 | > [hooks] | |
9 | > txnclose-phase.test = sh $TESTTMP/hook.sh |
|
9 | > txnclose-phase.test = sh $TESTTMP/hook.sh | |
10 | > EOF |
|
10 | > EOF | |
11 |
|
11 | |||
12 | $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; } |
|
12 | $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; } | |
13 | $ mkcommit() { |
|
13 | $ mkcommit() { | |
14 | > echo "$1" > "$1" |
|
14 | > echo "$1" > "$1" | |
15 | > hg add "$1" |
|
15 | > hg add "$1" | |
16 | > message="$1" |
|
16 | > message="$1" | |
17 | > shift |
|
17 | > shift | |
18 | > hg ci -m "$message" $* |
|
18 | > hg ci -m "$message" $* | |
19 | > } |
|
19 | > } | |
20 |
|
20 | |||
21 | $ hg init initialrepo |
|
21 | $ hg init initialrepo | |
22 | $ cd initialrepo |
|
22 | $ cd initialrepo | |
23 |
|
23 | |||
24 | Cannot change null revision phase |
|
24 | Cannot change null revision phase | |
25 |
|
25 | |||
26 | $ hg phase --force --secret null |
|
26 | $ hg phase --force --secret null | |
27 | abort: cannot change null revision phase |
|
27 | abort: cannot change null revision phase | |
28 | [255] |
|
28 | [255] | |
29 | $ hg phase null |
|
29 | $ hg phase null | |
30 | -1: public |
|
30 | -1: public | |
31 |
|
31 | |||
32 | $ mkcommit A |
|
32 | $ mkcommit A | |
33 | test-debug-phase: new rev 0: x -> 1 |
|
33 | test-debug-phase: new rev 0: x -> 1 | |
34 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft |
|
34 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft | |
35 |
|
35 | |||
36 | New commit are draft by default |
|
36 | New commit are draft by default | |
37 |
|
37 | |||
38 | $ hglog |
|
38 | $ hglog | |
39 | 0 1 A |
|
39 | 0 1 A | |
40 |
|
40 | |||
41 | Following commit are draft too |
|
41 | Following commit are draft too | |
42 |
|
42 | |||
43 | $ mkcommit B |
|
43 | $ mkcommit B | |
44 | test-debug-phase: new rev 1: x -> 1 |
|
44 | test-debug-phase: new rev 1: x -> 1 | |
45 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> draft |
|
45 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> draft | |
46 |
|
46 | |||
47 | $ hglog |
|
47 | $ hglog | |
48 | 1 1 B |
|
48 | 1 1 B | |
49 | 0 1 A |
|
49 | 0 1 A | |
50 |
|
50 | |||
51 | Working directory phase is secret when its parent is secret. |
|
51 | Working directory phase is secret when its parent is secret. | |
52 |
|
52 | |||
53 | $ hg phase --force --secret . |
|
53 | $ hg phase --force --secret . | |
54 | test-debug-phase: move rev 0: 1 -> 2 |
|
54 | test-debug-phase: move rev 0: 1 -> 2 | |
55 | test-debug-phase: move rev 1: 1 -> 2 |
|
55 | test-debug-phase: move rev 1: 1 -> 2 | |
56 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: draft -> secret |
|
56 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: draft -> secret | |
57 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> secret |
|
57 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> secret | |
58 | $ hg log -r 'wdir()' -T '{phase}\n' |
|
58 | $ hg log -r 'wdir()' -T '{phase}\n' | |
59 | secret |
|
59 | secret | |
60 | $ hg log -r 'wdir() and public()' -T '{phase}\n' |
|
60 | $ hg log -r 'wdir() and public()' -T '{phase}\n' | |
61 | $ hg log -r 'wdir() and draft()' -T '{phase}\n' |
|
61 | $ hg log -r 'wdir() and draft()' -T '{phase}\n' | |
62 | $ hg log -r 'wdir() and secret()' -T '{phase}\n' |
|
62 | $ hg log -r 'wdir() and secret()' -T '{phase}\n' | |
63 | secret |
|
63 | secret | |
64 |
|
64 | |||
65 | Working directory phase is draft when its parent is draft. |
|
65 | Working directory phase is draft when its parent is draft. | |
66 |
|
66 | |||
67 | $ hg phase --draft . |
|
67 | $ hg phase --draft . | |
68 | test-debug-phase: move rev 1: 2 -> 1 |
|
68 | test-debug-phase: move rev 1: 2 -> 1 | |
69 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: secret -> draft |
|
69 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: secret -> draft | |
70 | $ hg log -r 'wdir()' -T '{phase}\n' |
|
70 | $ hg log -r 'wdir()' -T '{phase}\n' | |
71 | draft |
|
71 | draft | |
72 | $ hg log -r 'wdir() and public()' -T '{phase}\n' |
|
72 | $ hg log -r 'wdir() and public()' -T '{phase}\n' | |
73 | $ hg log -r 'wdir() and draft()' -T '{phase}\n' |
|
73 | $ hg log -r 'wdir() and draft()' -T '{phase}\n' | |
74 | draft |
|
74 | draft | |
75 | $ hg log -r 'wdir() and secret()' -T '{phase}\n' |
|
75 | $ hg log -r 'wdir() and secret()' -T '{phase}\n' | |
76 |
|
76 | |||
77 | Working directory phase is secret when a new commit will be created as secret, |
|
77 | Working directory phase is secret when a new commit will be created as secret, | |
78 | even if the parent is draft. |
|
78 | even if the parent is draft. | |
79 |
|
79 | |||
80 | $ hg log -r 'wdir() and secret()' -T '{phase}\n' \ |
|
80 | $ hg log -r 'wdir() and secret()' -T '{phase}\n' \ | |
81 | > --config phases.new-commit='secret' |
|
81 | > --config phases.new-commit='secret' | |
82 | secret |
|
82 | secret | |
83 |
|
83 | |||
84 | Working directory phase is draft when its parent is public. |
|
84 | Working directory phase is draft when its parent is public. | |
85 |
|
85 | |||
86 | $ hg phase --public . |
|
86 | $ hg phase --public . | |
87 | test-debug-phase: move rev 0: 1 -> 0 |
|
87 | test-debug-phase: move rev 0: 1 -> 0 | |
88 | test-debug-phase: move rev 1: 1 -> 0 |
|
88 | test-debug-phase: move rev 1: 1 -> 0 | |
89 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: draft -> public |
|
89 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: draft -> public | |
90 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public |
|
90 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public | |
91 | $ hg log -r 'wdir()' -T '{phase}\n' |
|
91 | $ hg log -r 'wdir()' -T '{phase}\n' | |
92 | draft |
|
92 | draft | |
93 | $ hg log -r 'wdir() and public()' -T '{phase}\n' |
|
93 | $ hg log -r 'wdir() and public()' -T '{phase}\n' | |
94 | $ hg log -r 'wdir() and draft()' -T '{phase}\n' |
|
94 | $ hg log -r 'wdir() and draft()' -T '{phase}\n' | |
95 | draft |
|
95 | draft | |
96 | $ hg log -r 'wdir() and secret()' -T '{phase}\n' |
|
96 | $ hg log -r 'wdir() and secret()' -T '{phase}\n' | |
97 | $ hg log -r 'wdir() and secret()' -T '{phase}\n' \ |
|
97 | $ hg log -r 'wdir() and secret()' -T '{phase}\n' \ | |
98 | > --config phases.new-commit='secret' |
|
98 | > --config phases.new-commit='secret' | |
99 | secret |
|
99 | secret | |
100 |
|
100 | |||
101 | Draft commit are properly created over public one: |
|
101 | Draft commit are properly created over public one: | |
102 |
|
102 | |||
103 | $ hg phase |
|
103 | $ hg phase | |
104 | 1: public |
|
104 | 1: public | |
105 | $ hglog |
|
105 | $ hglog | |
106 | 1 0 B |
|
106 | 1 0 B | |
107 | 0 0 A |
|
107 | 0 0 A | |
108 |
|
108 | |||
109 | $ mkcommit C |
|
109 | $ mkcommit C | |
110 | test-debug-phase: new rev 2: x -> 1 |
|
110 | test-debug-phase: new rev 2: x -> 1 | |
111 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft |
|
111 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft | |
112 | $ mkcommit D |
|
112 | $ mkcommit D | |
113 | test-debug-phase: new rev 3: x -> 1 |
|
113 | test-debug-phase: new rev 3: x -> 1 | |
114 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft |
|
114 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft | |
115 |
|
115 | |||
116 | $ hglog |
|
116 | $ hglog | |
117 | 3 1 D |
|
117 | 3 1 D | |
118 | 2 1 C |
|
118 | 2 1 C | |
119 | 1 0 B |
|
119 | 1 0 B | |
120 | 0 0 A |
|
120 | 0 0 A | |
121 |
|
121 | |||
122 | Test creating changeset as secret |
|
122 | Test creating changeset as secret | |
123 |
|
123 | |||
124 | $ mkcommit E --config phases.new-commit='secret' |
|
124 | $ mkcommit E --config phases.new-commit='secret' | |
125 | test-debug-phase: new rev 4: x -> 2 |
|
125 | test-debug-phase: new rev 4: x -> 2 | |
126 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> secret |
|
126 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> secret | |
127 | $ hglog |
|
127 | $ hglog | |
128 | 4 2 E |
|
128 | 4 2 E | |
129 | 3 1 D |
|
129 | 3 1 D | |
130 | 2 1 C |
|
130 | 2 1 C | |
131 | 1 0 B |
|
131 | 1 0 B | |
132 | 0 0 A |
|
132 | 0 0 A | |
133 |
|
133 | |||
134 | Test the secret property is inherited |
|
134 | Test the secret property is inherited | |
135 |
|
135 | |||
136 | $ mkcommit H |
|
136 | $ mkcommit H | |
137 | test-debug-phase: new rev 5: x -> 2 |
|
137 | test-debug-phase: new rev 5: x -> 2 | |
138 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret |
|
138 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret | |
139 | $ hglog |
|
139 | $ hglog | |
140 | 5 2 H |
|
140 | 5 2 H | |
141 | 4 2 E |
|
141 | 4 2 E | |
142 | 3 1 D |
|
142 | 3 1 D | |
143 | 2 1 C |
|
143 | 2 1 C | |
144 | 1 0 B |
|
144 | 1 0 B | |
145 | 0 0 A |
|
145 | 0 0 A | |
146 |
|
146 | |||
147 | Even on merge |
|
147 | Even on merge | |
148 |
|
148 | |||
149 | $ hg up -q 1 |
|
149 | $ hg up -q 1 | |
150 | $ mkcommit "B'" |
|
150 | $ mkcommit "B'" | |
151 | test-debug-phase: new rev 6: x -> 1 |
|
151 | test-debug-phase: new rev 6: x -> 1 | |
152 | created new head |
|
152 | created new head | |
153 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft |
|
153 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft | |
154 | $ hglog |
|
154 | $ hglog | |
155 | 6 1 B' |
|
155 | 6 1 B' | |
156 | 5 2 H |
|
156 | 5 2 H | |
157 | 4 2 E |
|
157 | 4 2 E | |
158 | 3 1 D |
|
158 | 3 1 D | |
159 | 2 1 C |
|
159 | 2 1 C | |
160 | 1 0 B |
|
160 | 1 0 B | |
161 | 0 0 A |
|
161 | 0 0 A | |
162 | $ hg merge 4 # E |
|
162 | $ hg merge 4 # E | |
163 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
163 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
164 | (branch merge, don't forget to commit) |
|
164 | (branch merge, don't forget to commit) | |
165 | $ hg phase |
|
165 | $ hg phase | |
166 | 6: draft |
|
166 | 6: draft | |
167 | 4: secret |
|
167 | 4: secret | |
168 | $ hg ci -m "merge B' and E" |
|
168 | $ hg ci -m "merge B' and E" | |
169 | test-debug-phase: new rev 7: x -> 2 |
|
169 | test-debug-phase: new rev 7: x -> 2 | |
170 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> secret |
|
170 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> secret | |
171 |
|
171 | |||
172 | $ hglog |
|
172 | $ hglog | |
173 | 7 2 merge B' and E |
|
173 | 7 2 merge B' and E | |
174 | 6 1 B' |
|
174 | 6 1 B' | |
175 | 5 2 H |
|
175 | 5 2 H | |
176 | 4 2 E |
|
176 | 4 2 E | |
177 | 3 1 D |
|
177 | 3 1 D | |
178 | 2 1 C |
|
178 | 2 1 C | |
179 | 1 0 B |
|
179 | 1 0 B | |
180 | 0 0 A |
|
180 | 0 0 A | |
181 |
|
181 | |||
182 | Test secret changeset are not pushed |
|
182 | Test secret changeset are not pushed | |
183 |
|
183 | |||
184 | $ hg init ../push-dest |
|
184 | $ hg init ../push-dest | |
185 | $ cat > ../push-dest/.hg/hgrc << EOF |
|
185 | $ cat > ../push-dest/.hg/hgrc << EOF | |
186 | > [phases] |
|
186 | > [phases] | |
187 | > publish=False |
|
187 | > publish=False | |
188 | > EOF |
|
188 | > EOF | |
189 | $ hg outgoing ../push-dest --template='{rev} {phase} {desc|firstline}\n' |
|
189 | $ hg outgoing ../push-dest --template='{rev} {phase} {desc|firstline}\n' | |
190 | comparing with ../push-dest |
|
190 | comparing with ../push-dest | |
191 | searching for changes |
|
191 | searching for changes | |
192 | 0 public A |
|
192 | 0 public A | |
193 | 1 public B |
|
193 | 1 public B | |
194 | 2 draft C |
|
194 | 2 draft C | |
195 | 3 draft D |
|
195 | 3 draft D | |
196 | 6 draft B' |
|
196 | 6 draft B' | |
197 | $ hg outgoing -r 'branch(default)' ../push-dest --template='{rev} {phase} {desc|firstline}\n' |
|
197 | $ hg outgoing -r 'branch(default)' ../push-dest --template='{rev} {phase} {desc|firstline}\n' | |
198 | comparing with ../push-dest |
|
198 | comparing with ../push-dest | |
199 | searching for changes |
|
199 | searching for changes | |
200 | 0 public A |
|
200 | 0 public A | |
201 | 1 public B |
|
201 | 1 public B | |
202 | 2 draft C |
|
202 | 2 draft C | |
203 | 3 draft D |
|
203 | 3 draft D | |
204 | 6 draft B' |
|
204 | 6 draft B' | |
205 |
|
205 | |||
206 | $ hg push ../push-dest -f # force because we push multiple heads |
|
206 | $ hg push ../push-dest -f # force because we push multiple heads | |
207 | pushing to ../push-dest |
|
207 | pushing to ../push-dest | |
208 | searching for changes |
|
208 | searching for changes | |
209 | adding changesets |
|
209 | adding changesets | |
210 | adding manifests |
|
210 | adding manifests | |
211 | adding file changes |
|
211 | adding file changes | |
212 | added 5 changesets with 5 changes to 5 files (+1 heads) |
|
212 | added 5 changesets with 5 changes to 5 files (+1 heads) | |
213 | test-debug-phase: new rev 0: x -> 0 |
|
213 | test-debug-phase: new rev 0: x -> 0 | |
214 | test-debug-phase: new rev 1: x -> 0 |
|
214 | test-debug-phase: new rev 1: x -> 0 | |
215 | test-debug-phase: new rev 2: x -> 1 |
|
215 | test-debug-phase: new rev 2: x -> 1 | |
216 | test-debug-phase: new rev 3: x -> 1 |
|
216 | test-debug-phase: new rev 3: x -> 1 | |
217 | test-debug-phase: new rev 4: x -> 1 |
|
217 | test-debug-phase: new rev 4: x -> 1 | |
218 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public |
|
218 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public | |
219 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public |
|
219 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public | |
220 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft |
|
220 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> draft | |
221 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft |
|
221 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> draft | |
222 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft |
|
222 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> draft | |
223 | $ hglog |
|
223 | $ hglog | |
224 | 7 2 merge B' and E |
|
224 | 7 2 merge B' and E | |
225 | 6 1 B' |
|
225 | 6 1 B' | |
226 | 5 2 H |
|
226 | 5 2 H | |
227 | 4 2 E |
|
227 | 4 2 E | |
228 | 3 1 D |
|
228 | 3 1 D | |
229 | 2 1 C |
|
229 | 2 1 C | |
230 | 1 0 B |
|
230 | 1 0 B | |
231 | 0 0 A |
|
231 | 0 0 A | |
232 | $ cd ../push-dest |
|
232 | $ cd ../push-dest | |
233 | $ hglog |
|
233 | $ hglog | |
234 | 4 1 B' |
|
234 | 4 1 B' | |
235 | 3 1 D |
|
235 | 3 1 D | |
236 | 2 1 C |
|
236 | 2 1 C | |
237 | 1 0 B |
|
237 | 1 0 B | |
238 | 0 0 A |
|
238 | 0 0 A | |
239 |
|
239 | |||
240 | (Issue3303) |
|
240 | (Issue3303) | |
241 | Check that remote secret changeset are ignore when checking creation of remote heads |
|
241 | Check that remote secret changeset are ignore when checking creation of remote heads | |
242 |
|
242 | |||
243 | We add a secret head into the push destination. This secret head shadows a |
|
243 | We add a secret head into the push destination. This secret head shadows a | |
244 | visible shared between the initial repo and the push destination. |
|
244 | visible shared between the initial repo and the push destination. | |
245 |
|
245 | |||
246 | $ hg up -q 4 # B' |
|
246 | $ hg up -q 4 # B' | |
247 | $ mkcommit Z --config phases.new-commit=secret |
|
247 | $ mkcommit Z --config phases.new-commit=secret | |
248 | test-debug-phase: new rev 5: x -> 2 |
|
248 | test-debug-phase: new rev 5: x -> 2 | |
249 | test-hook-close-phase: 2713879da13d6eea1ff22b442a5a87cb31a7ce6a: -> secret |
|
249 | test-hook-close-phase: 2713879da13d6eea1ff22b442a5a87cb31a7ce6a: -> secret | |
250 | $ hg phase . |
|
250 | $ hg phase . | |
251 | 5: secret |
|
251 | 5: secret | |
252 |
|
252 | |||
253 | We now try to push a new public changeset that descend from the common public |
|
253 | We now try to push a new public changeset that descend from the common public | |
254 | head shadowed by the remote secret head. |
|
254 | head shadowed by the remote secret head. | |
255 |
|
255 | |||
256 | $ cd ../initialrepo |
|
256 | $ cd ../initialrepo | |
257 | $ hg up -q 6 #B' |
|
257 | $ hg up -q 6 #B' | |
258 | $ mkcommit I |
|
258 | $ mkcommit I | |
259 | test-debug-phase: new rev 8: x -> 1 |
|
259 | test-debug-phase: new rev 8: x -> 1 | |
260 | created new head |
|
260 | created new head | |
261 | test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft |
|
261 | test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft | |
262 | $ hg push ../push-dest |
|
262 | $ hg push ../push-dest | |
263 | pushing to ../push-dest |
|
263 | pushing to ../push-dest | |
264 | searching for changes |
|
264 | searching for changes | |
265 | adding changesets |
|
265 | adding changesets | |
266 | adding manifests |
|
266 | adding manifests | |
267 | adding file changes |
|
267 | adding file changes | |
268 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
268 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
269 | test-debug-phase: new rev 6: x -> 1 |
|
269 | test-debug-phase: new rev 6: x -> 1 | |
270 | test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft |
|
270 | test-hook-close-phase: 6d6770faffce199f1fddd1cf87f6f026138cf061: -> draft | |
271 |
|
271 | |||
272 | :note: The "(+1 heads)" is wrong as we do not had any visible head |
|
272 | :note: The "(+1 heads)" is wrong as we do not had any visible head | |
273 |
|
273 | |||
274 | check that branch cache with "served" filter are properly computed and stored |
|
274 | check that branch cache with "served" filter are properly computed and stored | |
275 |
|
275 | |||
276 | $ ls ../push-dest/.hg/cache/branch2* |
|
276 | $ ls ../push-dest/.hg/cache/branch2* | |
277 | ../push-dest/.hg/cache/branch2-base |
|
277 | ../push-dest/.hg/cache/branch2-base | |
278 | ../push-dest/.hg/cache/branch2-served |
|
278 | ../push-dest/.hg/cache/branch2-served | |
279 | $ cat ../push-dest/.hg/cache/branch2-served |
|
279 | $ cat ../push-dest/.hg/cache/branch2-served | |
280 | 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722 |
|
280 | 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722 | |
281 | b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default |
|
281 | b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default | |
282 | 6d6770faffce199f1fddd1cf87f6f026138cf061 o default |
|
282 | 6d6770faffce199f1fddd1cf87f6f026138cf061 o default | |
283 | $ hg heads -R ../push-dest --template '{rev}:{node} {phase}\n' #update visible cache too |
|
283 | $ hg heads -R ../push-dest --template '{rev}:{node} {phase}\n' #update visible cache too | |
284 | 6:6d6770faffce199f1fddd1cf87f6f026138cf061 draft |
|
284 | 6:6d6770faffce199f1fddd1cf87f6f026138cf061 draft | |
285 | 5:2713879da13d6eea1ff22b442a5a87cb31a7ce6a secret |
|
285 | 5:2713879da13d6eea1ff22b442a5a87cb31a7ce6a secret | |
286 | 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e draft |
|
286 | 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e draft | |
287 | $ ls ../push-dest/.hg/cache/branch2* |
|
287 | $ ls ../push-dest/.hg/cache/branch2* | |
288 | ../push-dest/.hg/cache/branch2-base |
|
288 | ../push-dest/.hg/cache/branch2-base | |
289 | ../push-dest/.hg/cache/branch2-served |
|
289 | ../push-dest/.hg/cache/branch2-served | |
290 | ../push-dest/.hg/cache/branch2-visible |
|
290 | ../push-dest/.hg/cache/branch2-visible | |
291 | $ cat ../push-dest/.hg/cache/branch2-served |
|
291 | $ cat ../push-dest/.hg/cache/branch2-served | |
292 | 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722 |
|
292 | 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722 | |
293 | b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default |
|
293 | b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default | |
294 | 6d6770faffce199f1fddd1cf87f6f026138cf061 o default |
|
294 | 6d6770faffce199f1fddd1cf87f6f026138cf061 o default | |
295 | $ cat ../push-dest/.hg/cache/branch2-visible |
|
295 | $ cat ../push-dest/.hg/cache/branch2-visible | |
296 | 6d6770faffce199f1fddd1cf87f6f026138cf061 6 |
|
296 | 6d6770faffce199f1fddd1cf87f6f026138cf061 6 | |
297 | b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default |
|
297 | b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default | |
298 | 2713879da13d6eea1ff22b442a5a87cb31a7ce6a o default |
|
298 | 2713879da13d6eea1ff22b442a5a87cb31a7ce6a o default | |
299 | 6d6770faffce199f1fddd1cf87f6f026138cf061 o default |
|
299 | 6d6770faffce199f1fddd1cf87f6f026138cf061 o default | |
300 |
|
300 | |||
301 |
|
301 | |||
302 | Restore condition prior extra insertion. |
|
302 | Restore condition prior extra insertion. | |
303 | $ hg -q --config extensions.mq= strip . |
|
303 | $ hg -q --config extensions.mq= strip . | |
304 | $ hg up -q 7 |
|
304 | $ hg up -q 7 | |
305 | $ cd .. |
|
305 | $ cd .. | |
306 |
|
306 | |||
307 | Test secret changeset are not pull |
|
307 | Test secret changeset are not pull | |
308 |
|
308 | |||
309 | $ hg init pull-dest |
|
309 | $ hg init pull-dest | |
310 | $ cd pull-dest |
|
310 | $ cd pull-dest | |
311 | $ hg pull ../initialrepo |
|
311 | $ hg pull ../initialrepo | |
312 | pulling from ../initialrepo |
|
312 | pulling from ../initialrepo | |
313 | requesting all changes |
|
313 | requesting all changes | |
314 | adding changesets |
|
314 | adding changesets | |
315 | adding manifests |
|
315 | adding manifests | |
316 | adding file changes |
|
316 | adding file changes | |
317 | added 5 changesets with 5 changes to 5 files (+1 heads) |
|
317 | added 5 changesets with 5 changes to 5 files (+1 heads) | |
318 | new changesets 4a2df7238c3b:cf9fe039dfd6 |
|
318 | new changesets 4a2df7238c3b:cf9fe039dfd6 | |
319 | test-debug-phase: new rev 0: x -> 0 |
|
319 | test-debug-phase: new rev 0: x -> 0 | |
320 | test-debug-phase: new rev 1: x -> 0 |
|
320 | test-debug-phase: new rev 1: x -> 0 | |
321 | test-debug-phase: new rev 2: x -> 0 |
|
321 | test-debug-phase: new rev 2: x -> 0 | |
322 | test-debug-phase: new rev 3: x -> 0 |
|
322 | test-debug-phase: new rev 3: x -> 0 | |
323 | test-debug-phase: new rev 4: x -> 0 |
|
323 | test-debug-phase: new rev 4: x -> 0 | |
324 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public |
|
324 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public | |
325 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public |
|
325 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public | |
326 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public |
|
326 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public | |
327 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public |
|
327 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public | |
328 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public |
|
328 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public | |
329 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
329 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
330 | $ hglog |
|
330 | $ hglog | |
331 | 4 0 B' |
|
331 | 4 0 B' | |
332 | 3 0 D |
|
332 | 3 0 D | |
333 | 2 0 C |
|
333 | 2 0 C | |
334 | 1 0 B |
|
334 | 1 0 B | |
335 | 0 0 A |
|
335 | 0 0 A | |
336 | $ cd .. |
|
336 | $ cd .. | |
337 |
|
337 | |||
338 | But secret can still be bundled explicitly |
|
338 | But secret can still be bundled explicitly | |
339 |
|
339 | |||
340 | $ cd initialrepo |
|
340 | $ cd initialrepo | |
341 | $ hg bundle --base '4^' -r 'children(4)' ../secret-bundle.hg |
|
341 | $ hg bundle --base '4^' -r 'children(4)' ../secret-bundle.hg | |
342 | 4 changesets found |
|
342 | 4 changesets found | |
343 | $ cd .. |
|
343 | $ cd .. | |
344 |
|
344 | |||
345 | Test secret changeset are not cloned |
|
345 | Test secret changeset are not cloned | |
346 | (during local clone) |
|
346 | (during local clone) | |
347 |
|
347 | |||
348 | $ hg clone -qU initialrepo clone-dest |
|
348 | $ hg clone -qU initialrepo clone-dest | |
349 | test-debug-phase: new rev 0: x -> 0 |
|
349 | test-debug-phase: new rev 0: x -> 0 | |
350 | test-debug-phase: new rev 1: x -> 0 |
|
350 | test-debug-phase: new rev 1: x -> 0 | |
351 | test-debug-phase: new rev 2: x -> 0 |
|
351 | test-debug-phase: new rev 2: x -> 0 | |
352 | test-debug-phase: new rev 3: x -> 0 |
|
352 | test-debug-phase: new rev 3: x -> 0 | |
353 | test-debug-phase: new rev 4: x -> 0 |
|
353 | test-debug-phase: new rev 4: x -> 0 | |
354 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public |
|
354 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public | |
355 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public |
|
355 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public | |
356 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public |
|
356 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public | |
357 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public |
|
357 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public | |
358 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public |
|
358 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public | |
359 | $ hglog -R clone-dest |
|
359 | $ hglog -R clone-dest | |
360 | 4 0 B' |
|
360 | 4 0 B' | |
361 | 3 0 D |
|
361 | 3 0 D | |
362 | 2 0 C |
|
362 | 2 0 C | |
363 | 1 0 B |
|
363 | 1 0 B | |
364 | 0 0 A |
|
364 | 0 0 A | |
365 |
|
365 | |||
366 | Test summary |
|
366 | Test summary | |
367 |
|
367 | |||
368 | $ hg summary -R clone-dest --verbose |
|
368 | $ hg summary -R clone-dest --verbose | |
369 | parent: -1:000000000000 (no revision checked out) |
|
369 | parent: -1:000000000000 (no revision checked out) | |
370 | branch: default |
|
370 | branch: default | |
371 | commit: (clean) |
|
371 | commit: (clean) | |
372 | update: 5 new changesets (update) |
|
372 | update: 5 new changesets (update) | |
373 | $ hg summary -R initialrepo |
|
373 | $ hg summary -R initialrepo | |
374 | parent: 7:17a481b3bccb tip |
|
374 | parent: 7:17a481b3bccb tip | |
375 | merge B' and E |
|
375 | merge B' and E | |
376 | branch: default |
|
376 | branch: default | |
377 | commit: (clean) (secret) |
|
377 | commit: (clean) (secret) | |
378 | update: 1 new changesets, 2 branch heads (merge) |
|
378 | update: 1 new changesets, 2 branch heads (merge) | |
379 | phases: 3 draft, 3 secret |
|
379 | phases: 3 draft, 3 secret | |
380 | $ hg summary -R initialrepo --quiet |
|
380 | $ hg summary -R initialrepo --quiet | |
381 | parent: 7:17a481b3bccb tip |
|
381 | parent: 7:17a481b3bccb tip | |
382 | update: 1 new changesets, 2 branch heads (merge) |
|
382 | update: 1 new changesets, 2 branch heads (merge) | |
383 |
|
383 | |||
384 | Test revset |
|
384 | Test revset | |
385 |
|
385 | |||
386 | $ cd initialrepo |
|
386 | $ cd initialrepo | |
387 | $ hglog -r 'public()' |
|
387 | $ hglog -r 'public()' | |
388 | 0 0 A |
|
388 | 0 0 A | |
389 | 1 0 B |
|
389 | 1 0 B | |
390 | $ hglog -r 'draft()' |
|
390 | $ hglog -r 'draft()' | |
391 | 2 1 C |
|
391 | 2 1 C | |
392 | 3 1 D |
|
392 | 3 1 D | |
393 | 6 1 B' |
|
393 | 6 1 B' | |
394 | $ hglog -r 'secret()' |
|
394 | $ hglog -r 'secret()' | |
395 | 4 2 E |
|
395 | 4 2 E | |
396 | 5 2 H |
|
396 | 5 2 H | |
397 | 7 2 merge B' and E |
|
397 | 7 2 merge B' and E | |
398 |
|
398 | |||
399 | test that phase are displayed in log at debug level |
|
399 | test that phase are displayed in log at debug level | |
400 |
|
400 | |||
401 | $ hg log --debug |
|
401 | $ hg log --debug | |
402 | changeset: 7:17a481b3bccb796c0521ae97903d81c52bfee4af |
|
402 | changeset: 7:17a481b3bccb796c0521ae97903d81c52bfee4af | |
403 | tag: tip |
|
403 | tag: tip | |
404 | phase: secret |
|
404 | phase: secret | |
405 | parent: 6:cf9fe039dfd67e829edf6522a45de057b5c86519 |
|
405 | parent: 6:cf9fe039dfd67e829edf6522a45de057b5c86519 | |
406 | parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde |
|
406 | parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde | |
407 | manifest: 7:5e724ffacba267b2ab726c91fc8b650710deaaa8 |
|
407 | manifest: 7:5e724ffacba267b2ab726c91fc8b650710deaaa8 | |
408 | user: test |
|
408 | user: test | |
409 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
409 | date: Thu Jan 01 00:00:00 1970 +0000 | |
410 | files+: C D E |
|
410 | files+: C D E | |
411 | extra: branch=default |
|
411 | extra: branch=default | |
412 | description: |
|
412 | description: | |
413 | merge B' and E |
|
413 | merge B' and E | |
414 |
|
414 | |||
415 |
|
415 | |||
416 | changeset: 6:cf9fe039dfd67e829edf6522a45de057b5c86519 |
|
416 | changeset: 6:cf9fe039dfd67e829edf6522a45de057b5c86519 | |
417 | phase: draft |
|
417 | phase: draft | |
418 | parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 |
|
418 | parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 | |
419 | parent: -1:0000000000000000000000000000000000000000 |
|
419 | parent: -1:0000000000000000000000000000000000000000 | |
420 | manifest: 6:ab8bfef2392903058bf4ebb9e7746e8d7026b27a |
|
420 | manifest: 6:ab8bfef2392903058bf4ebb9e7746e8d7026b27a | |
421 | user: test |
|
421 | user: test | |
422 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
422 | date: Thu Jan 01 00:00:00 1970 +0000 | |
423 | files+: B' |
|
423 | files+: B' | |
424 | extra: branch=default |
|
424 | extra: branch=default | |
425 | description: |
|
425 | description: | |
426 | B' |
|
426 | B' | |
427 |
|
427 | |||
428 |
|
428 | |||
429 | changeset: 5:a030c6be5127abc010fcbff1851536552e6951a8 |
|
429 | changeset: 5:a030c6be5127abc010fcbff1851536552e6951a8 | |
430 | phase: secret |
|
430 | phase: secret | |
431 | parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde |
|
431 | parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde | |
432 | parent: -1:0000000000000000000000000000000000000000 |
|
432 | parent: -1:0000000000000000000000000000000000000000 | |
433 | manifest: 5:5c710aa854874fe3d5fa7192e77bdb314cc08b5a |
|
433 | manifest: 5:5c710aa854874fe3d5fa7192e77bdb314cc08b5a | |
434 | user: test |
|
434 | user: test | |
435 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
435 | date: Thu Jan 01 00:00:00 1970 +0000 | |
436 | files+: H |
|
436 | files+: H | |
437 | extra: branch=default |
|
437 | extra: branch=default | |
438 | description: |
|
438 | description: | |
439 | H |
|
439 | H | |
440 |
|
440 | |||
441 |
|
441 | |||
442 | changeset: 4:a603bfb5a83e312131cebcd05353c217d4d21dde |
|
442 | changeset: 4:a603bfb5a83e312131cebcd05353c217d4d21dde | |
443 | phase: secret |
|
443 | phase: secret | |
444 | parent: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e |
|
444 | parent: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e | |
445 | parent: -1:0000000000000000000000000000000000000000 |
|
445 | parent: -1:0000000000000000000000000000000000000000 | |
446 | manifest: 4:7173fd1c27119750b959e3a0f47ed78abe75d6dc |
|
446 | manifest: 4:7173fd1c27119750b959e3a0f47ed78abe75d6dc | |
447 | user: test |
|
447 | user: test | |
448 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
448 | date: Thu Jan 01 00:00:00 1970 +0000 | |
449 | files+: E |
|
449 | files+: E | |
450 | extra: branch=default |
|
450 | extra: branch=default | |
451 | description: |
|
451 | description: | |
452 | E |
|
452 | E | |
453 |
|
453 | |||
454 |
|
454 | |||
455 | changeset: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e |
|
455 | changeset: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e | |
456 | phase: draft |
|
456 | phase: draft | |
457 | parent: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757 |
|
457 | parent: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757 | |
458 | parent: -1:0000000000000000000000000000000000000000 |
|
458 | parent: -1:0000000000000000000000000000000000000000 | |
459 | manifest: 3:6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c |
|
459 | manifest: 3:6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c | |
460 | user: test |
|
460 | user: test | |
461 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
461 | date: Thu Jan 01 00:00:00 1970 +0000 | |
462 | files+: D |
|
462 | files+: D | |
463 | extra: branch=default |
|
463 | extra: branch=default | |
464 | description: |
|
464 | description: | |
465 | D |
|
465 | D | |
466 |
|
466 | |||
467 |
|
467 | |||
468 | changeset: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757 |
|
468 | changeset: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757 | |
469 | phase: draft |
|
469 | phase: draft | |
470 | parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 |
|
470 | parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 | |
471 | parent: -1:0000000000000000000000000000000000000000 |
|
471 | parent: -1:0000000000000000000000000000000000000000 | |
472 | manifest: 2:66a5a01817fdf5239c273802b5b7618d051c89e4 |
|
472 | manifest: 2:66a5a01817fdf5239c273802b5b7618d051c89e4 | |
473 | user: test |
|
473 | user: test | |
474 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
474 | date: Thu Jan 01 00:00:00 1970 +0000 | |
475 | files+: C |
|
475 | files+: C | |
476 | extra: branch=default |
|
476 | extra: branch=default | |
477 | description: |
|
477 | description: | |
478 | C |
|
478 | C | |
479 |
|
479 | |||
480 |
|
480 | |||
481 | changeset: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 |
|
481 | changeset: 1:27547f69f25460a52fff66ad004e58da7ad3fb56 | |
482 | phase: public |
|
482 | phase: public | |
483 | parent: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256 |
|
483 | parent: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256 | |
484 | parent: -1:0000000000000000000000000000000000000000 |
|
484 | parent: -1:0000000000000000000000000000000000000000 | |
485 | manifest: 1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd |
|
485 | manifest: 1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd | |
486 | user: test |
|
486 | user: test | |
487 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
487 | date: Thu Jan 01 00:00:00 1970 +0000 | |
488 | files+: B |
|
488 | files+: B | |
489 | extra: branch=default |
|
489 | extra: branch=default | |
490 | description: |
|
490 | description: | |
491 | B |
|
491 | B | |
492 |
|
492 | |||
493 |
|
493 | |||
494 | changeset: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256 |
|
494 | changeset: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256 | |
495 | phase: public |
|
495 | phase: public | |
496 | parent: -1:0000000000000000000000000000000000000000 |
|
496 | parent: -1:0000000000000000000000000000000000000000 | |
497 | parent: -1:0000000000000000000000000000000000000000 |
|
497 | parent: -1:0000000000000000000000000000000000000000 | |
498 | manifest: 0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83 |
|
498 | manifest: 0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83 | |
499 | user: test |
|
499 | user: test | |
500 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
500 | date: Thu Jan 01 00:00:00 1970 +0000 | |
501 | files+: A |
|
501 | files+: A | |
502 | extra: branch=default |
|
502 | extra: branch=default | |
503 | description: |
|
503 | description: | |
504 | A |
|
504 | A | |
505 |
|
505 | |||
506 |
|
506 | |||
507 |
|
507 | |||
508 |
|
508 | |||
509 | (Issue3707) |
|
509 | (Issue3707) | |
510 | test invalid phase name |
|
510 | test invalid phase name | |
511 |
|
511 | |||
512 | $ mkcommit I --config phases.new-commit='babar' |
|
512 | $ mkcommit I --config phases.new-commit='babar' | |
513 | transaction abort! |
|
513 | transaction abort! | |
514 | rollback completed |
|
514 | rollback completed | |
515 | config error: phases.new-commit: not a valid phase name ('babar') |
|
515 | config error: phases.new-commit: not a valid phase name ('babar') | |
516 | [30] |
|
516 | [30] | |
517 | Test phase command |
|
517 | Test phase command | |
518 | =================== |
|
518 | =================== | |
519 |
|
519 | |||
520 | initial picture |
|
520 | initial picture | |
521 |
|
521 | |||
522 | $ hg log -G --template "{rev} {phase} {desc}\n" |
|
522 | $ hg log -G --template "{rev} {phase} {desc}\n" | |
523 | @ 7 secret merge B' and E |
|
523 | @ 7 secret merge B' and E | |
524 | |\ |
|
524 | |\ | |
525 | | o 6 draft B' |
|
525 | | o 6 draft B' | |
526 | | | |
|
526 | | | | |
527 | +---o 5 secret H |
|
527 | +---o 5 secret H | |
528 | | | |
|
528 | | | | |
529 | o | 4 secret E |
|
529 | o | 4 secret E | |
530 | | | |
|
530 | | | | |
531 | o | 3 draft D |
|
531 | o | 3 draft D | |
532 | | | |
|
532 | | | | |
533 | o | 2 draft C |
|
533 | o | 2 draft C | |
534 | |/ |
|
534 | |/ | |
535 | o 1 public B |
|
535 | o 1 public B | |
536 | | |
|
536 | | | |
537 | o 0 public A |
|
537 | o 0 public A | |
538 |
|
538 | |||
539 |
|
539 | |||
540 | display changesets phase |
|
540 | display changesets phase | |
541 |
|
541 | |||
542 | (mixing -r and plain rev specification) |
|
542 | (mixing -r and plain rev specification) | |
543 |
|
543 | |||
544 | $ hg phase 1::4 -r 7 |
|
544 | $ hg phase 1::4 -r 7 | |
545 | 1: public |
|
545 | 1: public | |
546 | 2: draft |
|
546 | 2: draft | |
547 | 3: draft |
|
547 | 3: draft | |
548 | 4: secret |
|
548 | 4: secret | |
549 | 7: secret |
|
549 | 7: secret | |
550 |
|
550 | |||
551 |
|
551 | |||
552 | move changeset forward |
|
552 | move changeset forward | |
553 |
|
553 | |||
554 | (with -r option) |
|
554 | (with -r option) | |
555 |
|
555 | |||
556 | $ hg phase --public -r 2 |
|
556 | $ hg phase --public -r 2 | |
557 | test-debug-phase: move rev 2: 1 -> 0 |
|
557 | test-debug-phase: move rev 2: 1 -> 0 | |
558 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public |
|
558 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public | |
559 | $ hg log -G --template "{rev} {phase} {desc}\n" |
|
559 | $ hg log -G --template "{rev} {phase} {desc}\n" | |
560 | @ 7 secret merge B' and E |
|
560 | @ 7 secret merge B' and E | |
561 | |\ |
|
561 | |\ | |
562 | | o 6 draft B' |
|
562 | | o 6 draft B' | |
563 | | | |
|
563 | | | | |
564 | +---o 5 secret H |
|
564 | +---o 5 secret H | |
565 | | | |
|
565 | | | | |
566 | o | 4 secret E |
|
566 | o | 4 secret E | |
567 | | | |
|
567 | | | | |
568 | o | 3 draft D |
|
568 | o | 3 draft D | |
569 | | | |
|
569 | | | | |
570 | o | 2 public C |
|
570 | o | 2 public C | |
571 | |/ |
|
571 | |/ | |
572 | o 1 public B |
|
572 | o 1 public B | |
573 | | |
|
573 | | | |
574 | o 0 public A |
|
574 | o 0 public A | |
575 |
|
575 | |||
576 |
|
576 | |||
577 | move changeset backward |
|
577 | move changeset backward | |
578 |
|
578 | |||
579 | (without -r option) |
|
579 | (without -r option) | |
580 |
|
580 | |||
581 | $ hg phase --draft --force 2 |
|
581 | $ hg phase --draft --force 2 | |
582 | test-debug-phase: move rev 2: 0 -> 1 |
|
582 | test-debug-phase: move rev 2: 0 -> 1 | |
583 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: public -> draft |
|
583 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: public -> draft | |
584 | $ hg log -G --template "{rev} {phase} {desc}\n" |
|
584 | $ hg log -G --template "{rev} {phase} {desc}\n" | |
585 | @ 7 secret merge B' and E |
|
585 | @ 7 secret merge B' and E | |
586 | |\ |
|
586 | |\ | |
587 | | o 6 draft B' |
|
587 | | o 6 draft B' | |
588 | | | |
|
588 | | | | |
589 | +---o 5 secret H |
|
589 | +---o 5 secret H | |
590 | | | |
|
590 | | | | |
591 | o | 4 secret E |
|
591 | o | 4 secret E | |
592 | | | |
|
592 | | | | |
593 | o | 3 draft D |
|
593 | o | 3 draft D | |
594 | | | |
|
594 | | | | |
595 | o | 2 draft C |
|
595 | o | 2 draft C | |
596 | |/ |
|
596 | |/ | |
597 | o 1 public B |
|
597 | o 1 public B | |
598 | | |
|
598 | | | |
599 | o 0 public A |
|
599 | o 0 public A | |
600 |
|
600 | |||
601 |
|
601 | |||
602 | move changeset forward and backward |
|
602 | move changeset forward and backward | |
603 |
|
603 | |||
604 | $ hg phase --draft --force 1::4 |
|
604 | $ hg phase --draft --force 1::4 | |
605 | test-debug-phase: move rev 1: 0 -> 1 |
|
605 | test-debug-phase: move rev 1: 0 -> 1 | |
606 | test-debug-phase: move rev 4: 2 -> 1 |
|
606 | test-debug-phase: move rev 4: 2 -> 1 | |
607 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: public -> draft |
|
607 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: public -> draft | |
608 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft |
|
608 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft | |
609 | $ hg log -G --template "{rev} {phase} {desc}\n" |
|
609 | $ hg log -G --template "{rev} {phase} {desc}\n" | |
610 | @ 7 secret merge B' and E |
|
610 | @ 7 secret merge B' and E | |
611 | |\ |
|
611 | |\ | |
612 | | o 6 draft B' |
|
612 | | o 6 draft B' | |
613 | | | |
|
613 | | | | |
614 | +---o 5 secret H |
|
614 | +---o 5 secret H | |
615 | | | |
|
615 | | | | |
616 | o | 4 draft E |
|
616 | o | 4 draft E | |
617 | | | |
|
617 | | | | |
618 | o | 3 draft D |
|
618 | o | 3 draft D | |
619 | | | |
|
619 | | | | |
620 | o | 2 draft C |
|
620 | o | 2 draft C | |
621 | |/ |
|
621 | |/ | |
622 | o 1 draft B |
|
622 | o 1 draft B | |
623 | | |
|
623 | | | |
624 | o 0 public A |
|
624 | o 0 public A | |
625 |
|
625 | |||
626 | test partial failure |
|
626 | test partial failure | |
627 |
|
627 | |||
628 | $ hg phase --public 7 |
|
628 | $ hg phase --public 7 | |
629 | test-debug-phase: move rev 1: 1 -> 0 |
|
629 | test-debug-phase: move rev 1: 1 -> 0 | |
630 | test-debug-phase: move rev 2: 1 -> 0 |
|
630 | test-debug-phase: move rev 2: 1 -> 0 | |
631 | test-debug-phase: move rev 3: 1 -> 0 |
|
631 | test-debug-phase: move rev 3: 1 -> 0 | |
632 | test-debug-phase: move rev 4: 1 -> 0 |
|
632 | test-debug-phase: move rev 4: 1 -> 0 | |
633 | test-debug-phase: move rev 6: 1 -> 0 |
|
633 | test-debug-phase: move rev 6: 1 -> 0 | |
634 | test-debug-phase: move rev 7: 2 -> 0 |
|
634 | test-debug-phase: move rev 7: 2 -> 0 | |
635 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public |
|
635 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: draft -> public | |
636 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public |
|
636 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: draft -> public | |
637 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: draft -> public |
|
637 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: draft -> public | |
638 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: draft -> public |
|
638 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: draft -> public | |
639 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: draft -> public |
|
639 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: draft -> public | |
640 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> public |
|
640 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> public | |
641 | $ hg phase --draft '5 or 7' |
|
641 | $ hg phase --draft '5 or 7' | |
642 | test-debug-phase: move rev 5: 2 -> 1 |
|
642 | test-debug-phase: move rev 5: 2 -> 1 | |
643 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: secret -> draft |
|
643 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: secret -> draft | |
644 | cannot move 1 changesets to a higher phase, use --force |
|
644 | cannot move 1 changesets to a higher phase, use --force | |
645 | phase changed for 1 changesets |
|
645 | phase changed for 1 changesets | |
646 | [1] |
|
646 | [1] | |
647 | $ hg log -G --template "{rev} {phase} {desc}\n" |
|
647 | $ hg log -G --template "{rev} {phase} {desc}\n" | |
648 | @ 7 public merge B' and E |
|
648 | @ 7 public merge B' and E | |
649 | |\ |
|
649 | |\ | |
650 | | o 6 public B' |
|
650 | | o 6 public B' | |
651 | | | |
|
651 | | | | |
652 | +---o 5 draft H |
|
652 | +---o 5 draft H | |
653 | | | |
|
653 | | | | |
654 | o | 4 public E |
|
654 | o | 4 public E | |
655 | | | |
|
655 | | | | |
656 | o | 3 public D |
|
656 | o | 3 public D | |
657 | | | |
|
657 | | | | |
658 | o | 2 public C |
|
658 | o | 2 public C | |
659 | |/ |
|
659 | |/ | |
660 | o 1 public B |
|
660 | o 1 public B | |
661 | | |
|
661 | | | |
662 | o 0 public A |
|
662 | o 0 public A | |
663 |
|
663 | |||
664 |
|
664 | |||
665 | test complete failure |
|
665 | test complete failure | |
666 |
|
666 | |||
667 | $ hg phase --draft 7 |
|
667 | $ hg phase --draft 7 | |
668 | cannot move 1 changesets to a higher phase, use --force |
|
668 | cannot move 1 changesets to a higher phase, use --force | |
669 | no phases changed |
|
669 | no phases changed | |
670 | [1] |
|
670 | [1] | |
671 |
|
671 | |||
672 | $ cd .. |
|
672 | $ cd .. | |
673 |
|
673 | |||
674 | test hidden changeset are not cloned as public (issue3935) |
|
674 | test hidden changeset are not cloned as public (issue3935) | |
675 |
|
675 | |||
676 | $ cd initialrepo |
|
676 | $ cd initialrepo | |
677 |
|
677 | |||
678 | (enabling evolution) |
|
678 | (enabling evolution) | |
679 | $ cat >> $HGRCPATH << EOF |
|
679 | $ cat >> $HGRCPATH << EOF | |
680 | > [experimental] |
|
680 | > [experimental] | |
681 | > evolution.createmarkers=True |
|
681 | > evolution.createmarkers=True | |
682 | > EOF |
|
682 | > EOF | |
683 |
|
683 | |||
684 | (making a changeset hidden; H in that case) |
|
684 | (making a changeset hidden; H in that case) | |
685 | $ hg debugobsolete `hg id --debug -r 5` |
|
685 | $ hg debugobsolete `hg id --debug -r 5` | |
686 | 1 new obsolescence markers |
|
686 | 1 new obsolescence markers | |
687 | obsoleted 1 changesets |
|
687 | obsoleted 1 changesets | |
688 |
|
688 | |||
689 | $ cd .. |
|
689 | $ cd .. | |
690 | $ hg clone initialrepo clonewithobs |
|
690 | $ hg clone initialrepo clonewithobs | |
691 | requesting all changes |
|
691 | requesting all changes | |
692 | adding changesets |
|
692 | adding changesets | |
693 | adding manifests |
|
693 | adding manifests | |
694 | adding file changes |
|
694 | adding file changes | |
695 | added 7 changesets with 6 changes to 6 files |
|
695 | added 7 changesets with 6 changes to 6 files | |
696 | new changesets 4a2df7238c3b:17a481b3bccb |
|
696 | new changesets 4a2df7238c3b:17a481b3bccb | |
697 | test-debug-phase: new rev 0: x -> 0 |
|
697 | test-debug-phase: new rev 0: x -> 0 | |
698 | test-debug-phase: new rev 1: x -> 0 |
|
698 | test-debug-phase: new rev 1: x -> 0 | |
699 | test-debug-phase: new rev 2: x -> 0 |
|
699 | test-debug-phase: new rev 2: x -> 0 | |
700 | test-debug-phase: new rev 3: x -> 0 |
|
700 | test-debug-phase: new rev 3: x -> 0 | |
701 | test-debug-phase: new rev 4: x -> 0 |
|
701 | test-debug-phase: new rev 4: x -> 0 | |
702 | test-debug-phase: new rev 5: x -> 0 |
|
702 | test-debug-phase: new rev 5: x -> 0 | |
703 | test-debug-phase: new rev 6: x -> 0 |
|
703 | test-debug-phase: new rev 6: x -> 0 | |
704 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public |
|
704 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> public | |
705 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public |
|
705 | test-hook-close-phase: 27547f69f25460a52fff66ad004e58da7ad3fb56: -> public | |
706 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public |
|
706 | test-hook-close-phase: f838bfaca5c7226600ebcfd84f3c3c13a28d3757: -> public | |
707 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public |
|
707 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: -> public | |
708 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> public |
|
708 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: -> public | |
709 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public |
|
709 | test-hook-close-phase: cf9fe039dfd67e829edf6522a45de057b5c86519: -> public | |
710 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> public |
|
710 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: -> public | |
711 | updating to branch default |
|
711 | updating to branch default | |
712 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
712 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
713 | $ cd clonewithobs |
|
713 | $ cd clonewithobs | |
714 | $ hg log -G --template "{rev} {phase} {desc}\n" |
|
714 | $ hg log -G --template "{rev} {phase} {desc}\n" | |
715 | @ 6 public merge B' and E |
|
715 | @ 6 public merge B' and E | |
716 | |\ |
|
716 | |\ | |
717 | | o 5 public B' |
|
717 | | o 5 public B' | |
718 | | | |
|
718 | | | | |
719 | o | 4 public E |
|
719 | o | 4 public E | |
720 | | | |
|
720 | | | | |
721 | o | 3 public D |
|
721 | o | 3 public D | |
722 | | | |
|
722 | | | | |
723 | o | 2 public C |
|
723 | o | 2 public C | |
724 | |/ |
|
724 | |/ | |
725 | o 1 public B |
|
725 | o 1 public B | |
726 | | |
|
726 | | | |
727 | o 0 public A |
|
727 | o 0 public A | |
728 |
|
728 | |||
729 |
|
729 | |||
730 | test verify repo containing hidden changesets, which should not abort just |
|
730 | test verify repo containing hidden changesets, which should not abort just | |
731 | because repo.cancopy() is False |
|
731 | because repo.cancopy() is False | |
732 |
|
732 | |||
733 | $ cd ../initialrepo |
|
733 | $ cd ../initialrepo | |
734 | $ hg verify |
|
734 | $ hg verify | |
735 | checking changesets |
|
735 | checking changesets | |
736 | checking manifests |
|
736 | checking manifests | |
737 | crosschecking files in changesets and manifests |
|
737 | crosschecking files in changesets and manifests | |
738 | checking files |
|
738 | checking files | |
739 | checked 8 changesets with 7 changes to 7 files |
|
739 | checked 8 changesets with 7 changes to 7 files | |
740 |
|
740 | |||
741 | $ cd .. |
|
741 | $ cd .. | |
742 |
|
742 | |||
743 | check whether HG_PENDING makes pending changes only in related |
|
743 | check whether HG_PENDING makes pending changes only in related | |
744 | repositories visible to an external hook. |
|
744 | repositories visible to an external hook. | |
745 |
|
745 | |||
746 | (emulate a transaction running concurrently by copied |
|
746 | (emulate a transaction running concurrently by copied | |
747 | .hg/phaseroots.pending in subsequent test) |
|
747 | .hg/phaseroots.pending in subsequent test) | |
748 |
|
748 | |||
749 | $ cat > $TESTTMP/savepending.sh <<EOF |
|
749 | $ cat > $TESTTMP/savepending.sh <<EOF | |
750 | > cp .hg/store/phaseroots.pending .hg/store/phaseroots.pending.saved |
|
750 | > cp .hg/store/phaseroots.pending .hg/store/phaseroots.pending.saved | |
751 | > exit 1 # to avoid changing phase for subsequent tests |
|
751 | > exit 1 # to avoid changing phase for subsequent tests | |
752 | > EOF |
|
752 | > EOF | |
753 | $ cd push-dest |
|
753 | $ cd push-dest | |
754 | $ hg phase 6 |
|
754 | $ hg phase 6 | |
755 | 6: draft |
|
755 | 6: draft | |
756 | $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" phase -f -s 6 |
|
756 | $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" phase -f -s 6 | |
757 | transaction abort! |
|
757 | transaction abort! | |
758 | rollback completed |
|
758 | rollback completed | |
759 | abort: pretxnclose hook exited with status 1 |
|
759 | abort: pretxnclose hook exited with status 1 | |
760 | [40] |
|
760 | [40] | |
761 | $ cp .hg/store/phaseroots.pending.saved .hg/store/phaseroots.pending |
|
761 | $ cp .hg/store/phaseroots.pending.saved .hg/store/phaseroots.pending | |
762 |
|
762 | |||
763 | (check (in)visibility of phaseroot while transaction running in repo) |
|
763 | (check (in)visibility of phaseroot while transaction running in repo) | |
764 |
|
764 | |||
765 | $ cat > $TESTTMP/checkpending.sh <<EOF |
|
765 | $ cat > $TESTTMP/checkpending.sh <<EOF | |
766 | > echo '@initialrepo' |
|
766 | > echo '@initialrepo' | |
767 | > hg -R "$TESTTMP/initialrepo" phase 7 |
|
767 | > hg -R "$TESTTMP/initialrepo" phase 7 | |
768 | > echo '@push-dest' |
|
768 | > echo '@push-dest' | |
769 | > hg -R "$TESTTMP/push-dest" phase 6 |
|
769 | > hg -R "$TESTTMP/push-dest" phase 6 | |
770 | > exit 1 # to avoid changing phase for subsequent tests |
|
770 | > exit 1 # to avoid changing phase for subsequent tests | |
771 | > EOF |
|
771 | > EOF | |
772 | $ cd ../initialrepo |
|
772 | $ cd ../initialrepo | |
773 | $ hg phase 7 |
|
773 | $ hg phase 7 | |
774 | 7: public |
|
774 | 7: public | |
775 | $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" phase -f -s 7 |
|
775 | $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" phase -f -s 7 | |
776 | @initialrepo |
|
776 | @initialrepo | |
777 | 7: secret |
|
777 | 7: secret | |
778 | @push-dest |
|
778 | @push-dest | |
779 | 6: draft |
|
779 | 6: draft | |
780 | transaction abort! |
|
780 | transaction abort! | |
781 | rollback completed |
|
781 | rollback completed | |
782 | abort: pretxnclose hook exited with status 1 |
|
782 | abort: pretxnclose hook exited with status 1 | |
783 | [40] |
|
783 | [40] | |
784 |
|
784 | |||
785 | Check that pretxnclose-phase hook can control phase movement |
|
785 | Check that pretxnclose-phase hook can control phase movement | |
786 |
|
786 | |||
787 | $ hg phase --force b3325c91a4d9 --secret |
|
787 | $ hg phase --force b3325c91a4d9 --secret | |
788 | test-debug-phase: move rev 3: 0 -> 2 |
|
788 | test-debug-phase: move rev 3: 0 -> 2 | |
789 | test-debug-phase: move rev 4: 0 -> 2 |
|
789 | test-debug-phase: move rev 4: 0 -> 2 | |
790 | test-debug-phase: move rev 5: 1 -> 2 |
|
790 | test-debug-phase: move rev 5: 1 -> 2 | |
791 | test-debug-phase: move rev 7: 0 -> 2 |
|
791 | test-debug-phase: move rev 7: 0 -> 2 | |
792 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: public -> secret |
|
792 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: public -> secret | |
793 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: public -> secret |
|
793 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: public -> secret | |
794 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: draft -> secret |
|
794 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: draft -> secret | |
795 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: public -> secret |
|
795 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: public -> secret | |
796 | $ hg log -G -T phases |
|
796 | $ hg log -G -T phases | |
797 | @ changeset: 7:17a481b3bccb |
|
797 | @ changeset: 7:17a481b3bccb | |
798 | |\ tag: tip |
|
798 | |\ tag: tip | |
799 | | | phase: secret |
|
799 | | | phase: secret | |
800 | | | parent: 6:cf9fe039dfd6 |
|
800 | | | parent: 6:cf9fe039dfd6 | |
801 | | | parent: 4:a603bfb5a83e |
|
801 | | | parent: 4:a603bfb5a83e | |
802 | | | user: test |
|
802 | | | user: test | |
803 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
803 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
804 | | | summary: merge B' and E |
|
804 | | | summary: merge B' and E | |
805 | | | |
|
805 | | | | |
806 | | o changeset: 6:cf9fe039dfd6 |
|
806 | | o changeset: 6:cf9fe039dfd6 | |
807 | | | phase: public |
|
807 | | | phase: public | |
808 | | | parent: 1:27547f69f254 |
|
808 | | | parent: 1:27547f69f254 | |
809 | | | user: test |
|
809 | | | user: test | |
810 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
810 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
811 | | | summary: B' |
|
811 | | | summary: B' | |
812 | | | |
|
812 | | | | |
813 | o | changeset: 4:a603bfb5a83e |
|
813 | o | changeset: 4:a603bfb5a83e | |
814 | | | phase: secret |
|
814 | | | phase: secret | |
815 | | | user: test |
|
815 | | | user: test | |
816 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
816 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
817 | | | summary: E |
|
817 | | | summary: E | |
818 | | | |
|
818 | | | | |
819 | o | changeset: 3:b3325c91a4d9 |
|
819 | o | changeset: 3:b3325c91a4d9 | |
820 | | | phase: secret |
|
820 | | | phase: secret | |
821 | | | user: test |
|
821 | | | user: test | |
822 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
822 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
823 | | | summary: D |
|
823 | | | summary: D | |
824 | | | |
|
824 | | | | |
825 | o | changeset: 2:f838bfaca5c7 |
|
825 | o | changeset: 2:f838bfaca5c7 | |
826 | |/ phase: public |
|
826 | |/ phase: public | |
827 | | user: test |
|
827 | | user: test | |
828 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
828 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
829 | | summary: C |
|
829 | | summary: C | |
830 | | |
|
830 | | | |
831 | o changeset: 1:27547f69f254 |
|
831 | o changeset: 1:27547f69f254 | |
832 | | phase: public |
|
832 | | phase: public | |
833 | | user: test |
|
833 | | user: test | |
834 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
834 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
835 | | summary: B |
|
835 | | summary: B | |
836 | | |
|
836 | | | |
837 | o changeset: 0:4a2df7238c3b |
|
837 | o changeset: 0:4a2df7238c3b | |
838 | phase: public |
|
838 | phase: public | |
839 | user: test |
|
839 | user: test | |
840 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
840 | date: Thu Jan 01 00:00:00 1970 +0000 | |
841 | summary: A |
|
841 | summary: A | |
842 |
|
842 | |||
843 |
|
843 | |||
844 | Install a hook that prevent b3325c91a4d9 to become public |
|
844 | Install a hook that prevent b3325c91a4d9 to become public | |
845 |
|
845 | |||
846 | $ cat >> .hg/hgrc << EOF |
|
846 | $ cat >> .hg/hgrc << EOF | |
847 | > [hooks] |
|
847 | > [hooks] | |
848 | > pretxnclose-phase.nopublish_D = sh -c "(echo \$HG_NODE| grep -v b3325c91a4d9>/dev/null) || [ 'public' != \$HG_PHASE ]" |
|
848 | > pretxnclose-phase.nopublish_D = sh -c "(echo \$HG_NODE| grep -v b3325c91a4d9>/dev/null) || [ 'public' != \$HG_PHASE ]" | |
849 | > EOF |
|
849 | > EOF | |
850 |
|
850 | |||
851 | Try various actions. only the draft move should succeed |
|
851 | Try various actions. only the draft move should succeed | |
852 |
|
852 | |||
853 | $ hg phase --public b3325c91a4d9 |
|
853 | $ hg phase --public b3325c91a4d9 | |
854 | transaction abort! |
|
854 | transaction abort! | |
855 | rollback completed |
|
855 | rollback completed | |
856 | abort: pretxnclose-phase.nopublish_D hook exited with status 1 |
|
856 | abort: pretxnclose-phase.nopublish_D hook exited with status 1 | |
857 | [40] |
|
857 | [40] | |
858 | $ hg phase --public a603bfb5a83e |
|
858 | $ hg phase --public a603bfb5a83e | |
859 | transaction abort! |
|
859 | transaction abort! | |
860 | rollback completed |
|
860 | rollback completed | |
861 | abort: pretxnclose-phase.nopublish_D hook exited with status 1 |
|
861 | abort: pretxnclose-phase.nopublish_D hook exited with status 1 | |
862 | [40] |
|
862 | [40] | |
863 | $ hg phase --draft 17a481b3bccb |
|
863 | $ hg phase --draft 17a481b3bccb | |
864 | test-debug-phase: move rev 3: 2 -> 1 |
|
864 | test-debug-phase: move rev 3: 2 -> 1 | |
865 | test-debug-phase: move rev 4: 2 -> 1 |
|
865 | test-debug-phase: move rev 4: 2 -> 1 | |
866 | test-debug-phase: move rev 7: 2 -> 1 |
|
866 | test-debug-phase: move rev 7: 2 -> 1 | |
867 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: secret -> draft |
|
867 | test-hook-close-phase: b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e: secret -> draft | |
868 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft |
|
868 | test-hook-close-phase: a603bfb5a83e312131cebcd05353c217d4d21dde: secret -> draft | |
869 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> draft |
|
869 | test-hook-close-phase: 17a481b3bccb796c0521ae97903d81c52bfee4af: secret -> draft | |
870 | $ hg phase --public 17a481b3bccb |
|
870 | $ hg phase --public 17a481b3bccb | |
871 | transaction abort! |
|
871 | transaction abort! | |
872 | rollback completed |
|
872 | rollback completed | |
873 | abort: pretxnclose-phase.nopublish_D hook exited with status 1 |
|
873 | abort: pretxnclose-phase.nopublish_D hook exited with status 1 | |
874 | [40] |
|
874 | [40] | |
875 |
|
875 | |||
876 | $ cd .. |
|
876 | $ cd .. | |
877 |
|
877 | |||
878 | Test for the "internal" phase |
|
878 | Test for the "internal" phase | |
879 | ============================= |
|
879 | ============================= | |
880 |
|
880 | |||
881 | Check we deny its usage on older repository |
|
881 | Check we deny its usage on older repository | |
882 |
|
882 | |||
883 | $ hg init no-internal-phase --config format.internal-phase=no |
|
883 | $ hg init no-internal-phase --config format.internal-phase=no | |
884 | $ cd no-internal-phase |
|
884 | $ cd no-internal-phase | |
885 | $ cat .hg/requires |
|
885 | $ cat .hg/requires | |
886 | dotencode |
|
886 | dotencode | |
887 |
|
|
887 | dirstate-v2 (dirstate-v2 !) | |
888 | fncache |
|
888 | fncache | |
889 | generaldelta |
|
889 | generaldelta | |
890 | persistent-nodemap (rust !) |
|
890 | persistent-nodemap (rust !) | |
891 | revlog-compression-zstd (zstd !) |
|
891 | revlog-compression-zstd (zstd !) | |
892 | revlogv1 |
|
892 | revlogv1 | |
893 | sparserevlog |
|
893 | sparserevlog | |
894 | store |
|
894 | store | |
895 | $ echo X > X |
|
895 | $ echo X > X | |
896 | $ hg add X |
|
896 | $ hg add X | |
897 | $ hg status |
|
897 | $ hg status | |
898 | A X |
|
898 | A X | |
899 | $ hg --config "phases.new-commit=internal" commit -m "my test internal commit" 2>&1 | grep ProgrammingError |
|
899 | $ hg --config "phases.new-commit=internal" commit -m "my test internal commit" 2>&1 | grep ProgrammingError | |
900 | ** ProgrammingError: this repository does not support the internal phase |
|
900 | ** ProgrammingError: this repository does not support the internal phase | |
901 | raise error.ProgrammingError(msg) (no-pyoxidizer !) |
|
901 | raise error.ProgrammingError(msg) (no-pyoxidizer !) | |
902 | *ProgrammingError: this repository does not support the internal phase (glob) |
|
902 | *ProgrammingError: this repository does not support the internal phase (glob) | |
903 | $ hg --config "phases.new-commit=archived" commit -m "my test archived commit" 2>&1 | grep ProgrammingError |
|
903 | $ hg --config "phases.new-commit=archived" commit -m "my test archived commit" 2>&1 | grep ProgrammingError | |
904 | ** ProgrammingError: this repository does not support the archived phase |
|
904 | ** ProgrammingError: this repository does not support the archived phase | |
905 | raise error.ProgrammingError(msg) (no-pyoxidizer !) |
|
905 | raise error.ProgrammingError(msg) (no-pyoxidizer !) | |
906 | *ProgrammingError: this repository does not support the archived phase (glob) |
|
906 | *ProgrammingError: this repository does not support the archived phase (glob) | |
907 |
|
907 | |||
908 | $ cd .. |
|
908 | $ cd .. | |
909 |
|
909 | |||
910 | Check it works fine with repository that supports it. |
|
910 | Check it works fine with repository that supports it. | |
911 |
|
911 | |||
912 | $ hg init internal-phase --config format.internal-phase=yes |
|
912 | $ hg init internal-phase --config format.internal-phase=yes | |
913 | $ cd internal-phase |
|
913 | $ cd internal-phase | |
914 | $ cat .hg/requires |
|
914 | $ cat .hg/requires | |
915 | dotencode |
|
915 | dotencode | |
916 |
|
|
916 | dirstate-v2 (dirstate-v2 !) | |
917 | fncache |
|
917 | fncache | |
918 | generaldelta |
|
918 | generaldelta | |
919 | internal-phase |
|
919 | internal-phase | |
920 | persistent-nodemap (rust !) |
|
920 | persistent-nodemap (rust !) | |
921 | revlog-compression-zstd (zstd !) |
|
921 | revlog-compression-zstd (zstd !) | |
922 | revlogv1 |
|
922 | revlogv1 | |
923 | sparserevlog |
|
923 | sparserevlog | |
924 | store |
|
924 | store | |
925 | $ mkcommit A |
|
925 | $ mkcommit A | |
926 | test-debug-phase: new rev 0: x -> 1 |
|
926 | test-debug-phase: new rev 0: x -> 1 | |
927 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft |
|
927 | test-hook-close-phase: 4a2df7238c3b48766b5e22fafbb8a2f506ec8256: -> draft | |
928 |
|
928 | |||
929 | Commit an internal changesets |
|
929 | Commit an internal changesets | |
930 |
|
930 | |||
931 | $ echo B > B |
|
931 | $ echo B > B | |
932 | $ hg add B |
|
932 | $ hg add B | |
933 | $ hg status |
|
933 | $ hg status | |
934 | A B |
|
934 | A B | |
935 | $ hg --config "phases.new-commit=internal" commit -m "my test internal commit" |
|
935 | $ hg --config "phases.new-commit=internal" commit -m "my test internal commit" | |
936 | test-debug-phase: new rev 1: x -> 96 |
|
936 | test-debug-phase: new rev 1: x -> 96 | |
937 | test-hook-close-phase: c01c42dffc7f81223397e99652a0703f83e1c5ea: -> internal |
|
937 | test-hook-close-phase: c01c42dffc7f81223397e99652a0703f83e1c5ea: -> internal | |
938 |
|
938 | |||
939 | The changeset is a working parent descendant. |
|
939 | The changeset is a working parent descendant. | |
940 | Per the usual visibility rules, it is made visible. |
|
940 | Per the usual visibility rules, it is made visible. | |
941 |
|
941 | |||
942 | $ hg log -G -l 3 |
|
942 | $ hg log -G -l 3 | |
943 | @ changeset: 1:c01c42dffc7f |
|
943 | @ changeset: 1:c01c42dffc7f | |
944 | | tag: tip |
|
944 | | tag: tip | |
945 | | user: test |
|
945 | | user: test | |
946 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
946 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
947 | | summary: my test internal commit |
|
947 | | summary: my test internal commit | |
948 | | |
|
948 | | | |
949 | o changeset: 0:4a2df7238c3b |
|
949 | o changeset: 0:4a2df7238c3b | |
950 | user: test |
|
950 | user: test | |
951 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
951 | date: Thu Jan 01 00:00:00 1970 +0000 | |
952 | summary: A |
|
952 | summary: A | |
953 |
|
953 | |||
954 |
|
954 | |||
955 | Commit is hidden as expected |
|
955 | Commit is hidden as expected | |
956 |
|
956 | |||
957 | $ hg up 0 |
|
957 | $ hg up 0 | |
958 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
958 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
959 | $ hg log -G |
|
959 | $ hg log -G | |
960 | @ changeset: 0:4a2df7238c3b |
|
960 | @ changeset: 0:4a2df7238c3b | |
961 | tag: tip |
|
961 | tag: tip | |
962 | user: test |
|
962 | user: test | |
963 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
963 | date: Thu Jan 01 00:00:00 1970 +0000 | |
964 | summary: A |
|
964 | summary: A | |
965 |
|
965 | |||
966 |
|
966 | |||
967 | Test for archived phase |
|
967 | Test for archived phase | |
968 | ----------------------- |
|
968 | ----------------------- | |
969 |
|
969 | |||
970 | Commit an archived changesets |
|
970 | Commit an archived changesets | |
971 |
|
971 | |||
972 | $ echo B > B |
|
972 | $ echo B > B | |
973 | $ hg add B |
|
973 | $ hg add B | |
974 | $ hg status |
|
974 | $ hg status | |
975 | A B |
|
975 | A B | |
976 | $ hg --config "phases.new-commit=archived" commit -m "my test archived commit" |
|
976 | $ hg --config "phases.new-commit=archived" commit -m "my test archived commit" | |
977 | test-debug-phase: new rev 2: x -> 32 |
|
977 | test-debug-phase: new rev 2: x -> 32 | |
978 | test-hook-close-phase: 8df5997c3361518f733d1ae67cd3adb9b0eaf125: -> archived |
|
978 | test-hook-close-phase: 8df5997c3361518f733d1ae67cd3adb9b0eaf125: -> archived | |
979 |
|
979 | |||
980 | The changeset is a working parent descendant. |
|
980 | The changeset is a working parent descendant. | |
981 | Per the usual visibility rules, it is made visible. |
|
981 | Per the usual visibility rules, it is made visible. | |
982 |
|
982 | |||
983 | $ hg log -G -l 3 |
|
983 | $ hg log -G -l 3 | |
984 | @ changeset: 2:8df5997c3361 |
|
984 | @ changeset: 2:8df5997c3361 | |
985 | | tag: tip |
|
985 | | tag: tip | |
986 | | parent: 0:4a2df7238c3b |
|
986 | | parent: 0:4a2df7238c3b | |
987 | | user: test |
|
987 | | user: test | |
988 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
988 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
989 | | summary: my test archived commit |
|
989 | | summary: my test archived commit | |
990 | | |
|
990 | | | |
991 | o changeset: 0:4a2df7238c3b |
|
991 | o changeset: 0:4a2df7238c3b | |
992 | user: test |
|
992 | user: test | |
993 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
993 | date: Thu Jan 01 00:00:00 1970 +0000 | |
994 | summary: A |
|
994 | summary: A | |
995 |
|
995 | |||
996 |
|
996 | |||
997 | Commit is hidden as expected |
|
997 | Commit is hidden as expected | |
998 |
|
998 | |||
999 | $ hg up 0 |
|
999 | $ hg up 0 | |
1000 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1000 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
1001 | $ hg log -G |
|
1001 | $ hg log -G | |
1002 | @ changeset: 0:4a2df7238c3b |
|
1002 | @ changeset: 0:4a2df7238c3b | |
1003 | tag: tip |
|
1003 | tag: tip | |
1004 | user: test |
|
1004 | user: test | |
1005 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1005 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1006 | summary: A |
|
1006 | summary: A | |
1007 |
|
1007 | |||
1008 | $ cd .. |
|
1008 | $ cd .. | |
1009 |
|
1009 | |||
1010 | Recommitting an exact match of a public commit shouldn't change it to |
|
1010 | Recommitting an exact match of a public commit shouldn't change it to | |
1011 | draft: |
|
1011 | draft: | |
1012 |
|
1012 | |||
1013 | $ cd initialrepo |
|
1013 | $ cd initialrepo | |
1014 | $ hg phase -r 2 |
|
1014 | $ hg phase -r 2 | |
1015 | 2: public |
|
1015 | 2: public | |
1016 | $ hg up -C 1 |
|
1016 | $ hg up -C 1 | |
1017 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
1017 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved | |
1018 | $ mkcommit C |
|
1018 | $ mkcommit C | |
1019 | warning: commit already existed in the repository! |
|
1019 | warning: commit already existed in the repository! | |
1020 | $ hg phase -r 2 |
|
1020 | $ hg phase -r 2 | |
1021 | 2: public |
|
1021 | 2: public | |
1022 |
|
1022 | |||
1023 | Same, but for secret: |
|
1023 | Same, but for secret: | |
1024 |
|
1024 | |||
1025 | $ hg up 7 |
|
1025 | $ hg up 7 | |
1026 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1026 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1027 | $ mkcommit F -s |
|
1027 | $ mkcommit F -s | |
1028 | test-debug-phase: new rev 8: x -> 2 |
|
1028 | test-debug-phase: new rev 8: x -> 2 | |
1029 | test-hook-close-phase: de414268ec5ce2330c590b942fbb5ff0b0ca1a0a: -> secret |
|
1029 | test-hook-close-phase: de414268ec5ce2330c590b942fbb5ff0b0ca1a0a: -> secret | |
1030 | $ hg up 7 |
|
1030 | $ hg up 7 | |
1031 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1031 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
1032 | $ hg phase |
|
1032 | $ hg phase | |
1033 | 7: draft |
|
1033 | 7: draft | |
1034 | $ mkcommit F |
|
1034 | $ mkcommit F | |
1035 | test-debug-phase: new rev 8: x -> 2 |
|
1035 | test-debug-phase: new rev 8: x -> 2 | |
1036 | warning: commit already existed in the repository! |
|
1036 | warning: commit already existed in the repository! | |
1037 | test-hook-close-phase: de414268ec5ce2330c590b942fbb5ff0b0ca1a0a: -> secret |
|
1037 | test-hook-close-phase: de414268ec5ce2330c590b942fbb5ff0b0ca1a0a: -> secret | |
1038 | $ hg phase -r tip |
|
1038 | $ hg phase -r tip | |
1039 | 8: secret |
|
1039 | 8: secret | |
1040 |
|
1040 | |||
1041 | But what about obsoleted changesets? |
|
1041 | But what about obsoleted changesets? | |
1042 |
|
1042 | |||
1043 | $ hg up 4 |
|
1043 | $ hg up 4 | |
1044 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
1044 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
1045 | $ mkcommit H |
|
1045 | $ mkcommit H | |
1046 | test-debug-phase: new rev 5: x -> 2 |
|
1046 | test-debug-phase: new rev 5: x -> 2 | |
1047 | warning: commit already existed in the repository! |
|
1047 | warning: commit already existed in the repository! | |
1048 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret |
|
1048 | test-hook-close-phase: a030c6be5127abc010fcbff1851536552e6951a8: -> secret | |
1049 | $ hg phase -r 5 |
|
1049 | $ hg phase -r 5 | |
1050 | 5: secret |
|
1050 | 5: secret | |
1051 | $ hg par |
|
1051 | $ hg par | |
1052 | changeset: 5:a030c6be5127 |
|
1052 | changeset: 5:a030c6be5127 | |
1053 | user: test |
|
1053 | user: test | |
1054 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1054 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1055 | obsolete: pruned |
|
1055 | obsolete: pruned | |
1056 | summary: H |
|
1056 | summary: H | |
1057 |
|
1057 | |||
1058 | $ hg up tip |
|
1058 | $ hg up tip | |
1059 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1059 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
1060 | $ cd .. |
|
1060 | $ cd .. |
@@ -1,127 +1,127 b'' | |||||
1 | #require no-windows |
|
1 | #require no-windows | |
2 |
|
2 | |||
3 | $ . "$TESTDIR/remotefilelog-library.sh" |
|
3 | $ . "$TESTDIR/remotefilelog-library.sh" | |
4 |
|
4 | |||
5 | $ hg init master |
|
5 | $ hg init master | |
6 | $ cd master |
|
6 | $ cd master | |
7 | $ echo treemanifest >> .hg/requires |
|
7 | $ echo treemanifest >> .hg/requires | |
8 | $ cat >> .hg/hgrc <<EOF |
|
8 | $ cat >> .hg/hgrc <<EOF | |
9 | > [remotefilelog] |
|
9 | > [remotefilelog] | |
10 | > server=True |
|
10 | > server=True | |
11 | > EOF |
|
11 | > EOF | |
12 | # uppercase directory name to test encoding |
|
12 | # uppercase directory name to test encoding | |
13 | $ mkdir -p A/B |
|
13 | $ mkdir -p A/B | |
14 | $ echo x > A/B/x |
|
14 | $ echo x > A/B/x | |
15 | $ hg commit -qAm x |
|
15 | $ hg commit -qAm x | |
16 |
|
16 | |||
17 | $ cd .. |
|
17 | $ cd .. | |
18 |
|
18 | |||
19 | # shallow clone from full |
|
19 | # shallow clone from full | |
20 |
|
20 | |||
21 | $ hgcloneshallow ssh://user@dummy/master shallow --noupdate |
|
21 | $ hgcloneshallow ssh://user@dummy/master shallow --noupdate | |
22 | streaming all changes |
|
22 | streaming all changes | |
23 | 4 files to transfer, 449 bytes of data |
|
23 | 4 files to transfer, 449 bytes of data | |
24 | transferred 449 bytes in * seconds (*/sec) (glob) |
|
24 | transferred 449 bytes in * seconds (*/sec) (glob) | |
25 | searching for changes |
|
25 | searching for changes | |
26 | no changes found |
|
26 | no changes found | |
27 | $ cd shallow |
|
27 | $ cd shallow | |
28 | $ cat .hg/requires |
|
28 | $ cat .hg/requires | |
29 | dotencode |
|
29 | dotencode | |
30 |
|
|
30 | dirstate-v2 (dirstate-v2 !) | |
31 | exp-remotefilelog-repo-req-1 |
|
31 | exp-remotefilelog-repo-req-1 | |
32 | fncache |
|
32 | fncache | |
33 | generaldelta |
|
33 | generaldelta | |
34 | persistent-nodemap (rust !) |
|
34 | persistent-nodemap (rust !) | |
35 | revlog-compression-zstd (zstd !) |
|
35 | revlog-compression-zstd (zstd !) | |
36 | revlogv1 |
|
36 | revlogv1 | |
37 | sparserevlog |
|
37 | sparserevlog | |
38 | store |
|
38 | store | |
39 | treemanifest |
|
39 | treemanifest | |
40 | $ find .hg/store/meta | sort |
|
40 | $ find .hg/store/meta | sort | |
41 | .hg/store/meta |
|
41 | .hg/store/meta | |
42 | .hg/store/meta/_a |
|
42 | .hg/store/meta/_a | |
43 | .hg/store/meta/_a/00manifest.i |
|
43 | .hg/store/meta/_a/00manifest.i | |
44 | .hg/store/meta/_a/_b |
|
44 | .hg/store/meta/_a/_b | |
45 | .hg/store/meta/_a/_b/00manifest.i |
|
45 | .hg/store/meta/_a/_b/00manifest.i | |
46 |
|
46 | |||
47 | $ hg update |
|
47 | $ hg update | |
48 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
48 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
49 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) |
|
49 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) | |
50 |
|
50 | |||
51 | $ cat A/B/x |
|
51 | $ cat A/B/x | |
52 | x |
|
52 | x | |
53 |
|
53 | |||
54 | $ ls .hg/store/data |
|
54 | $ ls .hg/store/data | |
55 | $ echo foo > A/B/F |
|
55 | $ echo foo > A/B/F | |
56 | $ hg add A/B/F |
|
56 | $ hg add A/B/F | |
57 | $ hg ci -m 'local content' |
|
57 | $ hg ci -m 'local content' | |
58 | $ ls .hg/store/data |
|
58 | $ ls .hg/store/data | |
59 | ca31988f085bfb945cb8115b78fabdee40f741aa |
|
59 | ca31988f085bfb945cb8115b78fabdee40f741aa | |
60 |
|
60 | |||
61 | $ cd .. |
|
61 | $ cd .. | |
62 |
|
62 | |||
63 | # shallow clone from shallow |
|
63 | # shallow clone from shallow | |
64 |
|
64 | |||
65 | $ hgcloneshallow ssh://user@dummy/shallow shallow2 --noupdate |
|
65 | $ hgcloneshallow ssh://user@dummy/shallow shallow2 --noupdate | |
66 | streaming all changes |
|
66 | streaming all changes | |
67 | 5 files to transfer, 1008 bytes of data |
|
67 | 5 files to transfer, 1008 bytes of data | |
68 | transferred 1008 bytes in * seconds (*/sec) (glob) |
|
68 | transferred 1008 bytes in * seconds (*/sec) (glob) | |
69 | searching for changes |
|
69 | searching for changes | |
70 | no changes found |
|
70 | no changes found | |
71 | $ cd shallow2 |
|
71 | $ cd shallow2 | |
72 | $ cat .hg/requires |
|
72 | $ cat .hg/requires | |
73 | dotencode |
|
73 | dotencode | |
74 |
|
|
74 | dirstate-v2 (dirstate-v2 !) | |
75 | exp-remotefilelog-repo-req-1 |
|
75 | exp-remotefilelog-repo-req-1 | |
76 | fncache |
|
76 | fncache | |
77 | generaldelta |
|
77 | generaldelta | |
78 | persistent-nodemap (rust !) |
|
78 | persistent-nodemap (rust !) | |
79 | revlog-compression-zstd (zstd !) |
|
79 | revlog-compression-zstd (zstd !) | |
80 | revlogv1 |
|
80 | revlogv1 | |
81 | sparserevlog |
|
81 | sparserevlog | |
82 | store |
|
82 | store | |
83 | treemanifest |
|
83 | treemanifest | |
84 | $ ls .hg/store/data |
|
84 | $ ls .hg/store/data | |
85 | ca31988f085bfb945cb8115b78fabdee40f741aa |
|
85 | ca31988f085bfb945cb8115b78fabdee40f741aa | |
86 |
|
86 | |||
87 | $ hg update |
|
87 | $ hg update | |
88 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
88 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
89 |
|
89 | |||
90 | $ cat A/B/x |
|
90 | $ cat A/B/x | |
91 | x |
|
91 | x | |
92 |
|
92 | |||
93 | $ cd .. |
|
93 | $ cd .. | |
94 |
|
94 | |||
95 | # full clone from shallow |
|
95 | # full clone from shallow | |
96 | # - send stderr to /dev/null because the order of stdout/err causes |
|
96 | # - send stderr to /dev/null because the order of stdout/err causes | |
97 | # flakiness here |
|
97 | # flakiness here | |
98 | $ hg clone --noupdate ssh://user@dummy/shallow full 2>/dev/null |
|
98 | $ hg clone --noupdate ssh://user@dummy/shallow full 2>/dev/null | |
99 | streaming all changes |
|
99 | streaming all changes | |
100 | [100] |
|
100 | [100] | |
101 |
|
101 | |||
102 | # getbundle full clone |
|
102 | # getbundle full clone | |
103 |
|
103 | |||
104 | $ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc |
|
104 | $ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc | |
105 | $ hgcloneshallow ssh://user@dummy/master shallow3 |
|
105 | $ hgcloneshallow ssh://user@dummy/master shallow3 | |
106 | requesting all changes |
|
106 | requesting all changes | |
107 | adding changesets |
|
107 | adding changesets | |
108 | adding manifests |
|
108 | adding manifests | |
109 | adding file changes |
|
109 | adding file changes | |
110 | added 1 changesets with 0 changes to 0 files |
|
110 | added 1 changesets with 0 changes to 0 files | |
111 | new changesets 18d955ee7ba0 |
|
111 | new changesets 18d955ee7ba0 | |
112 | updating to branch default |
|
112 | updating to branch default | |
113 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
113 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
114 |
|
114 | |||
115 | $ ls shallow3/.hg/store/data |
|
115 | $ ls shallow3/.hg/store/data | |
116 | $ cat shallow3/.hg/requires |
|
116 | $ cat shallow3/.hg/requires | |
117 | dotencode |
|
117 | dotencode | |
118 |
|
|
118 | dirstate-v2 (dirstate-v2 !) | |
119 | exp-remotefilelog-repo-req-1 |
|
119 | exp-remotefilelog-repo-req-1 | |
120 | fncache |
|
120 | fncache | |
121 | generaldelta |
|
121 | generaldelta | |
122 | persistent-nodemap (rust !) |
|
122 | persistent-nodemap (rust !) | |
123 | revlog-compression-zstd (zstd !) |
|
123 | revlog-compression-zstd (zstd !) | |
124 | revlogv1 |
|
124 | revlogv1 | |
125 | sparserevlog |
|
125 | sparserevlog | |
126 | store |
|
126 | store | |
127 | treemanifest |
|
127 | treemanifest |
@@ -1,124 +1,124 b'' | |||||
1 | #require no-windows |
|
1 | #require no-windows | |
2 |
|
2 | |||
3 | $ . "$TESTDIR/remotefilelog-library.sh" |
|
3 | $ . "$TESTDIR/remotefilelog-library.sh" | |
4 |
|
4 | |||
5 | $ hg init master |
|
5 | $ hg init master | |
6 | $ cd master |
|
6 | $ cd master | |
7 | $ cat >> .hg/hgrc <<EOF |
|
7 | $ cat >> .hg/hgrc <<EOF | |
8 | > [remotefilelog] |
|
8 | > [remotefilelog] | |
9 | > server=True |
|
9 | > server=True | |
10 | > EOF |
|
10 | > EOF | |
11 | $ echo x > x |
|
11 | $ echo x > x | |
12 | $ hg commit -qAm x |
|
12 | $ hg commit -qAm x | |
13 |
|
13 | |||
14 | $ cd .. |
|
14 | $ cd .. | |
15 |
|
15 | |||
16 | # shallow clone from full |
|
16 | # shallow clone from full | |
17 |
|
17 | |||
18 | $ hgcloneshallow ssh://user@dummy/master shallow --noupdate |
|
18 | $ hgcloneshallow ssh://user@dummy/master shallow --noupdate | |
19 | streaming all changes |
|
19 | streaming all changes | |
20 | 2 files to transfer, 227 bytes of data |
|
20 | 2 files to transfer, 227 bytes of data | |
21 | transferred 227 bytes in * seconds (*/sec) (glob) |
|
21 | transferred 227 bytes in * seconds (*/sec) (glob) | |
22 | searching for changes |
|
22 | searching for changes | |
23 | no changes found |
|
23 | no changes found | |
24 | $ cd shallow |
|
24 | $ cd shallow | |
25 | $ cat .hg/requires |
|
25 | $ cat .hg/requires | |
26 | dotencode |
|
26 | dotencode | |
27 |
|
|
27 | dirstate-v2 (dirstate-v2 !) | |
28 | exp-remotefilelog-repo-req-1 |
|
28 | exp-remotefilelog-repo-req-1 | |
29 | fncache |
|
29 | fncache | |
30 | generaldelta |
|
30 | generaldelta | |
31 | persistent-nodemap (rust !) |
|
31 | persistent-nodemap (rust !) | |
32 | revlog-compression-zstd (zstd !) |
|
32 | revlog-compression-zstd (zstd !) | |
33 | revlogv1 |
|
33 | revlogv1 | |
34 | sparserevlog |
|
34 | sparserevlog | |
35 | store |
|
35 | store | |
36 |
|
36 | |||
37 | $ hg update |
|
37 | $ hg update | |
38 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
38 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
39 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) |
|
39 | 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) | |
40 |
|
40 | |||
41 | $ cat x |
|
41 | $ cat x | |
42 | x |
|
42 | x | |
43 |
|
43 | |||
44 | $ ls .hg/store/data |
|
44 | $ ls .hg/store/data | |
45 | $ echo foo > f |
|
45 | $ echo foo > f | |
46 | $ hg add f |
|
46 | $ hg add f | |
47 | $ hg ci -m 'local content' |
|
47 | $ hg ci -m 'local content' | |
48 | $ ls .hg/store/data |
|
48 | $ ls .hg/store/data | |
49 | 4a0a19218e082a343a1b17e5333409af9d98f0f5 |
|
49 | 4a0a19218e082a343a1b17e5333409af9d98f0f5 | |
50 |
|
50 | |||
51 | $ cd .. |
|
51 | $ cd .. | |
52 |
|
52 | |||
53 | # shallow clone from shallow |
|
53 | # shallow clone from shallow | |
54 |
|
54 | |||
55 | $ hgcloneshallow ssh://user@dummy/shallow shallow2 --noupdate |
|
55 | $ hgcloneshallow ssh://user@dummy/shallow shallow2 --noupdate | |
56 | streaming all changes |
|
56 | streaming all changes | |
57 | 3 files to transfer, 564 bytes of data |
|
57 | 3 files to transfer, 564 bytes of data | |
58 | transferred 564 bytes in * seconds (*/sec) (glob) |
|
58 | transferred 564 bytes in * seconds (*/sec) (glob) | |
59 | searching for changes |
|
59 | searching for changes | |
60 | no changes found |
|
60 | no changes found | |
61 | $ cd shallow2 |
|
61 | $ cd shallow2 | |
62 | $ cat .hg/requires |
|
62 | $ cat .hg/requires | |
63 | dotencode |
|
63 | dotencode | |
64 |
|
|
64 | dirstate-v2 (dirstate-v2 !) | |
65 | exp-remotefilelog-repo-req-1 |
|
65 | exp-remotefilelog-repo-req-1 | |
66 | fncache |
|
66 | fncache | |
67 | generaldelta |
|
67 | generaldelta | |
68 | persistent-nodemap (rust !) |
|
68 | persistent-nodemap (rust !) | |
69 | revlog-compression-zstd (zstd !) |
|
69 | revlog-compression-zstd (zstd !) | |
70 | revlogv1 |
|
70 | revlogv1 | |
71 | sparserevlog |
|
71 | sparserevlog | |
72 | store |
|
72 | store | |
73 | $ ls .hg/store/data |
|
73 | $ ls .hg/store/data | |
74 | 4a0a19218e082a343a1b17e5333409af9d98f0f5 |
|
74 | 4a0a19218e082a343a1b17e5333409af9d98f0f5 | |
75 |
|
75 | |||
76 | $ hg update |
|
76 | $ hg update | |
77 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
77 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
78 |
|
78 | |||
79 | $ cat x |
|
79 | $ cat x | |
80 | x |
|
80 | x | |
81 |
|
81 | |||
82 | $ cd .. |
|
82 | $ cd .. | |
83 |
|
83 | |||
84 | # full clone from shallow |
|
84 | # full clone from shallow | |
85 |
|
85 | |||
86 | Note: the output to STDERR comes from a different process to the output on |
|
86 | Note: the output to STDERR comes from a different process to the output on | |
87 | STDOUT and their relative ordering is not deterministic. As a result, the test |
|
87 | STDOUT and their relative ordering is not deterministic. As a result, the test | |
88 | was failing sporadically. To avoid this, we capture STDERR to a file and |
|
88 | was failing sporadically. To avoid this, we capture STDERR to a file and | |
89 | check its contents separately. |
|
89 | check its contents separately. | |
90 |
|
90 | |||
91 | $ TEMP_STDERR=full-clone-from-shallow.stderr.tmp |
|
91 | $ TEMP_STDERR=full-clone-from-shallow.stderr.tmp | |
92 | $ hg clone --noupdate ssh://user@dummy/shallow full 2>$TEMP_STDERR |
|
92 | $ hg clone --noupdate ssh://user@dummy/shallow full 2>$TEMP_STDERR | |
93 | streaming all changes |
|
93 | streaming all changes | |
94 | [100] |
|
94 | [100] | |
95 | $ cat $TEMP_STDERR |
|
95 | $ cat $TEMP_STDERR | |
96 | remote: abort: Cannot clone from a shallow repo to a full repo. |
|
96 | remote: abort: Cannot clone from a shallow repo to a full repo. | |
97 | abort: pull failed on remote |
|
97 | abort: pull failed on remote | |
98 | $ rm $TEMP_STDERR |
|
98 | $ rm $TEMP_STDERR | |
99 |
|
99 | |||
100 | # getbundle full clone |
|
100 | # getbundle full clone | |
101 |
|
101 | |||
102 | $ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc |
|
102 | $ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc | |
103 | $ hgcloneshallow ssh://user@dummy/master shallow3 |
|
103 | $ hgcloneshallow ssh://user@dummy/master shallow3 | |
104 | requesting all changes |
|
104 | requesting all changes | |
105 | adding changesets |
|
105 | adding changesets | |
106 | adding manifests |
|
106 | adding manifests | |
107 | adding file changes |
|
107 | adding file changes | |
108 | added 1 changesets with 0 changes to 0 files |
|
108 | added 1 changesets with 0 changes to 0 files | |
109 | new changesets b292c1e3311f |
|
109 | new changesets b292c1e3311f | |
110 | updating to branch default |
|
110 | updating to branch default | |
111 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
111 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
112 |
|
112 | |||
113 | $ ls shallow3/.hg/store/data |
|
113 | $ ls shallow3/.hg/store/data | |
114 | $ cat shallow3/.hg/requires |
|
114 | $ cat shallow3/.hg/requires | |
115 | dotencode |
|
115 | dotencode | |
116 |
|
|
116 | dirstate-v2 (dirstate-v2 !) | |
117 | exp-remotefilelog-repo-req-1 |
|
117 | exp-remotefilelog-repo-req-1 | |
118 | fncache |
|
118 | fncache | |
119 | generaldelta |
|
119 | generaldelta | |
120 | persistent-nodemap (rust !) |
|
120 | persistent-nodemap (rust !) | |
121 | revlog-compression-zstd (zstd !) |
|
121 | revlog-compression-zstd (zstd !) | |
122 | revlogv1 |
|
122 | revlogv1 | |
123 | sparserevlog |
|
123 | sparserevlog | |
124 | store |
|
124 | store |
@@ -1,121 +1,121 b'' | |||||
1 | #require no-windows |
|
1 | #require no-windows | |
2 |
|
2 | |||
3 | $ . "$TESTDIR/remotefilelog-library.sh" |
|
3 | $ . "$TESTDIR/remotefilelog-library.sh" | |
4 |
|
4 | |||
5 | $ hg init master |
|
5 | $ hg init master | |
6 | $ cd master |
|
6 | $ cd master | |
7 | $ cat >> .hg/hgrc <<EOF |
|
7 | $ cat >> .hg/hgrc <<EOF | |
8 | > [remotefilelog] |
|
8 | > [remotefilelog] | |
9 | > server=True |
|
9 | > server=True | |
10 | > EOF |
|
10 | > EOF | |
11 | $ echo x > x |
|
11 | $ echo x > x | |
12 | $ hg commit -qAm x |
|
12 | $ hg commit -qAm x | |
13 | $ mkdir dir |
|
13 | $ mkdir dir | |
14 | $ echo y > dir/y |
|
14 | $ echo y > dir/y | |
15 | $ hg commit -qAm y |
|
15 | $ hg commit -qAm y | |
16 |
|
16 | |||
17 | $ cd .. |
|
17 | $ cd .. | |
18 |
|
18 | |||
19 | Shallow clone from full |
|
19 | Shallow clone from full | |
20 |
|
20 | |||
21 | $ hgcloneshallow ssh://user@dummy/master shallow --noupdate |
|
21 | $ hgcloneshallow ssh://user@dummy/master shallow --noupdate | |
22 | streaming all changes |
|
22 | streaming all changes | |
23 | 2 files to transfer, 473 bytes of data |
|
23 | 2 files to transfer, 473 bytes of data | |
24 | transferred 473 bytes in * seconds (*/sec) (glob) |
|
24 | transferred 473 bytes in * seconds (*/sec) (glob) | |
25 | searching for changes |
|
25 | searching for changes | |
26 | no changes found |
|
26 | no changes found | |
27 | $ cd shallow |
|
27 | $ cd shallow | |
28 | $ cat .hg/requires |
|
28 | $ cat .hg/requires | |
29 | dotencode |
|
29 | dotencode | |
30 |
|
|
30 | dirstate-v2 (dirstate-v2 !) | |
31 | exp-remotefilelog-repo-req-1 |
|
31 | exp-remotefilelog-repo-req-1 | |
32 | fncache |
|
32 | fncache | |
33 | generaldelta |
|
33 | generaldelta | |
34 | persistent-nodemap (rust !) |
|
34 | persistent-nodemap (rust !) | |
35 | revlog-compression-zstd (zstd !) |
|
35 | revlog-compression-zstd (zstd !) | |
36 | revlogv1 |
|
36 | revlogv1 | |
37 | sparserevlog |
|
37 | sparserevlog | |
38 | store |
|
38 | store | |
39 |
|
39 | |||
40 | $ hg update |
|
40 | $ hg update | |
41 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
41 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
42 | 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) |
|
42 | 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) | |
43 |
|
43 | |||
44 | Log on a file without -f |
|
44 | Log on a file without -f | |
45 |
|
45 | |||
46 | $ hg log dir/y |
|
46 | $ hg log dir/y | |
47 | warning: file log can be slow on large repos - use -f to speed it up |
|
47 | warning: file log can be slow on large repos - use -f to speed it up | |
48 | changeset: 1:2e73264fab97 |
|
48 | changeset: 1:2e73264fab97 | |
49 | tag: tip |
|
49 | tag: tip | |
50 | user: test |
|
50 | user: test | |
51 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
51 | date: Thu Jan 01 00:00:00 1970 +0000 | |
52 | summary: y |
|
52 | summary: y | |
53 |
|
53 | |||
54 | Log on a file with -f |
|
54 | Log on a file with -f | |
55 |
|
55 | |||
56 | $ hg log -f dir/y |
|
56 | $ hg log -f dir/y | |
57 | changeset: 1:2e73264fab97 |
|
57 | changeset: 1:2e73264fab97 | |
58 | tag: tip |
|
58 | tag: tip | |
59 | user: test |
|
59 | user: test | |
60 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
60 | date: Thu Jan 01 00:00:00 1970 +0000 | |
61 | summary: y |
|
61 | summary: y | |
62 |
|
62 | |||
63 | Log on a file with kind in path |
|
63 | Log on a file with kind in path | |
64 | $ hg log -r "filelog('path:dir/y')" |
|
64 | $ hg log -r "filelog('path:dir/y')" | |
65 | changeset: 1:2e73264fab97 |
|
65 | changeset: 1:2e73264fab97 | |
66 | tag: tip |
|
66 | tag: tip | |
67 | user: test |
|
67 | user: test | |
68 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
68 | date: Thu Jan 01 00:00:00 1970 +0000 | |
69 | summary: y |
|
69 | summary: y | |
70 |
|
70 | |||
71 | Log on multiple files with -f |
|
71 | Log on multiple files with -f | |
72 |
|
72 | |||
73 | $ hg log -f dir/y x |
|
73 | $ hg log -f dir/y x | |
74 | changeset: 1:2e73264fab97 |
|
74 | changeset: 1:2e73264fab97 | |
75 | tag: tip |
|
75 | tag: tip | |
76 | user: test |
|
76 | user: test | |
77 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
77 | date: Thu Jan 01 00:00:00 1970 +0000 | |
78 | summary: y |
|
78 | summary: y | |
79 |
|
79 | |||
80 | changeset: 0:b292c1e3311f |
|
80 | changeset: 0:b292c1e3311f | |
81 | user: test |
|
81 | user: test | |
82 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
82 | date: Thu Jan 01 00:00:00 1970 +0000 | |
83 | summary: x |
|
83 | summary: x | |
84 |
|
84 | |||
85 | Log on a directory |
|
85 | Log on a directory | |
86 |
|
86 | |||
87 | $ hg log dir |
|
87 | $ hg log dir | |
88 | changeset: 1:2e73264fab97 |
|
88 | changeset: 1:2e73264fab97 | |
89 | tag: tip |
|
89 | tag: tip | |
90 | user: test |
|
90 | user: test | |
91 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
91 | date: Thu Jan 01 00:00:00 1970 +0000 | |
92 | summary: y |
|
92 | summary: y | |
93 |
|
93 | |||
94 | Log on a file from inside a directory |
|
94 | Log on a file from inside a directory | |
95 |
|
95 | |||
96 | $ cd dir |
|
96 | $ cd dir | |
97 | $ hg log y |
|
97 | $ hg log y | |
98 | warning: file log can be slow on large repos - use -f to speed it up |
|
98 | warning: file log can be slow on large repos - use -f to speed it up | |
99 | changeset: 1:2e73264fab97 |
|
99 | changeset: 1:2e73264fab97 | |
100 | tag: tip |
|
100 | tag: tip | |
101 | user: test |
|
101 | user: test | |
102 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
102 | date: Thu Jan 01 00:00:00 1970 +0000 | |
103 | summary: y |
|
103 | summary: y | |
104 |
|
104 | |||
105 | Log on a file via -fr |
|
105 | Log on a file via -fr | |
106 | $ cd .. |
|
106 | $ cd .. | |
107 | $ hg log -fr tip dir/ --template '{rev}\n' |
|
107 | $ hg log -fr tip dir/ --template '{rev}\n' | |
108 | 1 |
|
108 | 1 | |
109 |
|
109 | |||
110 | Trace renames |
|
110 | Trace renames | |
111 | $ hg mv x z |
|
111 | $ hg mv x z | |
112 | $ hg commit -m move |
|
112 | $ hg commit -m move | |
113 | $ hg log -f z -T '{desc} {file_copies}\n' -G |
|
113 | $ hg log -f z -T '{desc} {file_copies}\n' -G | |
114 | @ move z (x) |
|
114 | @ move z (x) | |
115 | : |
|
115 | : | |
116 | o x |
|
116 | o x | |
117 |
|
117 | |||
118 |
|
118 | |||
119 | Verify remotefilelog handles rename metadata stripping when comparing file sizes |
|
119 | Verify remotefilelog handles rename metadata stripping when comparing file sizes | |
120 | $ hg debugrebuilddirstate |
|
120 | $ hg debugrebuilddirstate | |
121 | $ hg status |
|
121 | $ hg status |
@@ -1,258 +1,258 b'' | |||||
1 | A new repository uses zlib storage, which doesn't need a requirement |
|
1 | A new repository uses zlib storage, which doesn't need a requirement | |
2 |
|
2 | |||
3 | $ cat << EOF >> $HGRCPATH |
|
3 | $ cat << EOF >> $HGRCPATH | |
4 | > [format] |
|
4 | > [format] | |
5 | > # stabilize test accross variant |
|
5 | > # stabilize test accross variant | |
6 | > revlog-compression=zlib |
|
6 | > revlog-compression=zlib | |
7 | > EOF |
|
7 | > EOF | |
8 |
|
8 | |||
9 |
|
9 | |||
10 | $ hg init default |
|
10 | $ hg init default | |
11 | $ cd default |
|
11 | $ cd default | |
12 | $ cat .hg/requires |
|
12 | $ cat .hg/requires | |
13 | dotencode |
|
13 | dotencode | |
14 |
|
|
14 | dirstate-v2 (dirstate-v2 !) | |
15 | fncache |
|
15 | fncache | |
16 | generaldelta |
|
16 | generaldelta | |
17 | persistent-nodemap (rust !) |
|
17 | persistent-nodemap (rust !) | |
18 | revlogv1 |
|
18 | revlogv1 | |
19 | sparserevlog |
|
19 | sparserevlog | |
20 | store |
|
20 | store | |
21 | testonly-simplestore (reposimplestore !) |
|
21 | testonly-simplestore (reposimplestore !) | |
22 |
|
22 | |||
23 | $ touch foo |
|
23 | $ touch foo | |
24 | $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text to trigger compression' |
|
24 | $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text to trigger compression' | |
25 | $ hg debugrevlog -c | grep 0x78 |
|
25 | $ hg debugrevlog -c | grep 0x78 | |
26 | 0x78 (x) : 1 (100.00%) |
|
26 | 0x78 (x) : 1 (100.00%) | |
27 | 0x78 (x) : 110 (100.00%) |
|
27 | 0x78 (x) : 110 (100.00%) | |
28 |
|
28 | |||
29 | $ cd .. |
|
29 | $ cd .. | |
30 |
|
30 | |||
31 | Unknown compression engine to format.compression aborts |
|
31 | Unknown compression engine to format.compression aborts | |
32 |
|
32 | |||
33 | $ hg --config format.revlog-compression=unknown init unknown |
|
33 | $ hg --config format.revlog-compression=unknown init unknown | |
34 | abort: compression engines "unknown" defined by format.revlog-compression not available |
|
34 | abort: compression engines "unknown" defined by format.revlog-compression not available | |
35 | (run "hg debuginstall" to list available compression engines) |
|
35 | (run "hg debuginstall" to list available compression engines) | |
36 | [255] |
|
36 | [255] | |
37 |
|
37 | |||
38 | unknown compression engine in a list with known one works fine |
|
38 | unknown compression engine in a list with known one works fine | |
39 |
|
39 | |||
40 | $ hg --config format.revlog-compression=zlib,unknown init zlib-before-unknow |
|
40 | $ hg --config format.revlog-compression=zlib,unknown init zlib-before-unknow | |
41 | $ hg --config format.revlog-compression=unknown,zlib init unknown-before-zlib |
|
41 | $ hg --config format.revlog-compression=unknown,zlib init unknown-before-zlib | |
42 |
|
42 | |||
43 | A requirement specifying an unknown compression engine results in bail |
|
43 | A requirement specifying an unknown compression engine results in bail | |
44 |
|
44 | |||
45 | $ hg init unknownrequirement |
|
45 | $ hg init unknownrequirement | |
46 | $ cd unknownrequirement |
|
46 | $ cd unknownrequirement | |
47 | $ echo exp-compression-unknown >> .hg/requires |
|
47 | $ echo exp-compression-unknown >> .hg/requires | |
48 | $ hg log |
|
48 | $ hg log | |
49 | abort: repository requires features unknown to this Mercurial: exp-compression-unknown |
|
49 | abort: repository requires features unknown to this Mercurial: exp-compression-unknown | |
50 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
|
50 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) | |
51 | [255] |
|
51 | [255] | |
52 |
|
52 | |||
53 | $ cd .. |
|
53 | $ cd .. | |
54 |
|
54 | |||
55 | Specifying a new format.compression on an existing repo won't introduce data |
|
55 | Specifying a new format.compression on an existing repo won't introduce data | |
56 | with that engine or a requirement |
|
56 | with that engine or a requirement | |
57 |
|
57 | |||
58 | $ cd default |
|
58 | $ cd default | |
59 | $ touch bar |
|
59 | $ touch bar | |
60 | $ hg --config format.revlog-compression=none -q commit -A -m 'add bar with a lot of repeated repeated repeated text' |
|
60 | $ hg --config format.revlog-compression=none -q commit -A -m 'add bar with a lot of repeated repeated repeated text' | |
61 |
|
61 | |||
62 | $ cat .hg/requires |
|
62 | $ cat .hg/requires | |
63 | dotencode |
|
63 | dotencode | |
64 |
|
|
64 | dirstate-v2 (dirstate-v2 !) | |
65 | fncache |
|
65 | fncache | |
66 | generaldelta |
|
66 | generaldelta | |
67 | persistent-nodemap (rust !) |
|
67 | persistent-nodemap (rust !) | |
68 | revlogv1 |
|
68 | revlogv1 | |
69 | sparserevlog |
|
69 | sparserevlog | |
70 | store |
|
70 | store | |
71 | testonly-simplestore (reposimplestore !) |
|
71 | testonly-simplestore (reposimplestore !) | |
72 |
|
72 | |||
73 | $ hg debugrevlog -c | grep 0x78 |
|
73 | $ hg debugrevlog -c | grep 0x78 | |
74 | 0x78 (x) : 2 (100.00%) |
|
74 | 0x78 (x) : 2 (100.00%) | |
75 | 0x78 (x) : 199 (100.00%) |
|
75 | 0x78 (x) : 199 (100.00%) | |
76 | $ cd .. |
|
76 | $ cd .. | |
77 |
|
77 | |||
78 | #if zstd |
|
78 | #if zstd | |
79 |
|
79 | |||
80 | $ hg --config format.revlog-compression=zstd init zstd |
|
80 | $ hg --config format.revlog-compression=zstd init zstd | |
81 | $ cd zstd |
|
81 | $ cd zstd | |
82 | $ cat .hg/requires |
|
82 | $ cat .hg/requires | |
83 | dotencode |
|
83 | dotencode | |
84 |
|
|
84 | dirstate-v2 (dirstate-v2 !) | |
85 | fncache |
|
85 | fncache | |
86 | generaldelta |
|
86 | generaldelta | |
87 | persistent-nodemap (rust !) |
|
87 | persistent-nodemap (rust !) | |
88 | revlog-compression-zstd |
|
88 | revlog-compression-zstd | |
89 | revlogv1 |
|
89 | revlogv1 | |
90 | sparserevlog |
|
90 | sparserevlog | |
91 | store |
|
91 | store | |
92 | testonly-simplestore (reposimplestore !) |
|
92 | testonly-simplestore (reposimplestore !) | |
93 |
|
93 | |||
94 | $ touch foo |
|
94 | $ touch foo | |
95 | $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text' |
|
95 | $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text' | |
96 |
|
96 | |||
97 | $ hg debugrevlog -c | grep 0x28 |
|
97 | $ hg debugrevlog -c | grep 0x28 | |
98 | 0x28 : 1 (100.00%) |
|
98 | 0x28 : 1 (100.00%) | |
99 | 0x28 : 98 (100.00%) |
|
99 | 0x28 : 98 (100.00%) | |
100 |
|
100 | |||
101 | $ cd .. |
|
101 | $ cd .. | |
102 |
|
102 | |||
103 |
|
103 | |||
104 | #endif |
|
104 | #endif | |
105 |
|
105 | |||
106 | checking zlib options |
|
106 | checking zlib options | |
107 | ===================== |
|
107 | ===================== | |
108 |
|
108 | |||
109 | $ hg init zlib-level-default |
|
109 | $ hg init zlib-level-default | |
110 | $ hg init zlib-level-1 |
|
110 | $ hg init zlib-level-1 | |
111 | $ cat << EOF >> zlib-level-1/.hg/hgrc |
|
111 | $ cat << EOF >> zlib-level-1/.hg/hgrc | |
112 | > [storage] |
|
112 | > [storage] | |
113 | > revlog.zlib.level=1 |
|
113 | > revlog.zlib.level=1 | |
114 | > EOF |
|
114 | > EOF | |
115 | $ hg init zlib-level-9 |
|
115 | $ hg init zlib-level-9 | |
116 | $ cat << EOF >> zlib-level-9/.hg/hgrc |
|
116 | $ cat << EOF >> zlib-level-9/.hg/hgrc | |
117 | > [storage] |
|
117 | > [storage] | |
118 | > revlog.zlib.level=9 |
|
118 | > revlog.zlib.level=9 | |
119 | > EOF |
|
119 | > EOF | |
120 |
|
120 | |||
121 |
|
121 | |||
122 | $ commitone() { |
|
122 | $ commitone() { | |
123 | > repo=$1 |
|
123 | > repo=$1 | |
124 | > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a |
|
124 | > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a | |
125 | > hg -R $repo add $repo/a |
|
125 | > hg -R $repo add $repo/a | |
126 | > hg -R $repo commit -m some-commit |
|
126 | > hg -R $repo commit -m some-commit | |
127 | > } |
|
127 | > } | |
128 |
|
128 | |||
129 | $ for repo in zlib-level-default zlib-level-1 zlib-level-9; do |
|
129 | $ for repo in zlib-level-default zlib-level-1 zlib-level-9; do | |
130 | > commitone $repo |
|
130 | > commitone $repo | |
131 | > done |
|
131 | > done | |
132 |
|
132 | |||
133 | $ $RUNTESTDIR/f -s */.hg/store/data/* |
|
133 | $ $RUNTESTDIR/f -s */.hg/store/data/* | |
134 | default/.hg/store/data/bar.i: size=64 |
|
134 | default/.hg/store/data/bar.i: size=64 | |
135 | default/.hg/store/data/foo.i: size=64 |
|
135 | default/.hg/store/data/foo.i: size=64 | |
136 | zlib-level-1/.hg/store/data/a.i: size=4146 |
|
136 | zlib-level-1/.hg/store/data/a.i: size=4146 | |
137 | zlib-level-9/.hg/store/data/a.i: size=4138 |
|
137 | zlib-level-9/.hg/store/data/a.i: size=4138 | |
138 | zlib-level-default/.hg/store/data/a.i: size=4138 |
|
138 | zlib-level-default/.hg/store/data/a.i: size=4138 | |
139 | zstd/.hg/store/data/foo.i: size=64 (zstd !) |
|
139 | zstd/.hg/store/data/foo.i: size=64 (zstd !) | |
140 |
|
140 | |||
141 | Test error cases |
|
141 | Test error cases | |
142 |
|
142 | |||
143 | $ hg init zlib-level-invalid |
|
143 | $ hg init zlib-level-invalid | |
144 | $ cat << EOF >> zlib-level-invalid/.hg/hgrc |
|
144 | $ cat << EOF >> zlib-level-invalid/.hg/hgrc | |
145 | > [storage] |
|
145 | > [storage] | |
146 | > revlog.zlib.level=foobar |
|
146 | > revlog.zlib.level=foobar | |
147 | > EOF |
|
147 | > EOF | |
148 | $ commitone zlib-level-invalid |
|
148 | $ commitone zlib-level-invalid | |
149 | config error: storage.revlog.zlib.level is not a valid integer ('foobar') |
|
149 | config error: storage.revlog.zlib.level is not a valid integer ('foobar') | |
150 | config error: storage.revlog.zlib.level is not a valid integer ('foobar') |
|
150 | config error: storage.revlog.zlib.level is not a valid integer ('foobar') | |
151 | [30] |
|
151 | [30] | |
152 |
|
152 | |||
153 | $ hg init zlib-level-out-of-range |
|
153 | $ hg init zlib-level-out-of-range | |
154 | $ cat << EOF >> zlib-level-out-of-range/.hg/hgrc |
|
154 | $ cat << EOF >> zlib-level-out-of-range/.hg/hgrc | |
155 | > [storage] |
|
155 | > [storage] | |
156 | > revlog.zlib.level=42 |
|
156 | > revlog.zlib.level=42 | |
157 | > EOF |
|
157 | > EOF | |
158 |
|
158 | |||
159 | $ commitone zlib-level-out-of-range |
|
159 | $ commitone zlib-level-out-of-range | |
160 | abort: invalid value for `storage.revlog.zlib.level` config: 42 |
|
160 | abort: invalid value for `storage.revlog.zlib.level` config: 42 | |
161 | abort: invalid value for `storage.revlog.zlib.level` config: 42 |
|
161 | abort: invalid value for `storage.revlog.zlib.level` config: 42 | |
162 | [255] |
|
162 | [255] | |
163 |
|
163 | |||
164 | checking details of none compression |
|
164 | checking details of none compression | |
165 | ==================================== |
|
165 | ==================================== | |
166 |
|
166 | |||
167 | $ hg init none-compression --config format.revlog-compression=none |
|
167 | $ hg init none-compression --config format.revlog-compression=none | |
168 |
|
168 | |||
169 | $ commitone() { |
|
169 | $ commitone() { | |
170 | > repo=$1 |
|
170 | > repo=$1 | |
171 | > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a |
|
171 | > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a | |
172 | > hg -R $repo add $repo/a |
|
172 | > hg -R $repo add $repo/a | |
173 | > hg -R $repo commit -m some-commit |
|
173 | > hg -R $repo commit -m some-commit | |
174 | > } |
|
174 | > } | |
175 |
|
175 | |||
176 | $ commitone none-compression |
|
176 | $ commitone none-compression | |
177 |
|
177 | |||
178 | $ hg log -R none-compression |
|
178 | $ hg log -R none-compression | |
179 | changeset: 0:68b53da39cd8 |
|
179 | changeset: 0:68b53da39cd8 | |
180 | tag: tip |
|
180 | tag: tip | |
181 | user: test |
|
181 | user: test | |
182 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
182 | date: Thu Jan 01 00:00:00 1970 +0000 | |
183 | summary: some-commit |
|
183 | summary: some-commit | |
184 |
|
184 | |||
185 |
|
185 | |||
186 | $ cat none-compression/.hg/requires |
|
186 | $ cat none-compression/.hg/requires | |
187 | dotencode |
|
187 | dotencode | |
188 | exp-compression-none |
|
188 | exp-compression-none | |
189 |
|
|
189 | dirstate-v2 (dirstate-v2 !) | |
190 | fncache |
|
190 | fncache | |
191 | generaldelta |
|
191 | generaldelta | |
192 | persistent-nodemap (rust !) |
|
192 | persistent-nodemap (rust !) | |
193 | revlogv1 |
|
193 | revlogv1 | |
194 | sparserevlog |
|
194 | sparserevlog | |
195 | store |
|
195 | store | |
196 | testonly-simplestore (reposimplestore !) |
|
196 | testonly-simplestore (reposimplestore !) | |
197 |
|
197 | |||
198 | $ $RUNTESTDIR/f -s none-compression/.hg/store/data/* |
|
198 | $ $RUNTESTDIR/f -s none-compression/.hg/store/data/* | |
199 | none-compression/.hg/store/data/a.i: size=4216 |
|
199 | none-compression/.hg/store/data/a.i: size=4216 | |
200 |
|
200 | |||
201 | #if zstd |
|
201 | #if zstd | |
202 |
|
202 | |||
203 | checking zstd options |
|
203 | checking zstd options | |
204 | ===================== |
|
204 | ===================== | |
205 |
|
205 | |||
206 | $ hg init zstd-level-default --config format.revlog-compression=zstd |
|
206 | $ hg init zstd-level-default --config format.revlog-compression=zstd | |
207 | $ hg init zstd-level-1 --config format.revlog-compression=zstd |
|
207 | $ hg init zstd-level-1 --config format.revlog-compression=zstd | |
208 | $ cat << EOF >> zstd-level-1/.hg/hgrc |
|
208 | $ cat << EOF >> zstd-level-1/.hg/hgrc | |
209 | > [storage] |
|
209 | > [storage] | |
210 | > revlog.zstd.level=1 |
|
210 | > revlog.zstd.level=1 | |
211 | > EOF |
|
211 | > EOF | |
212 | $ hg init zstd-level-22 --config format.revlog-compression=zstd |
|
212 | $ hg init zstd-level-22 --config format.revlog-compression=zstd | |
213 | $ cat << EOF >> zstd-level-22/.hg/hgrc |
|
213 | $ cat << EOF >> zstd-level-22/.hg/hgrc | |
214 | > [storage] |
|
214 | > [storage] | |
215 | > revlog.zstd.level=22 |
|
215 | > revlog.zstd.level=22 | |
216 | > EOF |
|
216 | > EOF | |
217 |
|
217 | |||
218 |
|
218 | |||
219 | $ commitone() { |
|
219 | $ commitone() { | |
220 | > repo=$1 |
|
220 | > repo=$1 | |
221 | > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a |
|
221 | > cp $RUNTESTDIR/bundles/issue4438-r1.hg $repo/a | |
222 | > hg -R $repo add $repo/a |
|
222 | > hg -R $repo add $repo/a | |
223 | > hg -R $repo commit -m some-commit |
|
223 | > hg -R $repo commit -m some-commit | |
224 | > } |
|
224 | > } | |
225 |
|
225 | |||
226 | $ for repo in zstd-level-default zstd-level-1 zstd-level-22; do |
|
226 | $ for repo in zstd-level-default zstd-level-1 zstd-level-22; do | |
227 | > commitone $repo |
|
227 | > commitone $repo | |
228 | > done |
|
228 | > done | |
229 |
|
229 | |||
230 | $ $RUNTESTDIR/f -s zstd-*/.hg/store/data/* |
|
230 | $ $RUNTESTDIR/f -s zstd-*/.hg/store/data/* | |
231 | zstd-level-1/.hg/store/data/a.i: size=4114 |
|
231 | zstd-level-1/.hg/store/data/a.i: size=4114 | |
232 | zstd-level-22/.hg/store/data/a.i: size=4091 |
|
232 | zstd-level-22/.hg/store/data/a.i: size=4091 | |
233 | zstd-level-default/\.hg/store/data/a\.i: size=(4094|4102) (re) |
|
233 | zstd-level-default/\.hg/store/data/a\.i: size=(4094|4102) (re) | |
234 |
|
234 | |||
235 | Test error cases |
|
235 | Test error cases | |
236 |
|
236 | |||
237 | $ hg init zstd-level-invalid --config format.revlog-compression=zstd |
|
237 | $ hg init zstd-level-invalid --config format.revlog-compression=zstd | |
238 | $ cat << EOF >> zstd-level-invalid/.hg/hgrc |
|
238 | $ cat << EOF >> zstd-level-invalid/.hg/hgrc | |
239 | > [storage] |
|
239 | > [storage] | |
240 | > revlog.zstd.level=foobar |
|
240 | > revlog.zstd.level=foobar | |
241 | > EOF |
|
241 | > EOF | |
242 | $ commitone zstd-level-invalid |
|
242 | $ commitone zstd-level-invalid | |
243 | config error: storage.revlog.zstd.level is not a valid integer ('foobar') |
|
243 | config error: storage.revlog.zstd.level is not a valid integer ('foobar') | |
244 | config error: storage.revlog.zstd.level is not a valid integer ('foobar') |
|
244 | config error: storage.revlog.zstd.level is not a valid integer ('foobar') | |
245 | [30] |
|
245 | [30] | |
246 |
|
246 | |||
247 | $ hg init zstd-level-out-of-range --config format.revlog-compression=zstd |
|
247 | $ hg init zstd-level-out-of-range --config format.revlog-compression=zstd | |
248 | $ cat << EOF >> zstd-level-out-of-range/.hg/hgrc |
|
248 | $ cat << EOF >> zstd-level-out-of-range/.hg/hgrc | |
249 | > [storage] |
|
249 | > [storage] | |
250 | > revlog.zstd.level=42 |
|
250 | > revlog.zstd.level=42 | |
251 | > EOF |
|
251 | > EOF | |
252 |
|
252 | |||
253 | $ commitone zstd-level-out-of-range |
|
253 | $ commitone zstd-level-out-of-range | |
254 | abort: invalid value for `storage.revlog.zstd.level` config: 42 |
|
254 | abort: invalid value for `storage.revlog.zstd.level` config: 42 | |
255 | abort: invalid value for `storage.revlog.zstd.level` config: 42 |
|
255 | abort: invalid value for `storage.revlog.zstd.level` config: 42 | |
256 | [255] |
|
256 | [255] | |
257 |
|
257 | |||
258 | #endif |
|
258 | #endif |
@@ -1,84 +1,84 b'' | |||||
1 | $ hg init t |
|
1 | $ hg init t | |
2 | $ cd t |
|
2 | $ cd t | |
3 | $ echo a > a |
|
3 | $ echo a > a | |
4 | $ hg add a |
|
4 | $ hg add a | |
5 | $ hg commit -m test |
|
5 | $ hg commit -m test | |
6 | $ rm .hg/requires |
|
6 | $ rm .hg/requires | |
7 | $ hg tip |
|
7 | $ hg tip | |
8 | abort: unknown version (65535) in revlog 00changelog |
|
8 | abort: unknown version (65535) in revlog 00changelog | |
9 | [50] |
|
9 | [50] | |
10 | $ echo indoor-pool > .hg/requires |
|
10 | $ echo indoor-pool > .hg/requires | |
11 | $ hg tip |
|
11 | $ hg tip | |
12 | abort: repository requires features unknown to this Mercurial: indoor-pool |
|
12 | abort: repository requires features unknown to this Mercurial: indoor-pool | |
13 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
|
13 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) | |
14 | [255] |
|
14 | [255] | |
15 | $ echo outdoor-pool >> .hg/requires |
|
15 | $ echo outdoor-pool >> .hg/requires | |
16 | $ hg tip |
|
16 | $ hg tip | |
17 | abort: repository requires features unknown to this Mercurial: indoor-pool outdoor-pool |
|
17 | abort: repository requires features unknown to this Mercurial: indoor-pool outdoor-pool | |
18 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
|
18 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) | |
19 | [255] |
|
19 | [255] | |
20 | $ cd .. |
|
20 | $ cd .. | |
21 |
|
21 | |||
22 | Test checking between features supported locally and ones required in |
|
22 | Test checking between features supported locally and ones required in | |
23 | another repository of push/pull/clone on localhost: |
|
23 | another repository of push/pull/clone on localhost: | |
24 |
|
24 | |||
25 | $ mkdir supported-locally |
|
25 | $ mkdir supported-locally | |
26 | $ cd supported-locally |
|
26 | $ cd supported-locally | |
27 |
|
27 | |||
28 | $ hg init supported |
|
28 | $ hg init supported | |
29 | $ echo a > supported/a |
|
29 | $ echo a > supported/a | |
30 | $ hg -R supported commit -Am '#0 at supported' |
|
30 | $ hg -R supported commit -Am '#0 at supported' | |
31 | adding a |
|
31 | adding a | |
32 |
|
32 | |||
33 | $ echo 'featuresetup-test' >> supported/.hg/requires |
|
33 | $ echo 'featuresetup-test' >> supported/.hg/requires | |
34 | $ cat > $TESTTMP/supported-locally/supportlocally.py <<EOF |
|
34 | $ cat > $TESTTMP/supported-locally/supportlocally.py <<EOF | |
35 | > from __future__ import absolute_import |
|
35 | > from __future__ import absolute_import | |
36 | > from mercurial import extensions, localrepo |
|
36 | > from mercurial import extensions, localrepo | |
37 | > def featuresetup(ui, supported): |
|
37 | > def featuresetup(ui, supported): | |
38 | > for name, module in extensions.extensions(ui): |
|
38 | > for name, module in extensions.extensions(ui): | |
39 | > if __name__ == module.__name__: |
|
39 | > if __name__ == module.__name__: | |
40 | > # support specific feature locally |
|
40 | > # support specific feature locally | |
41 | > supported |= {b'featuresetup-test'} |
|
41 | > supported |= {b'featuresetup-test'} | |
42 | > return |
|
42 | > return | |
43 | > def uisetup(ui): |
|
43 | > def uisetup(ui): | |
44 | > localrepo.featuresetupfuncs.add(featuresetup) |
|
44 | > localrepo.featuresetupfuncs.add(featuresetup) | |
45 | > EOF |
|
45 | > EOF | |
46 | $ cat > supported/.hg/hgrc <<EOF |
|
46 | $ cat > supported/.hg/hgrc <<EOF | |
47 | > [extensions] |
|
47 | > [extensions] | |
48 | > # enable extension locally |
|
48 | > # enable extension locally | |
49 | > supportlocally = $TESTTMP/supported-locally/supportlocally.py |
|
49 | > supportlocally = $TESTTMP/supported-locally/supportlocally.py | |
50 | > EOF |
|
50 | > EOF | |
51 | $ hg -R supported debugrequirements |
|
51 | $ hg -R supported debugrequirements | |
52 | dotencode |
|
52 | dotencode | |
53 |
|
|
53 | dirstate-v2 (dirstate-v2 !) | |
54 | featuresetup-test |
|
54 | featuresetup-test | |
55 | fncache |
|
55 | fncache | |
56 | generaldelta |
|
56 | generaldelta | |
57 | persistent-nodemap (rust !) |
|
57 | persistent-nodemap (rust !) | |
58 | revlog-compression-zstd (zstd !) |
|
58 | revlog-compression-zstd (zstd !) | |
59 | revlogv1 |
|
59 | revlogv1 | |
60 | sparserevlog |
|
60 | sparserevlog | |
61 | store |
|
61 | store | |
62 | $ hg -R supported status |
|
62 | $ hg -R supported status | |
63 |
|
63 | |||
64 | $ hg init push-dst |
|
64 | $ hg init push-dst | |
65 | $ hg -R supported push push-dst |
|
65 | $ hg -R supported push push-dst | |
66 | pushing to push-dst |
|
66 | pushing to push-dst | |
67 | abort: required features are not supported in the destination: featuresetup-test |
|
67 | abort: required features are not supported in the destination: featuresetup-test | |
68 | [255] |
|
68 | [255] | |
69 |
|
69 | |||
70 | $ hg init pull-src |
|
70 | $ hg init pull-src | |
71 | $ hg -R pull-src pull supported |
|
71 | $ hg -R pull-src pull supported | |
72 | pulling from supported |
|
72 | pulling from supported | |
73 | abort: required features are not supported in the destination: featuresetup-test |
|
73 | abort: required features are not supported in the destination: featuresetup-test | |
74 | [255] |
|
74 | [255] | |
75 |
|
75 | |||
76 | $ hg clone supported clone-dst |
|
76 | $ hg clone supported clone-dst | |
77 | abort: repository requires features unknown to this Mercurial: featuresetup-test |
|
77 | abort: repository requires features unknown to this Mercurial: featuresetup-test | |
78 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
|
78 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) | |
79 | [255] |
|
79 | [255] | |
80 | $ hg clone --pull supported clone-dst |
|
80 | $ hg clone --pull supported clone-dst | |
81 | abort: required features are not supported in the destination: featuresetup-test |
|
81 | abort: required features are not supported in the destination: featuresetup-test | |
82 | [255] |
|
82 | [255] | |
83 |
|
83 | |||
84 | $ cd .. |
|
84 | $ cd .. |
@@ -1,139 +1,139 b'' | |||||
1 | #require reporevlogstore |
|
1 | #require reporevlogstore | |
2 |
|
2 | |||
3 | A repo with unknown revlogv2 requirement string cannot be opened |
|
3 | A repo with unknown revlogv2 requirement string cannot be opened | |
4 |
|
4 | |||
5 | $ hg init invalidreq |
|
5 | $ hg init invalidreq | |
6 | $ cd invalidreq |
|
6 | $ cd invalidreq | |
7 | $ echo exp-revlogv2.unknown >> .hg/requires |
|
7 | $ echo exp-revlogv2.unknown >> .hg/requires | |
8 | $ hg log |
|
8 | $ hg log | |
9 | abort: repository requires features unknown to this Mercurial: exp-revlogv2.unknown |
|
9 | abort: repository requires features unknown to this Mercurial: exp-revlogv2.unknown | |
10 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
|
10 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) | |
11 | [255] |
|
11 | [255] | |
12 | $ cd .. |
|
12 | $ cd .. | |
13 |
|
13 | |||
14 | Can create and open repo with revlog v2 requirement |
|
14 | Can create and open repo with revlog v2 requirement | |
15 |
|
15 | |||
16 | $ cat >> $HGRCPATH << EOF |
|
16 | $ cat >> $HGRCPATH << EOF | |
17 | > [experimental] |
|
17 | > [experimental] | |
18 | > revlogv2 = enable-unstable-format-and-corrupt-my-data |
|
18 | > revlogv2 = enable-unstable-format-and-corrupt-my-data | |
19 | > EOF |
|
19 | > EOF | |
20 |
|
20 | |||
21 | $ hg init new-repo |
|
21 | $ hg init new-repo | |
22 | $ cd new-repo |
|
22 | $ cd new-repo | |
23 | $ cat .hg/requires |
|
23 | $ cat .hg/requires | |
24 | dotencode |
|
24 | dotencode | |
25 |
|
|
25 | dirstate-v2 (dirstate-v2 !) | |
26 | exp-revlogv2.2 |
|
26 | exp-revlogv2.2 | |
27 | fncache |
|
27 | fncache | |
28 | generaldelta |
|
28 | generaldelta | |
29 | persistent-nodemap (rust !) |
|
29 | persistent-nodemap (rust !) | |
30 | revlog-compression-zstd (zstd !) |
|
30 | revlog-compression-zstd (zstd !) | |
31 | sparserevlog |
|
31 | sparserevlog | |
32 | store |
|
32 | store | |
33 |
|
33 | |||
34 | $ hg log |
|
34 | $ hg log | |
35 |
|
35 | |||
36 | Unknown flags to revlog are rejected |
|
36 | Unknown flags to revlog are rejected | |
37 |
|
37 | |||
38 | >>> with open('.hg/store/00changelog.i', 'wb') as fh: |
|
38 | >>> with open('.hg/store/00changelog.i', 'wb') as fh: | |
39 | ... fh.write(b'\xff\x00\xde\xad') and None |
|
39 | ... fh.write(b'\xff\x00\xde\xad') and None | |
40 |
|
40 | |||
41 | $ hg log |
|
41 | $ hg log | |
42 | abort: unknown flags (0xff00) in version 57005 revlog 00changelog |
|
42 | abort: unknown flags (0xff00) in version 57005 revlog 00changelog | |
43 | [50] |
|
43 | [50] | |
44 |
|
44 | |||
45 | $ cd .. |
|
45 | $ cd .. | |
46 |
|
46 | |||
47 | Writing a simple revlog v2 works |
|
47 | Writing a simple revlog v2 works | |
48 |
|
48 | |||
49 | $ hg init simple |
|
49 | $ hg init simple | |
50 | $ cd simple |
|
50 | $ cd simple | |
51 | $ touch foo |
|
51 | $ touch foo | |
52 | $ hg -q commit -A -m initial |
|
52 | $ hg -q commit -A -m initial | |
53 |
|
53 | |||
54 | $ hg log |
|
54 | $ hg log | |
55 | changeset: 0:96ee1d7354c4 |
|
55 | changeset: 0:96ee1d7354c4 | |
56 | tag: tip |
|
56 | tag: tip | |
57 | user: test |
|
57 | user: test | |
58 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
58 | date: Thu Jan 01 00:00:00 1970 +0000 | |
59 | summary: initial |
|
59 | summary: initial | |
60 |
|
60 | |||
61 |
|
61 | |||
62 | Header written as expected |
|
62 | Header written as expected | |
63 |
|
63 | |||
64 | $ f --hexdump --bytes 4 .hg/store/00changelog.i |
|
64 | $ f --hexdump --bytes 4 .hg/store/00changelog.i | |
65 | .hg/store/00changelog.i: |
|
65 | .hg/store/00changelog.i: | |
66 | 0000: 00 00 de ad |....| |
|
66 | 0000: 00 00 de ad |....| | |
67 |
|
67 | |||
68 | $ f --hexdump --bytes 4 .hg/store/data/foo.i |
|
68 | $ f --hexdump --bytes 4 .hg/store/data/foo.i | |
69 | .hg/store/data/foo.i: |
|
69 | .hg/store/data/foo.i: | |
70 | 0000: 00 00 de ad |....| |
|
70 | 0000: 00 00 de ad |....| | |
71 |
|
71 | |||
72 | Bundle use a compatible changegroup format |
|
72 | Bundle use a compatible changegroup format | |
73 | ------------------------------------------ |
|
73 | ------------------------------------------ | |
74 |
|
74 | |||
75 | $ hg bundle --all ../basic.hg |
|
75 | $ hg bundle --all ../basic.hg | |
76 | 1 changesets found |
|
76 | 1 changesets found | |
77 | $ hg debugbundle --spec ../basic.hg |
|
77 | $ hg debugbundle --spec ../basic.hg | |
78 | bzip2-v2 |
|
78 | bzip2-v2 | |
79 |
|
79 | |||
80 | The expected files are generated |
|
80 | The expected files are generated | |
81 | -------------------------------- |
|
81 | -------------------------------- | |
82 |
|
82 | |||
83 | We should have have: |
|
83 | We should have have: | |
84 | - a docket |
|
84 | - a docket | |
85 | - a index file with a unique name |
|
85 | - a index file with a unique name | |
86 | - a data file |
|
86 | - a data file | |
87 |
|
87 | |||
88 | $ ls .hg/store/00changelog* .hg/store/00manifest* |
|
88 | $ ls .hg/store/00changelog* .hg/store/00manifest* | |
89 | .hg/store/00changelog-1335303a.sda |
|
89 | .hg/store/00changelog-1335303a.sda | |
90 | .hg/store/00changelog-6b8ab34b.idx |
|
90 | .hg/store/00changelog-6b8ab34b.idx | |
91 | .hg/store/00changelog-b875dfc5.dat |
|
91 | .hg/store/00changelog-b875dfc5.dat | |
92 | .hg/store/00changelog.i |
|
92 | .hg/store/00changelog.i | |
93 | .hg/store/00manifest-05a21d65.idx |
|
93 | .hg/store/00manifest-05a21d65.idx | |
94 | .hg/store/00manifest-43c37dde.dat |
|
94 | .hg/store/00manifest-43c37dde.dat | |
95 | .hg/store/00manifest-e2c9362a.sda |
|
95 | .hg/store/00manifest-e2c9362a.sda | |
96 | .hg/store/00manifest.i |
|
96 | .hg/store/00manifest.i | |
97 |
|
97 | |||
98 | Local clone works |
|
98 | Local clone works | |
99 | ----------------- |
|
99 | ----------------- | |
100 |
|
100 | |||
101 | $ hg clone . ../cloned-repo |
|
101 | $ hg clone . ../cloned-repo | |
102 | updating to branch default |
|
102 | updating to branch default | |
103 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
103 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
104 | $ hg tip | tee ../tip-new |
|
104 | $ hg tip | tee ../tip-new | |
105 | changeset: 0:96ee1d7354c4 |
|
105 | changeset: 0:96ee1d7354c4 | |
106 | tag: tip |
|
106 | tag: tip | |
107 | user: test |
|
107 | user: test | |
108 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
108 | date: Thu Jan 01 00:00:00 1970 +0000 | |
109 | summary: initial |
|
109 | summary: initial | |
110 |
|
110 | |||
111 | $ hg tip -R ../cloned-repo | tee ../tip-cloned |
|
111 | $ hg tip -R ../cloned-repo | tee ../tip-cloned | |
112 | changeset: 0:96ee1d7354c4 |
|
112 | changeset: 0:96ee1d7354c4 | |
113 | tag: tip |
|
113 | tag: tip | |
114 | user: test |
|
114 | user: test | |
115 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
115 | date: Thu Jan 01 00:00:00 1970 +0000 | |
116 | summary: initial |
|
116 | summary: initial | |
117 |
|
117 | |||
118 |
|
118 | |||
119 | The two repository should be identical, this diff MUST be empty |
|
119 | The two repository should be identical, this diff MUST be empty | |
120 |
|
120 | |||
121 | $ cmp ../tip-new ../tip-cloned || diff -U8 ../tip-new ../tip-cloned |
|
121 | $ cmp ../tip-new ../tip-cloned || diff -U8 ../tip-new ../tip-cloned | |
122 |
|
122 | |||
123 |
|
123 | |||
124 | hg verify should be happy |
|
124 | hg verify should be happy | |
125 | ------------------------- |
|
125 | ------------------------- | |
126 |
|
126 | |||
127 | $ hg verify |
|
127 | $ hg verify | |
128 | checking changesets |
|
128 | checking changesets | |
129 | checking manifests |
|
129 | checking manifests | |
130 | crosschecking files in changesets and manifests |
|
130 | crosschecking files in changesets and manifests | |
131 | checking files |
|
131 | checking files | |
132 | checked 1 changesets with 1 changes to 1 files |
|
132 | checked 1 changesets with 1 changes to 1 files | |
133 |
|
133 | |||
134 | $ hg verify -R ../cloned-repo |
|
134 | $ hg verify -R ../cloned-repo | |
135 | checking changesets |
|
135 | checking changesets | |
136 | checking manifests |
|
136 | checking manifests | |
137 | crosschecking files in changesets and manifests |
|
137 | crosschecking files in changesets and manifests | |
138 | checking files |
|
138 | checking files | |
139 | checked 1 changesets with 1 changes to 1 files |
|
139 | checked 1 changesets with 1 changes to 1 files |
@@ -1,619 +1,619 b'' | |||||
1 | setup |
|
1 | setup | |
2 |
|
2 | |||
3 | $ cat >> $HGRCPATH <<EOF |
|
3 | $ cat >> $HGRCPATH <<EOF | |
4 | > [extensions] |
|
4 | > [extensions] | |
5 | > share = |
|
5 | > share = | |
6 | > [format] |
|
6 | > [format] | |
7 | > use-share-safe = True |
|
7 | > use-share-safe = True | |
8 | > [storage] |
|
8 | > [storage] | |
9 | > revlog.persistent-nodemap.slow-path=allow |
|
9 | > revlog.persistent-nodemap.slow-path=allow | |
10 | > # enforce zlib to ensure we can upgrade to zstd later |
|
10 | > # enforce zlib to ensure we can upgrade to zstd later | |
11 | > [format] |
|
11 | > [format] | |
12 | > revlog-compression=zlib |
|
12 | > revlog-compression=zlib | |
13 | > # we want to be able to enable it later |
|
13 | > # we want to be able to enable it later | |
14 | > use-persistent-nodemap=no |
|
14 | > use-persistent-nodemap=no | |
15 | > EOF |
|
15 | > EOF | |
16 |
|
16 | |||
17 | prepare source repo |
|
17 | prepare source repo | |
18 |
|
18 | |||
19 | $ hg init source |
|
19 | $ hg init source | |
20 | $ cd source |
|
20 | $ cd source | |
21 | $ cat .hg/requires |
|
21 | $ cat .hg/requires | |
22 |
|
|
22 | dirstate-v2 (dirstate-v2 !) | |
23 | share-safe |
|
23 | share-safe | |
24 | $ cat .hg/store/requires |
|
24 | $ cat .hg/store/requires | |
25 | dotencode |
|
25 | dotencode | |
26 | fncache |
|
26 | fncache | |
27 | generaldelta |
|
27 | generaldelta | |
28 | revlogv1 |
|
28 | revlogv1 | |
29 | sparserevlog |
|
29 | sparserevlog | |
30 | store |
|
30 | store | |
31 | $ hg debugrequirements |
|
31 | $ hg debugrequirements | |
32 | dotencode |
|
32 | dotencode | |
33 |
|
|
33 | dirstate-v2 (dirstate-v2 !) | |
34 | fncache |
|
34 | fncache | |
35 | generaldelta |
|
35 | generaldelta | |
36 | revlogv1 |
|
36 | revlogv1 | |
37 | share-safe |
|
37 | share-safe | |
38 | sparserevlog |
|
38 | sparserevlog | |
39 | store |
|
39 | store | |
40 |
|
40 | |||
41 | $ echo a > a |
|
41 | $ echo a > a | |
42 | $ hg ci -Aqm "added a" |
|
42 | $ hg ci -Aqm "added a" | |
43 | $ echo b > b |
|
43 | $ echo b > b | |
44 | $ hg ci -Aqm "added b" |
|
44 | $ hg ci -Aqm "added b" | |
45 |
|
45 | |||
46 | $ HGEDITOR=cat hg config --shared |
|
46 | $ HGEDITOR=cat hg config --shared | |
47 | abort: repository is not shared; can't use --shared |
|
47 | abort: repository is not shared; can't use --shared | |
48 | [10] |
|
48 | [10] | |
49 | $ cd .. |
|
49 | $ cd .. | |
50 |
|
50 | |||
51 | Create a shared repo and check the requirements are shared and read correctly |
|
51 | Create a shared repo and check the requirements are shared and read correctly | |
52 | $ hg share source shared1 |
|
52 | $ hg share source shared1 | |
53 | updating working directory |
|
53 | updating working directory | |
54 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
54 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
55 | $ cd shared1 |
|
55 | $ cd shared1 | |
56 | $ cat .hg/requires |
|
56 | $ cat .hg/requires | |
57 |
|
|
57 | dirstate-v2 (dirstate-v2 !) | |
58 | share-safe |
|
58 | share-safe | |
59 | shared |
|
59 | shared | |
60 |
|
60 | |||
61 | $ hg debugrequirements -R ../source |
|
61 | $ hg debugrequirements -R ../source | |
62 | dotencode |
|
62 | dotencode | |
63 |
|
|
63 | dirstate-v2 (dirstate-v2 !) | |
64 | fncache |
|
64 | fncache | |
65 | generaldelta |
|
65 | generaldelta | |
66 | revlogv1 |
|
66 | revlogv1 | |
67 | share-safe |
|
67 | share-safe | |
68 | sparserevlog |
|
68 | sparserevlog | |
69 | store |
|
69 | store | |
70 |
|
70 | |||
71 | $ hg debugrequirements |
|
71 | $ hg debugrequirements | |
72 | dotencode |
|
72 | dotencode | |
73 |
|
|
73 | dirstate-v2 (dirstate-v2 !) | |
74 | fncache |
|
74 | fncache | |
75 | generaldelta |
|
75 | generaldelta | |
76 | revlogv1 |
|
76 | revlogv1 | |
77 | share-safe |
|
77 | share-safe | |
78 | shared |
|
78 | shared | |
79 | sparserevlog |
|
79 | sparserevlog | |
80 | store |
|
80 | store | |
81 |
|
81 | |||
82 | $ echo c > c |
|
82 | $ echo c > c | |
83 | $ hg ci -Aqm "added c" |
|
83 | $ hg ci -Aqm "added c" | |
84 |
|
84 | |||
85 | Check that config of the source repository is also loaded |
|
85 | Check that config of the source repository is also loaded | |
86 |
|
86 | |||
87 | $ hg showconfig ui.curses |
|
87 | $ hg showconfig ui.curses | |
88 | [1] |
|
88 | [1] | |
89 |
|
89 | |||
90 | $ echo "[ui]" >> ../source/.hg/hgrc |
|
90 | $ echo "[ui]" >> ../source/.hg/hgrc | |
91 | $ echo "curses=true" >> ../source/.hg/hgrc |
|
91 | $ echo "curses=true" >> ../source/.hg/hgrc | |
92 |
|
92 | |||
93 | $ hg showconfig ui.curses |
|
93 | $ hg showconfig ui.curses | |
94 | true |
|
94 | true | |
95 |
|
95 | |||
96 | Test that extensions of source repository are also loaded |
|
96 | Test that extensions of source repository are also loaded | |
97 |
|
97 | |||
98 | $ hg debugextensions |
|
98 | $ hg debugextensions | |
99 | share |
|
99 | share | |
100 | $ hg extdiff -p echo |
|
100 | $ hg extdiff -p echo | |
101 | hg: unknown command 'extdiff' |
|
101 | hg: unknown command 'extdiff' | |
102 | 'extdiff' is provided by the following extension: |
|
102 | 'extdiff' is provided by the following extension: | |
103 |
|
103 | |||
104 | extdiff command to allow external programs to compare revisions |
|
104 | extdiff command to allow external programs to compare revisions | |
105 |
|
105 | |||
106 | (use 'hg help extensions' for information on enabling extensions) |
|
106 | (use 'hg help extensions' for information on enabling extensions) | |
107 | [10] |
|
107 | [10] | |
108 |
|
108 | |||
109 | $ echo "[extensions]" >> ../source/.hg/hgrc |
|
109 | $ echo "[extensions]" >> ../source/.hg/hgrc | |
110 | $ echo "extdiff=" >> ../source/.hg/hgrc |
|
110 | $ echo "extdiff=" >> ../source/.hg/hgrc | |
111 |
|
111 | |||
112 | $ hg debugextensions -R ../source |
|
112 | $ hg debugextensions -R ../source | |
113 | extdiff |
|
113 | extdiff | |
114 | share |
|
114 | share | |
115 | $ hg extdiff -R ../source -p echo |
|
115 | $ hg extdiff -R ../source -p echo | |
116 |
|
116 | |||
117 | BROKEN: the command below will not work if config of shared source is not loaded |
|
117 | BROKEN: the command below will not work if config of shared source is not loaded | |
118 | on dispatch but debugextensions says that extension |
|
118 | on dispatch but debugextensions says that extension | |
119 | is loaded |
|
119 | is loaded | |
120 | $ hg debugextensions |
|
120 | $ hg debugextensions | |
121 | extdiff |
|
121 | extdiff | |
122 | share |
|
122 | share | |
123 |
|
123 | |||
124 | $ hg extdiff -p echo |
|
124 | $ hg extdiff -p echo | |
125 |
|
125 | |||
126 | However, local .hg/hgrc should override the config set by share source |
|
126 | However, local .hg/hgrc should override the config set by share source | |
127 |
|
127 | |||
128 | $ echo "[ui]" >> .hg/hgrc |
|
128 | $ echo "[ui]" >> .hg/hgrc | |
129 | $ echo "curses=false" >> .hg/hgrc |
|
129 | $ echo "curses=false" >> .hg/hgrc | |
130 |
|
130 | |||
131 | $ hg showconfig ui.curses |
|
131 | $ hg showconfig ui.curses | |
132 | false |
|
132 | false | |
133 |
|
133 | |||
134 | $ HGEDITOR=cat hg config --shared |
|
134 | $ HGEDITOR=cat hg config --shared | |
135 | [ui] |
|
135 | [ui] | |
136 | curses=true |
|
136 | curses=true | |
137 | [extensions] |
|
137 | [extensions] | |
138 | extdiff= |
|
138 | extdiff= | |
139 |
|
139 | |||
140 | $ HGEDITOR=cat hg config --local |
|
140 | $ HGEDITOR=cat hg config --local | |
141 | [ui] |
|
141 | [ui] | |
142 | curses=false |
|
142 | curses=false | |
143 |
|
143 | |||
144 | Testing that hooks set in source repository also runs in shared repo |
|
144 | Testing that hooks set in source repository also runs in shared repo | |
145 |
|
145 | |||
146 | $ cd ../source |
|
146 | $ cd ../source | |
147 | $ cat <<EOF >> .hg/hgrc |
|
147 | $ cat <<EOF >> .hg/hgrc | |
148 | > [extensions] |
|
148 | > [extensions] | |
149 | > hooklib= |
|
149 | > hooklib= | |
150 | > [hooks] |
|
150 | > [hooks] | |
151 | > pretxnchangegroup.reject_merge_commits = \ |
|
151 | > pretxnchangegroup.reject_merge_commits = \ | |
152 | > python:hgext.hooklib.reject_merge_commits.hook |
|
152 | > python:hgext.hooklib.reject_merge_commits.hook | |
153 | > EOF |
|
153 | > EOF | |
154 |
|
154 | |||
155 | $ cd .. |
|
155 | $ cd .. | |
156 | $ hg clone source cloned |
|
156 | $ hg clone source cloned | |
157 | updating to branch default |
|
157 | updating to branch default | |
158 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
158 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
159 | $ cd cloned |
|
159 | $ cd cloned | |
160 | $ hg up 0 |
|
160 | $ hg up 0 | |
161 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
161 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
162 | $ echo bar > bar |
|
162 | $ echo bar > bar | |
163 | $ hg ci -Aqm "added bar" |
|
163 | $ hg ci -Aqm "added bar" | |
164 | $ hg merge |
|
164 | $ hg merge | |
165 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
165 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
166 | (branch merge, don't forget to commit) |
|
166 | (branch merge, don't forget to commit) | |
167 | $ hg ci -m "merge commit" |
|
167 | $ hg ci -m "merge commit" | |
168 |
|
168 | |||
169 | $ hg push ../source |
|
169 | $ hg push ../source | |
170 | pushing to ../source |
|
170 | pushing to ../source | |
171 | searching for changes |
|
171 | searching for changes | |
172 | adding changesets |
|
172 | adding changesets | |
173 | adding manifests |
|
173 | adding manifests | |
174 | adding file changes |
|
174 | adding file changes | |
175 | error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase. |
|
175 | error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase. | |
176 | transaction abort! |
|
176 | transaction abort! | |
177 | rollback completed |
|
177 | rollback completed | |
178 | abort: bcde3522682d rejected as merge on the same branch. Please consider rebase. |
|
178 | abort: bcde3522682d rejected as merge on the same branch. Please consider rebase. | |
179 | [255] |
|
179 | [255] | |
180 |
|
180 | |||
181 | $ hg push ../shared1 |
|
181 | $ hg push ../shared1 | |
182 | pushing to ../shared1 |
|
182 | pushing to ../shared1 | |
183 | searching for changes |
|
183 | searching for changes | |
184 | adding changesets |
|
184 | adding changesets | |
185 | adding manifests |
|
185 | adding manifests | |
186 | adding file changes |
|
186 | adding file changes | |
187 | error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase. |
|
187 | error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase. | |
188 | transaction abort! |
|
188 | transaction abort! | |
189 | rollback completed |
|
189 | rollback completed | |
190 | abort: bcde3522682d rejected as merge on the same branch. Please consider rebase. |
|
190 | abort: bcde3522682d rejected as merge on the same branch. Please consider rebase. | |
191 | [255] |
|
191 | [255] | |
192 |
|
192 | |||
193 | Test that if share source config is untrusted, we dont read it |
|
193 | Test that if share source config is untrusted, we dont read it | |
194 |
|
194 | |||
195 | $ cd ../shared1 |
|
195 | $ cd ../shared1 | |
196 |
|
196 | |||
197 | $ cat << EOF > $TESTTMP/untrusted.py |
|
197 | $ cat << EOF > $TESTTMP/untrusted.py | |
198 | > from mercurial import scmutil, util |
|
198 | > from mercurial import scmutil, util | |
199 | > def uisetup(ui): |
|
199 | > def uisetup(ui): | |
200 | > class untrustedui(ui.__class__): |
|
200 | > class untrustedui(ui.__class__): | |
201 | > def _trusted(self, fp, f): |
|
201 | > def _trusted(self, fp, f): | |
202 | > if util.normpath(fp.name).endswith(b'source/.hg/hgrc'): |
|
202 | > if util.normpath(fp.name).endswith(b'source/.hg/hgrc'): | |
203 | > return False |
|
203 | > return False | |
204 | > return super(untrustedui, self)._trusted(fp, f) |
|
204 | > return super(untrustedui, self)._trusted(fp, f) | |
205 | > ui.__class__ = untrustedui |
|
205 | > ui.__class__ = untrustedui | |
206 | > EOF |
|
206 | > EOF | |
207 |
|
207 | |||
208 | $ hg showconfig hooks |
|
208 | $ hg showconfig hooks | |
209 | hooks.pretxnchangegroup.reject_merge_commits=python:hgext.hooklib.reject_merge_commits.hook |
|
209 | hooks.pretxnchangegroup.reject_merge_commits=python:hgext.hooklib.reject_merge_commits.hook | |
210 |
|
210 | |||
211 | $ hg showconfig hooks --config extensions.untrusted=$TESTTMP/untrusted.py |
|
211 | $ hg showconfig hooks --config extensions.untrusted=$TESTTMP/untrusted.py | |
212 | [1] |
|
212 | [1] | |
213 |
|
213 | |||
214 | Update the source repository format and check that shared repo works |
|
214 | Update the source repository format and check that shared repo works | |
215 |
|
215 | |||
216 | $ cd ../source |
|
216 | $ cd ../source | |
217 |
|
217 | |||
218 | Disable zstd related tests because its not present on pure version |
|
218 | Disable zstd related tests because its not present on pure version | |
219 | #if zstd |
|
219 | #if zstd | |
220 | $ echo "[format]" >> .hg/hgrc |
|
220 | $ echo "[format]" >> .hg/hgrc | |
221 | $ echo "revlog-compression=zstd" >> .hg/hgrc |
|
221 | $ echo "revlog-compression=zstd" >> .hg/hgrc | |
222 |
|
222 | |||
223 | $ hg debugupgraderepo --run -q |
|
223 | $ hg debugupgraderepo --run -q | |
224 | upgrade will perform the following actions: |
|
224 | upgrade will perform the following actions: | |
225 |
|
225 | |||
226 | requirements |
|
226 | requirements | |
227 | preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-dirstate-v2 !) |
|
227 | preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-dirstate-v2 !) | |
228 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (dirstate-v2 !) |
|
228 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (dirstate-v2 !) | |
229 | added: revlog-compression-zstd |
|
229 | added: revlog-compression-zstd | |
230 |
|
230 | |||
231 | processed revlogs: |
|
231 | processed revlogs: | |
232 | - all-filelogs |
|
232 | - all-filelogs | |
233 | - changelog |
|
233 | - changelog | |
234 | - manifest |
|
234 | - manifest | |
235 |
|
235 | |||
236 | $ hg log -r . |
|
236 | $ hg log -r . | |
237 | changeset: 1:5f6d8a4bf34a |
|
237 | changeset: 1:5f6d8a4bf34a | |
238 | user: test |
|
238 | user: test | |
239 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
239 | date: Thu Jan 01 00:00:00 1970 +0000 | |
240 | summary: added b |
|
240 | summary: added b | |
241 |
|
241 | |||
242 | #endif |
|
242 | #endif | |
243 | $ echo "[format]" >> .hg/hgrc |
|
243 | $ echo "[format]" >> .hg/hgrc | |
244 | $ echo "use-persistent-nodemap=True" >> .hg/hgrc |
|
244 | $ echo "use-persistent-nodemap=True" >> .hg/hgrc | |
245 |
|
245 | |||
246 | $ hg debugupgraderepo --run -q -R ../shared1 |
|
246 | $ hg debugupgraderepo --run -q -R ../shared1 | |
247 | abort: cannot upgrade repository; unsupported source requirement: shared |
|
247 | abort: cannot upgrade repository; unsupported source requirement: shared | |
248 | [255] |
|
248 | [255] | |
249 |
|
249 | |||
250 | $ hg debugupgraderepo --run -q |
|
250 | $ hg debugupgraderepo --run -q | |
251 | upgrade will perform the following actions: |
|
251 | upgrade will perform the following actions: | |
252 |
|
252 | |||
253 | requirements |
|
253 | requirements | |
254 | preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd no-dirstate-v2 !) |
|
254 | preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd no-dirstate-v2 !) | |
255 | preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd no-dirstate-v2 !) |
|
255 | preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd no-dirstate-v2 !) | |
256 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd dirstate-v2 !) |
|
256 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd dirstate-v2 !) | |
257 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd dirstate-v2 !) |
|
257 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd dirstate-v2 !) | |
258 | added: persistent-nodemap |
|
258 | added: persistent-nodemap | |
259 |
|
259 | |||
260 | processed revlogs: |
|
260 | processed revlogs: | |
261 | - all-filelogs |
|
261 | - all-filelogs | |
262 | - changelog |
|
262 | - changelog | |
263 | - manifest |
|
263 | - manifest | |
264 |
|
264 | |||
265 | $ hg log -r . |
|
265 | $ hg log -r . | |
266 | changeset: 1:5f6d8a4bf34a |
|
266 | changeset: 1:5f6d8a4bf34a | |
267 | user: test |
|
267 | user: test | |
268 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
268 | date: Thu Jan 01 00:00:00 1970 +0000 | |
269 | summary: added b |
|
269 | summary: added b | |
270 |
|
270 | |||
271 |
|
271 | |||
272 | Shared one should work |
|
272 | Shared one should work | |
273 | $ cd ../shared1 |
|
273 | $ cd ../shared1 | |
274 | $ hg log -r . |
|
274 | $ hg log -r . | |
275 | changeset: 2:155349b645be |
|
275 | changeset: 2:155349b645be | |
276 | tag: tip |
|
276 | tag: tip | |
277 | user: test |
|
277 | user: test | |
278 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
278 | date: Thu Jan 01 00:00:00 1970 +0000 | |
279 | summary: added c |
|
279 | summary: added c | |
280 |
|
280 | |||
281 |
|
281 | |||
282 | Testing that nonsharedrc is loaded for source and not shared |
|
282 | Testing that nonsharedrc is loaded for source and not shared | |
283 |
|
283 | |||
284 | $ cd ../source |
|
284 | $ cd ../source | |
285 | $ touch .hg/hgrc-not-shared |
|
285 | $ touch .hg/hgrc-not-shared | |
286 | $ echo "[ui]" >> .hg/hgrc-not-shared |
|
286 | $ echo "[ui]" >> .hg/hgrc-not-shared | |
287 | $ echo "traceback=true" >> .hg/hgrc-not-shared |
|
287 | $ echo "traceback=true" >> .hg/hgrc-not-shared | |
288 |
|
288 | |||
289 | $ hg showconfig ui.traceback |
|
289 | $ hg showconfig ui.traceback | |
290 | true |
|
290 | true | |
291 |
|
291 | |||
292 | $ HGEDITOR=cat hg config --non-shared |
|
292 | $ HGEDITOR=cat hg config --non-shared | |
293 | [ui] |
|
293 | [ui] | |
294 | traceback=true |
|
294 | traceback=true | |
295 |
|
295 | |||
296 | $ cd ../shared1 |
|
296 | $ cd ../shared1 | |
297 | $ hg showconfig ui.traceback |
|
297 | $ hg showconfig ui.traceback | |
298 | [1] |
|
298 | [1] | |
299 |
|
299 | |||
300 | Unsharing works |
|
300 | Unsharing works | |
301 |
|
301 | |||
302 | $ hg unshare |
|
302 | $ hg unshare | |
303 |
|
303 | |||
304 | Test that source config is added to the shared one after unshare, and the config |
|
304 | Test that source config is added to the shared one after unshare, and the config | |
305 | of current repo is still respected over the config which came from source config |
|
305 | of current repo is still respected over the config which came from source config | |
306 | $ cd ../cloned |
|
306 | $ cd ../cloned | |
307 | $ hg push ../shared1 |
|
307 | $ hg push ../shared1 | |
308 | pushing to ../shared1 |
|
308 | pushing to ../shared1 | |
309 | searching for changes |
|
309 | searching for changes | |
310 | adding changesets |
|
310 | adding changesets | |
311 | adding manifests |
|
311 | adding manifests | |
312 | adding file changes |
|
312 | adding file changes | |
313 | error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase. |
|
313 | error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase. | |
314 | transaction abort! |
|
314 | transaction abort! | |
315 | rollback completed |
|
315 | rollback completed | |
316 | abort: bcde3522682d rejected as merge on the same branch. Please consider rebase. |
|
316 | abort: bcde3522682d rejected as merge on the same branch. Please consider rebase. | |
317 | [255] |
|
317 | [255] | |
318 | $ hg showconfig ui.curses -R ../shared1 |
|
318 | $ hg showconfig ui.curses -R ../shared1 | |
319 | false |
|
319 | false | |
320 |
|
320 | |||
321 | $ cd ../ |
|
321 | $ cd ../ | |
322 |
|
322 | |||
323 | Test that upgrading using debugupgraderepo works |
|
323 | Test that upgrading using debugupgraderepo works | |
324 | ================================================= |
|
324 | ================================================= | |
325 |
|
325 | |||
326 | $ hg init non-share-safe --config format.use-share-safe=false |
|
326 | $ hg init non-share-safe --config format.use-share-safe=false | |
327 | $ cd non-share-safe |
|
327 | $ cd non-share-safe | |
328 | $ hg debugrequirements |
|
328 | $ hg debugrequirements | |
329 | dotencode |
|
329 | dotencode | |
330 |
|
|
330 | dirstate-v2 (dirstate-v2 !) | |
331 | fncache |
|
331 | fncache | |
332 | generaldelta |
|
332 | generaldelta | |
333 | revlogv1 |
|
333 | revlogv1 | |
334 | sparserevlog |
|
334 | sparserevlog | |
335 | store |
|
335 | store | |
336 | $ echo foo > foo |
|
336 | $ echo foo > foo | |
337 | $ hg ci -Aqm 'added foo' |
|
337 | $ hg ci -Aqm 'added foo' | |
338 | $ echo bar > bar |
|
338 | $ echo bar > bar | |
339 | $ hg ci -Aqm 'added bar' |
|
339 | $ hg ci -Aqm 'added bar' | |
340 |
|
340 | |||
341 | Create a share before upgrading |
|
341 | Create a share before upgrading | |
342 |
|
342 | |||
343 | $ cd .. |
|
343 | $ cd .. | |
344 | $ hg share non-share-safe nss-share |
|
344 | $ hg share non-share-safe nss-share | |
345 | updating working directory |
|
345 | updating working directory | |
346 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
346 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
347 | $ hg debugrequirements -R nss-share |
|
347 | $ hg debugrequirements -R nss-share | |
348 | dotencode |
|
348 | dotencode | |
349 |
|
|
349 | dirstate-v2 (dirstate-v2 !) | |
350 | fncache |
|
350 | fncache | |
351 | generaldelta |
|
351 | generaldelta | |
352 | revlogv1 |
|
352 | revlogv1 | |
353 | shared |
|
353 | shared | |
354 | sparserevlog |
|
354 | sparserevlog | |
355 | store |
|
355 | store | |
356 | $ cd non-share-safe |
|
356 | $ cd non-share-safe | |
357 |
|
357 | |||
358 | Upgrade |
|
358 | Upgrade | |
359 |
|
359 | |||
360 | $ hg debugupgraderepo -q |
|
360 | $ hg debugupgraderepo -q | |
361 | requirements |
|
361 | requirements | |
362 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) |
|
362 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) | |
363 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) |
|
363 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) | |
364 | added: share-safe |
|
364 | added: share-safe | |
365 |
|
365 | |||
366 | processed revlogs: |
|
366 | processed revlogs: | |
367 | - all-filelogs |
|
367 | - all-filelogs | |
368 | - changelog |
|
368 | - changelog | |
369 | - manifest |
|
369 | - manifest | |
370 |
|
370 | |||
371 | $ hg debugupgraderepo --run |
|
371 | $ hg debugupgraderepo --run | |
372 | upgrade will perform the following actions: |
|
372 | upgrade will perform the following actions: | |
373 |
|
373 | |||
374 | requirements |
|
374 | requirements | |
375 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) |
|
375 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) | |
376 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) |
|
376 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) | |
377 | added: share-safe |
|
377 | added: share-safe | |
378 |
|
378 | |||
379 | share-safe |
|
379 | share-safe | |
380 | Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs. |
|
380 | Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs. | |
381 |
|
381 | |||
382 | processed revlogs: |
|
382 | processed revlogs: | |
383 | - all-filelogs |
|
383 | - all-filelogs | |
384 | - changelog |
|
384 | - changelog | |
385 | - manifest |
|
385 | - manifest | |
386 |
|
386 | |||
387 | beginning upgrade... |
|
387 | beginning upgrade... | |
388 | repository locked and read-only |
|
388 | repository locked and read-only | |
389 | creating temporary repository to stage upgraded data: $TESTTMP/non-share-safe/.hg/upgrade.* (glob) |
|
389 | creating temporary repository to stage upgraded data: $TESTTMP/non-share-safe/.hg/upgrade.* (glob) | |
390 | (it is safe to interrupt this process any time before data migration completes) |
|
390 | (it is safe to interrupt this process any time before data migration completes) | |
391 | upgrading repository requirements |
|
391 | upgrading repository requirements | |
392 | removing temporary repository $TESTTMP/non-share-safe/.hg/upgrade.* (glob) |
|
392 | removing temporary repository $TESTTMP/non-share-safe/.hg/upgrade.* (glob) | |
393 | repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode. |
|
393 | repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode. | |
394 |
|
394 | |||
395 | $ hg debugrequirements |
|
395 | $ hg debugrequirements | |
396 | dotencode |
|
396 | dotencode | |
397 |
|
|
397 | dirstate-v2 (dirstate-v2 !) | |
398 | fncache |
|
398 | fncache | |
399 | generaldelta |
|
399 | generaldelta | |
400 | revlogv1 |
|
400 | revlogv1 | |
401 | share-safe |
|
401 | share-safe | |
402 | sparserevlog |
|
402 | sparserevlog | |
403 | store |
|
403 | store | |
404 |
|
404 | |||
405 | $ cat .hg/requires |
|
405 | $ cat .hg/requires | |
406 |
|
|
406 | dirstate-v2 (dirstate-v2 !) | |
407 | share-safe |
|
407 | share-safe | |
408 |
|
408 | |||
409 | $ cat .hg/store/requires |
|
409 | $ cat .hg/store/requires | |
410 | dotencode |
|
410 | dotencode | |
411 | fncache |
|
411 | fncache | |
412 | generaldelta |
|
412 | generaldelta | |
413 | revlogv1 |
|
413 | revlogv1 | |
414 | sparserevlog |
|
414 | sparserevlog | |
415 | store |
|
415 | store | |
416 |
|
416 | |||
417 | $ hg log -GT "{node}: {desc}\n" |
|
417 | $ hg log -GT "{node}: {desc}\n" | |
418 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
418 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar | |
419 | | |
|
419 | | | |
420 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
420 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo | |
421 |
|
421 | |||
422 |
|
422 | |||
423 | Make sure existing shares dont work with default config |
|
423 | Make sure existing shares dont work with default config | |
424 |
|
424 | |||
425 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share |
|
425 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share | |
426 | abort: version mismatch: source uses share-safe functionality while the current share does not |
|
426 | abort: version mismatch: source uses share-safe functionality while the current share does not | |
427 | (see `hg help config.format.use-share-safe` for more information) |
|
427 | (see `hg help config.format.use-share-safe` for more information) | |
428 | [255] |
|
428 | [255] | |
429 |
|
429 | |||
430 |
|
430 | |||
431 | Create a safe share from upgrade one |
|
431 | Create a safe share from upgrade one | |
432 |
|
432 | |||
433 | $ cd .. |
|
433 | $ cd .. | |
434 | $ hg share non-share-safe ss-share |
|
434 | $ hg share non-share-safe ss-share | |
435 | updating working directory |
|
435 | updating working directory | |
436 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
436 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
437 | $ cd ss-share |
|
437 | $ cd ss-share | |
438 | $ hg log -GT "{node}: {desc}\n" |
|
438 | $ hg log -GT "{node}: {desc}\n" | |
439 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
439 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar | |
440 | | |
|
440 | | | |
441 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
441 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo | |
442 |
|
442 | |||
443 | $ cd ../non-share-safe |
|
443 | $ cd ../non-share-safe | |
444 |
|
444 | |||
445 | Test that downgrading works too |
|
445 | Test that downgrading works too | |
446 |
|
446 | |||
447 | $ cat >> $HGRCPATH <<EOF |
|
447 | $ cat >> $HGRCPATH <<EOF | |
448 | > [extensions] |
|
448 | > [extensions] | |
449 | > share = |
|
449 | > share = | |
450 | > [format] |
|
450 | > [format] | |
451 | > use-share-safe = False |
|
451 | > use-share-safe = False | |
452 | > EOF |
|
452 | > EOF | |
453 |
|
453 | |||
454 | $ hg debugupgraderepo -q |
|
454 | $ hg debugupgraderepo -q | |
455 | requirements |
|
455 | requirements | |
456 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) |
|
456 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) | |
457 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) |
|
457 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) | |
458 | removed: share-safe |
|
458 | removed: share-safe | |
459 |
|
459 | |||
460 | processed revlogs: |
|
460 | processed revlogs: | |
461 | - all-filelogs |
|
461 | - all-filelogs | |
462 | - changelog |
|
462 | - changelog | |
463 | - manifest |
|
463 | - manifest | |
464 |
|
464 | |||
465 | $ hg debugupgraderepo --run |
|
465 | $ hg debugupgraderepo --run | |
466 | upgrade will perform the following actions: |
|
466 | upgrade will perform the following actions: | |
467 |
|
467 | |||
468 | requirements |
|
468 | requirements | |
469 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) |
|
469 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) | |
470 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) |
|
470 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) | |
471 | removed: share-safe |
|
471 | removed: share-safe | |
472 |
|
472 | |||
473 | processed revlogs: |
|
473 | processed revlogs: | |
474 | - all-filelogs |
|
474 | - all-filelogs | |
475 | - changelog |
|
475 | - changelog | |
476 | - manifest |
|
476 | - manifest | |
477 |
|
477 | |||
478 | beginning upgrade... |
|
478 | beginning upgrade... | |
479 | repository locked and read-only |
|
479 | repository locked and read-only | |
480 | creating temporary repository to stage upgraded data: $TESTTMP/non-share-safe/.hg/upgrade.* (glob) |
|
480 | creating temporary repository to stage upgraded data: $TESTTMP/non-share-safe/.hg/upgrade.* (glob) | |
481 | (it is safe to interrupt this process any time before data migration completes) |
|
481 | (it is safe to interrupt this process any time before data migration completes) | |
482 | upgrading repository requirements |
|
482 | upgrading repository requirements | |
483 | removing temporary repository $TESTTMP/non-share-safe/.hg/upgrade.* (glob) |
|
483 | removing temporary repository $TESTTMP/non-share-safe/.hg/upgrade.* (glob) | |
484 | repository downgraded to not use share safe mode, existing shares will not work and needs to be reshared. |
|
484 | repository downgraded to not use share safe mode, existing shares will not work and needs to be reshared. | |
485 |
|
485 | |||
486 | $ hg debugrequirements |
|
486 | $ hg debugrequirements | |
487 | dotencode |
|
487 | dotencode | |
488 |
|
|
488 | dirstate-v2 (dirstate-v2 !) | |
489 | fncache |
|
489 | fncache | |
490 | generaldelta |
|
490 | generaldelta | |
491 | revlogv1 |
|
491 | revlogv1 | |
492 | sparserevlog |
|
492 | sparserevlog | |
493 | store |
|
493 | store | |
494 |
|
494 | |||
495 | $ cat .hg/requires |
|
495 | $ cat .hg/requires | |
496 | dotencode |
|
496 | dotencode | |
497 |
|
|
497 | dirstate-v2 (dirstate-v2 !) | |
498 | fncache |
|
498 | fncache | |
499 | generaldelta |
|
499 | generaldelta | |
500 | revlogv1 |
|
500 | revlogv1 | |
501 | sparserevlog |
|
501 | sparserevlog | |
502 | store |
|
502 | store | |
503 |
|
503 | |||
504 | $ test -f .hg/store/requires |
|
504 | $ test -f .hg/store/requires | |
505 | [1] |
|
505 | [1] | |
506 |
|
506 | |||
507 | $ hg log -GT "{node}: {desc}\n" |
|
507 | $ hg log -GT "{node}: {desc}\n" | |
508 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
508 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar | |
509 | | |
|
509 | | | |
510 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
510 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo | |
511 |
|
511 | |||
512 |
|
512 | |||
513 | Make sure existing shares still works |
|
513 | Make sure existing shares still works | |
514 |
|
514 | |||
515 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share |
|
515 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share | |
516 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
516 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar | |
517 | | |
|
517 | | | |
518 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
518 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo | |
519 |
|
519 | |||
520 |
|
520 | |||
521 | $ hg log -GT "{node}: {desc}\n" -R ../ss-share |
|
521 | $ hg log -GT "{node}: {desc}\n" -R ../ss-share | |
522 | abort: share source does not support share-safe requirement |
|
522 | abort: share source does not support share-safe requirement | |
523 | (see `hg help config.format.use-share-safe` for more information) |
|
523 | (see `hg help config.format.use-share-safe` for more information) | |
524 | [255] |
|
524 | [255] | |
525 |
|
525 | |||
526 | Testing automatic downgrade of shares when config is set |
|
526 | Testing automatic downgrade of shares when config is set | |
527 |
|
527 | |||
528 | $ touch ../ss-share/.hg/wlock |
|
528 | $ touch ../ss-share/.hg/wlock | |
529 | $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort |
|
529 | $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort | |
530 | abort: failed to downgrade share, got error: Lock held |
|
530 | abort: failed to downgrade share, got error: Lock held | |
531 | (see `hg help config.format.use-share-safe` for more information) |
|
531 | (see `hg help config.format.use-share-safe` for more information) | |
532 | [255] |
|
532 | [255] | |
533 | $ rm ../ss-share/.hg/wlock |
|
533 | $ rm ../ss-share/.hg/wlock | |
534 |
|
534 | |||
535 | $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort |
|
535 | $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config share.safe-mismatch.source-not-safe=downgrade-abort | |
536 | repository downgraded to not use share-safe mode |
|
536 | repository downgraded to not use share-safe mode | |
537 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
537 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar | |
538 | | |
|
538 | | | |
539 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
539 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo | |
540 |
|
540 | |||
541 |
|
541 | |||
542 | $ hg log -GT "{node}: {desc}\n" -R ../ss-share |
|
542 | $ hg log -GT "{node}: {desc}\n" -R ../ss-share | |
543 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
543 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar | |
544 | | |
|
544 | | | |
545 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
545 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo | |
546 |
|
546 | |||
547 |
|
547 | |||
548 |
|
548 | |||
549 | Testing automatic upgrade of shares when config is set |
|
549 | Testing automatic upgrade of shares when config is set | |
550 |
|
550 | |||
551 | $ hg debugupgraderepo -q --run --config format.use-share-safe=True |
|
551 | $ hg debugupgraderepo -q --run --config format.use-share-safe=True | |
552 | upgrade will perform the following actions: |
|
552 | upgrade will perform the following actions: | |
553 |
|
553 | |||
554 | requirements |
|
554 | requirements | |
555 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) |
|
555 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-dirstate-v2 !) | |
556 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) |
|
556 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlogv1, sparserevlog, store (dirstate-v2 !) | |
557 | added: share-safe |
|
557 | added: share-safe | |
558 |
|
558 | |||
559 | processed revlogs: |
|
559 | processed revlogs: | |
560 | - all-filelogs |
|
560 | - all-filelogs | |
561 | - changelog |
|
561 | - changelog | |
562 | - manifest |
|
562 | - manifest | |
563 |
|
563 | |||
564 | repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode. |
|
564 | repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode. | |
565 | $ hg debugrequirements |
|
565 | $ hg debugrequirements | |
566 | dotencode |
|
566 | dotencode | |
567 |
|
|
567 | dirstate-v2 (dirstate-v2 !) | |
568 | fncache |
|
568 | fncache | |
569 | generaldelta |
|
569 | generaldelta | |
570 | revlogv1 |
|
570 | revlogv1 | |
571 | share-safe |
|
571 | share-safe | |
572 | sparserevlog |
|
572 | sparserevlog | |
573 | store |
|
573 | store | |
574 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share |
|
574 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share | |
575 | abort: version mismatch: source uses share-safe functionality while the current share does not |
|
575 | abort: version mismatch: source uses share-safe functionality while the current share does not | |
576 | (see `hg help config.format.use-share-safe` for more information) |
|
576 | (see `hg help config.format.use-share-safe` for more information) | |
577 | [255] |
|
577 | [255] | |
578 |
|
578 | |||
579 | Check that if lock is taken, upgrade fails but read operation are successful |
|
579 | Check that if lock is taken, upgrade fails but read operation are successful | |
580 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgra |
|
580 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgra | |
581 | abort: share-safe mismatch with source. |
|
581 | abort: share-safe mismatch with source. | |
582 | Unrecognized value 'upgra' of `share.safe-mismatch.source-safe` set. |
|
582 | Unrecognized value 'upgra' of `share.safe-mismatch.source-safe` set. | |
583 | (see `hg help config.format.use-share-safe` for more information) |
|
583 | (see `hg help config.format.use-share-safe` for more information) | |
584 | [255] |
|
584 | [255] | |
585 | $ touch ../nss-share/.hg/wlock |
|
585 | $ touch ../nss-share/.hg/wlock | |
586 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow |
|
586 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow | |
587 | failed to upgrade share, got error: Lock held |
|
587 | failed to upgrade share, got error: Lock held | |
588 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
588 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar | |
589 | | |
|
589 | | | |
590 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
590 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo | |
591 |
|
591 | |||
592 |
|
592 | |||
593 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow --config share.safe-mismatch.source-safe.warn=False |
|
593 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-allow --config share.safe-mismatch.source-safe.warn=False | |
594 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
594 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar | |
595 | | |
|
595 | | | |
596 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
596 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo | |
597 |
|
597 | |||
598 |
|
598 | |||
599 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort |
|
599 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort | |
600 | abort: failed to upgrade share, got error: Lock held |
|
600 | abort: failed to upgrade share, got error: Lock held | |
601 | (see `hg help config.format.use-share-safe` for more information) |
|
601 | (see `hg help config.format.use-share-safe` for more information) | |
602 | [255] |
|
602 | [255] | |
603 |
|
603 | |||
604 | $ rm ../nss-share/.hg/wlock |
|
604 | $ rm ../nss-share/.hg/wlock | |
605 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort |
|
605 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config share.safe-mismatch.source-safe=upgrade-abort | |
606 | repository upgraded to use share-safe mode |
|
606 | repository upgraded to use share-safe mode | |
607 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
607 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar | |
608 | | |
|
608 | | | |
609 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
609 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo | |
610 |
|
610 | |||
611 |
|
611 | |||
612 | Test that unshare works |
|
612 | Test that unshare works | |
613 |
|
613 | |||
614 | $ hg unshare -R ../nss-share |
|
614 | $ hg unshare -R ../nss-share | |
615 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share |
|
615 | $ hg log -GT "{node}: {desc}\n" -R ../nss-share | |
616 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar |
|
616 | @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar | |
617 | | |
|
617 | | | |
618 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo |
|
618 | o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo | |
619 |
|
619 |
@@ -1,81 +1,81 b'' | |||||
1 | $ hg init repo |
|
1 | $ hg init repo | |
2 | $ cd repo |
|
2 | $ cd repo | |
3 |
|
3 | |||
4 | $ touch a.html b.html c.py d.py |
|
4 | $ touch a.html b.html c.py d.py | |
5 |
|
5 | |||
6 | $ cat > frontend.sparse << EOF |
|
6 | $ cat > frontend.sparse << EOF | |
7 | > [include] |
|
7 | > [include] | |
8 | > *.html |
|
8 | > *.html | |
9 | > EOF |
|
9 | > EOF | |
10 |
|
10 | |||
11 | $ hg -q commit -A -m initial |
|
11 | $ hg -q commit -A -m initial | |
12 |
|
12 | |||
13 | $ echo 1 > a.html |
|
13 | $ echo 1 > a.html | |
14 | $ echo 1 > c.py |
|
14 | $ echo 1 > c.py | |
15 | $ hg commit -m 'commit 1' |
|
15 | $ hg commit -m 'commit 1' | |
16 |
|
16 | |||
17 | Enable sparse profile |
|
17 | Enable sparse profile | |
18 |
|
18 | |||
19 | $ cat .hg/requires |
|
19 | $ cat .hg/requires | |
20 | dotencode |
|
20 | dotencode | |
21 |
|
|
21 | dirstate-v2 (dirstate-v2 !) | |
22 | fncache |
|
22 | fncache | |
23 | generaldelta |
|
23 | generaldelta | |
24 | persistent-nodemap (rust !) |
|
24 | persistent-nodemap (rust !) | |
25 | revlog-compression-zstd (zstd !) |
|
25 | revlog-compression-zstd (zstd !) | |
26 | revlogv1 |
|
26 | revlogv1 | |
27 | sparserevlog |
|
27 | sparserevlog | |
28 | store |
|
28 | store | |
29 | testonly-simplestore (reposimplestore !) |
|
29 | testonly-simplestore (reposimplestore !) | |
30 |
|
30 | |||
31 | $ hg debugsparse --config extensions.sparse= --enable-profile frontend.sparse |
|
31 | $ hg debugsparse --config extensions.sparse= --enable-profile frontend.sparse | |
32 | $ ls -A |
|
32 | $ ls -A | |
33 | .hg |
|
33 | .hg | |
34 | a.html |
|
34 | a.html | |
35 | b.html |
|
35 | b.html | |
36 |
|
36 | |||
37 | Requirement for sparse added when sparse is enabled |
|
37 | Requirement for sparse added when sparse is enabled | |
38 |
|
38 | |||
39 | $ cat .hg/requires |
|
39 | $ cat .hg/requires | |
40 | dotencode |
|
40 | dotencode | |
41 |
|
|
41 | dirstate-v2 (dirstate-v2 !) | |
42 | exp-sparse |
|
42 | exp-sparse | |
43 | fncache |
|
43 | fncache | |
44 | generaldelta |
|
44 | generaldelta | |
45 | persistent-nodemap (rust !) |
|
45 | persistent-nodemap (rust !) | |
46 | revlog-compression-zstd (zstd !) |
|
46 | revlog-compression-zstd (zstd !) | |
47 | revlogv1 |
|
47 | revlogv1 | |
48 | sparserevlog |
|
48 | sparserevlog | |
49 | store |
|
49 | store | |
50 | testonly-simplestore (reposimplestore !) |
|
50 | testonly-simplestore (reposimplestore !) | |
51 |
|
51 | |||
52 | Client without sparse enabled reacts properly |
|
52 | Client without sparse enabled reacts properly | |
53 |
|
53 | |||
54 | $ hg files |
|
54 | $ hg files | |
55 | abort: repository is using sparse feature but sparse is not enabled; enable the "sparse" extensions to access |
|
55 | abort: repository is using sparse feature but sparse is not enabled; enable the "sparse" extensions to access | |
56 | [255] |
|
56 | [255] | |
57 |
|
57 | |||
58 | Requirement for sparse is removed when sparse is disabled |
|
58 | Requirement for sparse is removed when sparse is disabled | |
59 |
|
59 | |||
60 | $ hg debugsparse --reset --config extensions.sparse= |
|
60 | $ hg debugsparse --reset --config extensions.sparse= | |
61 |
|
61 | |||
62 | $ cat .hg/requires |
|
62 | $ cat .hg/requires | |
63 | dotencode |
|
63 | dotencode | |
64 |
|
|
64 | dirstate-v2 (dirstate-v2 !) | |
65 | fncache |
|
65 | fncache | |
66 | generaldelta |
|
66 | generaldelta | |
67 | persistent-nodemap (rust !) |
|
67 | persistent-nodemap (rust !) | |
68 | revlog-compression-zstd (zstd !) |
|
68 | revlog-compression-zstd (zstd !) | |
69 | revlogv1 |
|
69 | revlogv1 | |
70 | sparserevlog |
|
70 | sparserevlog | |
71 | store |
|
71 | store | |
72 | testonly-simplestore (reposimplestore !) |
|
72 | testonly-simplestore (reposimplestore !) | |
73 |
|
73 | |||
74 | And client without sparse can access |
|
74 | And client without sparse can access | |
75 |
|
75 | |||
76 | $ hg files |
|
76 | $ hg files | |
77 | a.html |
|
77 | a.html | |
78 | b.html |
|
78 | b.html | |
79 | c.py |
|
79 | c.py | |
80 | d.py |
|
80 | d.py | |
81 | frontend.sparse |
|
81 | frontend.sparse |
@@ -1,131 +1,131 b'' | |||||
1 | #require sqlite no-chg |
|
1 | #require sqlite no-chg | |
2 |
|
2 | |||
3 | The sqlitestore backend leaves transactions around when used with chg. |
|
3 | The sqlitestore backend leaves transactions around when used with chg. | |
4 | Since this backend is primarily intended as proof-of-concept for |
|
4 | Since this backend is primarily intended as proof-of-concept for | |
5 | alternative storage backends, disable it for chg test runs to avoid |
|
5 | alternative storage backends, disable it for chg test runs to avoid | |
6 | the instability. |
|
6 | the instability. | |
7 |
|
7 | |||
8 | $ cat >> $HGRCPATH <<EOF |
|
8 | $ cat >> $HGRCPATH <<EOF | |
9 | > [extensions] |
|
9 | > [extensions] | |
10 | > sqlitestore = |
|
10 | > sqlitestore = | |
11 | > EOF |
|
11 | > EOF | |
12 |
|
12 | |||
13 | New repo should not use SQLite by default |
|
13 | New repo should not use SQLite by default | |
14 |
|
14 | |||
15 | $ hg init empty-no-sqlite |
|
15 | $ hg init empty-no-sqlite | |
16 | $ cat empty-no-sqlite/.hg/requires |
|
16 | $ cat empty-no-sqlite/.hg/requires | |
17 | dotencode |
|
17 | dotencode | |
18 |
|
|
18 | dirstate-v2 (dirstate-v2 !) | |
19 | fncache |
|
19 | fncache | |
20 | generaldelta |
|
20 | generaldelta | |
21 | persistent-nodemap (rust !) |
|
21 | persistent-nodemap (rust !) | |
22 | revlog-compression-zstd (zstd !) |
|
22 | revlog-compression-zstd (zstd !) | |
23 | revlogv1 |
|
23 | revlogv1 | |
24 | sparserevlog |
|
24 | sparserevlog | |
25 | store |
|
25 | store | |
26 |
|
26 | |||
27 | storage.new-repo-backend=sqlite is recognized |
|
27 | storage.new-repo-backend=sqlite is recognized | |
28 |
|
28 | |||
29 | $ hg --config storage.new-repo-backend=sqlite init empty-sqlite |
|
29 | $ hg --config storage.new-repo-backend=sqlite init empty-sqlite | |
30 | $ cat empty-sqlite/.hg/requires |
|
30 | $ cat empty-sqlite/.hg/requires | |
31 | dotencode |
|
31 | dotencode | |
32 |
|
|
32 | dirstate-v2 (dirstate-v2 !) | |
33 | exp-sqlite-001 |
|
33 | exp-sqlite-001 | |
34 | exp-sqlite-comp-001=zstd (zstd !) |
|
34 | exp-sqlite-comp-001=zstd (zstd !) | |
35 | exp-sqlite-comp-001=$BUNDLE2_COMPRESSIONS$ (no-zstd !) |
|
35 | exp-sqlite-comp-001=$BUNDLE2_COMPRESSIONS$ (no-zstd !) | |
36 | fncache |
|
36 | fncache | |
37 | generaldelta |
|
37 | generaldelta | |
38 | persistent-nodemap (rust !) |
|
38 | persistent-nodemap (rust !) | |
39 | revlog-compression-zstd (zstd !) |
|
39 | revlog-compression-zstd (zstd !) | |
40 | revlogv1 |
|
40 | revlogv1 | |
41 | sparserevlog |
|
41 | sparserevlog | |
42 | store |
|
42 | store | |
43 |
|
43 | |||
44 | $ cat >> $HGRCPATH << EOF |
|
44 | $ cat >> $HGRCPATH << EOF | |
45 | > [storage] |
|
45 | > [storage] | |
46 | > new-repo-backend = sqlite |
|
46 | > new-repo-backend = sqlite | |
47 | > EOF |
|
47 | > EOF | |
48 |
|
48 | |||
49 | Can force compression to zlib |
|
49 | Can force compression to zlib | |
50 |
|
50 | |||
51 | $ hg --config storage.sqlite.compression=zlib init empty-zlib |
|
51 | $ hg --config storage.sqlite.compression=zlib init empty-zlib | |
52 | $ cat empty-zlib/.hg/requires |
|
52 | $ cat empty-zlib/.hg/requires | |
53 | dotencode |
|
53 | dotencode | |
54 |
|
|
54 | dirstate-v2 (dirstate-v2 !) | |
55 | exp-sqlite-001 |
|
55 | exp-sqlite-001 | |
56 | exp-sqlite-comp-001=$BUNDLE2_COMPRESSIONS$ |
|
56 | exp-sqlite-comp-001=$BUNDLE2_COMPRESSIONS$ | |
57 | fncache |
|
57 | fncache | |
58 | generaldelta |
|
58 | generaldelta | |
59 | persistent-nodemap (rust !) |
|
59 | persistent-nodemap (rust !) | |
60 | revlog-compression-zstd (zstd !) |
|
60 | revlog-compression-zstd (zstd !) | |
61 | revlogv1 |
|
61 | revlogv1 | |
62 | sparserevlog |
|
62 | sparserevlog | |
63 | store |
|
63 | store | |
64 |
|
64 | |||
65 | Can force compression to none |
|
65 | Can force compression to none | |
66 |
|
66 | |||
67 | $ hg --config storage.sqlite.compression=none init empty-none |
|
67 | $ hg --config storage.sqlite.compression=none init empty-none | |
68 | $ cat empty-none/.hg/requires |
|
68 | $ cat empty-none/.hg/requires | |
69 | dotencode |
|
69 | dotencode | |
70 |
|
|
70 | dirstate-v2 (dirstate-v2 !) | |
71 | exp-sqlite-001 |
|
71 | exp-sqlite-001 | |
72 | exp-sqlite-comp-001=none |
|
72 | exp-sqlite-comp-001=none | |
73 | fncache |
|
73 | fncache | |
74 | generaldelta |
|
74 | generaldelta | |
75 | persistent-nodemap (rust !) |
|
75 | persistent-nodemap (rust !) | |
76 | revlog-compression-zstd (zstd !) |
|
76 | revlog-compression-zstd (zstd !) | |
77 | revlogv1 |
|
77 | revlogv1 | |
78 | sparserevlog |
|
78 | sparserevlog | |
79 | store |
|
79 | store | |
80 |
|
80 | |||
81 | Can make a local commit |
|
81 | Can make a local commit | |
82 |
|
82 | |||
83 | $ hg init local-commit |
|
83 | $ hg init local-commit | |
84 | $ cd local-commit |
|
84 | $ cd local-commit | |
85 | $ echo 0 > foo |
|
85 | $ echo 0 > foo | |
86 | $ hg commit -A -m initial |
|
86 | $ hg commit -A -m initial | |
87 | adding foo |
|
87 | adding foo | |
88 |
|
88 | |||
89 | That results in a row being inserted into various tables |
|
89 | That results in a row being inserted into various tables | |
90 |
|
90 | |||
91 | $ sqlite3 .hg/store/db.sqlite -init /dev/null << EOF |
|
91 | $ sqlite3 .hg/store/db.sqlite -init /dev/null << EOF | |
92 | > SELECT * FROM filepath; |
|
92 | > SELECT * FROM filepath; | |
93 | > EOF |
|
93 | > EOF | |
94 | 1|foo |
|
94 | 1|foo | |
95 |
|
95 | |||
96 | $ sqlite3 .hg/store/db.sqlite -init /dev/null << EOF |
|
96 | $ sqlite3 .hg/store/db.sqlite -init /dev/null << EOF | |
97 | > SELECT * FROM fileindex; |
|
97 | > SELECT * FROM fileindex; | |
98 | > EOF |
|
98 | > EOF | |
99 | 1|1|0|-1|-1|0|0|1||6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe (esc) |
|
99 | 1|1|0|-1|-1|0|0|1||6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe (esc) | |
100 |
|
100 | |||
101 | $ sqlite3 .hg/store/db.sqlite -init /dev/null << EOF |
|
101 | $ sqlite3 .hg/store/db.sqlite -init /dev/null << EOF | |
102 | > SELECT * FROM delta; |
|
102 | > SELECT * FROM delta; | |
103 | > EOF |
|
103 | > EOF | |
104 | 1|1| \xd2\xaf\x8d\xd2"\x01\xdd\x8dH\xe5\xdc\xfc\xae\xd2\x81\xff\x94"\xc7|0 (esc) |
|
104 | 1|1| \xd2\xaf\x8d\xd2"\x01\xdd\x8dH\xe5\xdc\xfc\xae\xd2\x81\xff\x94"\xc7|0 (esc) | |
105 |
|
105 | |||
106 |
|
106 | |||
107 | Tracking multiple files works |
|
107 | Tracking multiple files works | |
108 |
|
108 | |||
109 | $ echo 1 > bar |
|
109 | $ echo 1 > bar | |
110 | $ hg commit -A -m 'add bar' |
|
110 | $ hg commit -A -m 'add bar' | |
111 | adding bar |
|
111 | adding bar | |
112 |
|
112 | |||
113 | $ sqlite3 .hg/store/db.sqlite -init /dev/null << EOF |
|
113 | $ sqlite3 .hg/store/db.sqlite -init /dev/null << EOF | |
114 | > SELECT * FROM filedata ORDER BY id ASC; |
|
114 | > SELECT * FROM filedata ORDER BY id ASC; | |
115 | > EOF |
|
115 | > EOF | |
116 | 1|1|foo|0|6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe|-1|-1|0|0|1| (esc) |
|
116 | 1|1|foo|0|6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe|-1|-1|0|0|1| (esc) | |
117 | 2|2|bar|0|\xb8\xe0/d3s\x80!\xa0e\xf9Au\xc7\xcd#\xdb_\x05\xbe|-1|-1|1|0|2| (esc) |
|
117 | 2|2|bar|0|\xb8\xe0/d3s\x80!\xa0e\xf9Au\xc7\xcd#\xdb_\x05\xbe|-1|-1|1|0|2| (esc) | |
118 |
|
118 | |||
119 | Multiple revisions of a file works |
|
119 | Multiple revisions of a file works | |
120 |
|
120 | |||
121 | $ echo a >> foo |
|
121 | $ echo a >> foo | |
122 | $ hg commit -m 'modify foo' |
|
122 | $ hg commit -m 'modify foo' | |
123 |
|
123 | |||
124 | $ sqlite3 .hg/store/db.sqlite -init /dev/null << EOF |
|
124 | $ sqlite3 .hg/store/db.sqlite -init /dev/null << EOF | |
125 | > SELECT * FROM filedata ORDER BY id ASC; |
|
125 | > SELECT * FROM filedata ORDER BY id ASC; | |
126 | > EOF |
|
126 | > EOF | |
127 | 1|1|foo|0|6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe|-1|-1|0|0|1| (esc) |
|
127 | 1|1|foo|0|6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe|-1|-1|0|0|1| (esc) | |
128 | 2|2|bar|0|\xb8\xe0/d3s\x80!\xa0e\xf9Au\xc7\xcd#\xdb_\x05\xbe|-1|-1|1|0|2| (esc) |
|
128 | 2|2|bar|0|\xb8\xe0/d3s\x80!\xa0e\xf9Au\xc7\xcd#\xdb_\x05\xbe|-1|-1|1|0|2| (esc) | |
129 | 3|1|foo|1|\xdd\xb3V\xcd\xde1p@\xf7\x8e\x90\xb8*\x8b,\xe9\x0e\xd6j+|0|-1|2|0|3|1 (esc) |
|
129 | 3|1|foo|1|\xdd\xb3V\xcd\xde1p@\xf7\x8e\x90\xb8*\x8b,\xe9\x0e\xd6j+|0|-1|2|0|3|1 (esc) | |
130 |
|
130 | |||
131 | $ cd .. |
|
131 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now