##// END OF EJS Templates
py3: pass str into grp.getgrnam...
Pulkit Goyal -
r41645:587a3c97 default
parent child Browse files
Show More
@@ -1,752 +1,753 b''
1 test-abort-checkin.t
1 test-abort-checkin.t
2 test-absorb-edit-lines.t
2 test-absorb-edit-lines.t
3 test-absorb-filefixupstate.py
3 test-absorb-filefixupstate.py
4 test-absorb-phase.t
4 test-absorb-phase.t
5 test-absorb-rename.t
5 test-absorb-rename.t
6 test-absorb-strip.t
6 test-absorb-strip.t
7 test-absorb.t
7 test-absorb.t
8 test-acl.t
8 test-add.t
9 test-add.t
9 test-addremove-similar.t
10 test-addremove-similar.t
10 test-addremove.t
11 test-addremove.t
11 test-alias.t
12 test-alias.t
12 test-amend-subrepo.t
13 test-amend-subrepo.t
13 test-amend.t
14 test-amend.t
14 test-ancestor.py
15 test-ancestor.py
15 test-annotate.py
16 test-annotate.py
16 test-annotate.t
17 test-annotate.t
17 test-arbitraryfilectx.t
18 test-arbitraryfilectx.t
18 test-archive-symlinks.t
19 test-archive-symlinks.t
19 test-archive.t
20 test-archive.t
20 test-atomictempfile.py
21 test-atomictempfile.py
21 test-audit-path.t
22 test-audit-path.t
22 test-audit-subrepo.t
23 test-audit-subrepo.t
23 test-automv.t
24 test-automv.t
24 test-backout.t
25 test-backout.t
25 test-backwards-remove.t
26 test-backwards-remove.t
26 test-bad-extension.t
27 test-bad-extension.t
27 test-bad-pull.t
28 test-bad-pull.t
28 test-basic.t
29 test-basic.t
29 test-batching.py
30 test-batching.py
30 test-bdiff.py
31 test-bdiff.py
31 test-bheads.t
32 test-bheads.t
32 test-bisect.t
33 test-bisect.t
33 test-bisect2.t
34 test-bisect2.t
34 test-bisect3.t
35 test-bisect3.t
35 test-blackbox.t
36 test-blackbox.t
36 test-bookflow.t
37 test-bookflow.t
37 test-bookmarks-current.t
38 test-bookmarks-current.t
38 test-bookmarks-merge.t
39 test-bookmarks-merge.t
39 test-bookmarks-pushpull.t
40 test-bookmarks-pushpull.t
40 test-bookmarks-rebase.t
41 test-bookmarks-rebase.t
41 test-bookmarks-strip.t
42 test-bookmarks-strip.t
42 test-bookmarks.t
43 test-bookmarks.t
43 test-branch-change.t
44 test-branch-change.t
44 test-branch-option.t
45 test-branch-option.t
45 test-branch-tag-confict.t
46 test-branch-tag-confict.t
46 test-branches.t
47 test-branches.t
47 test-bugzilla.t
48 test-bugzilla.t
48 test-bundle-phases.t
49 test-bundle-phases.t
49 test-bundle-r.t
50 test-bundle-r.t
50 test-bundle-type.t
51 test-bundle-type.t
51 test-bundle-vs-outgoing.t
52 test-bundle-vs-outgoing.t
52 test-bundle.t
53 test-bundle.t
53 test-bundle2-exchange.t
54 test-bundle2-exchange.t
54 test-bundle2-format.t
55 test-bundle2-format.t
55 test-bundle2-multiple-changegroups.t
56 test-bundle2-multiple-changegroups.t
56 test-bundle2-pushback.t
57 test-bundle2-pushback.t
57 test-bundle2-remote-changegroup.t
58 test-bundle2-remote-changegroup.t
58 test-cache-abuse.t
59 test-cache-abuse.t
59 test-cappedreader.py
60 test-cappedreader.py
60 test-casecollision-merge.t
61 test-casecollision-merge.t
61 test-casecollision.t
62 test-casecollision.t
62 test-casefolding.t
63 test-casefolding.t
63 test-cat.t
64 test-cat.t
64 test-cbor.py
65 test-cbor.py
65 test-censor.t
66 test-censor.t
66 test-changelog-exec.t
67 test-changelog-exec.t
67 test-check-code.t
68 test-check-code.t
68 test-check-commit.t
69 test-check-commit.t
69 test-check-config.py
70 test-check-config.py
70 test-check-config.t
71 test-check-config.t
71 test-check-execute.t
72 test-check-execute.t
72 test-check-help.t
73 test-check-help.t
73 test-check-interfaces.py
74 test-check-interfaces.py
74 test-check-module-imports.t
75 test-check-module-imports.t
75 test-check-py3-compat.t
76 test-check-py3-compat.t
76 test-check-pyflakes.t
77 test-check-pyflakes.t
77 test-check-pylint.t
78 test-check-pylint.t
78 test-check-shbang.t
79 test-check-shbang.t
79 test-children.t
80 test-children.t
80 test-churn.t
81 test-churn.t
81 test-clone-cgi.t
82 test-clone-cgi.t
82 test-clone-pull-corruption.t
83 test-clone-pull-corruption.t
83 test-clone-r.t
84 test-clone-r.t
84 test-clone-uncompressed.t
85 test-clone-uncompressed.t
85 test-clone-update-order.t
86 test-clone-update-order.t
86 test-clone.t
87 test-clone.t
87 test-clonebundles.t
88 test-clonebundles.t
88 test-close-head.t
89 test-close-head.t
89 test-commandserver.t
90 test-commandserver.t
90 test-commit-amend.t
91 test-commit-amend.t
91 test-commit-interactive.t
92 test-commit-interactive.t
92 test-commit-multiple.t
93 test-commit-multiple.t
93 test-commit-unresolved.t
94 test-commit-unresolved.t
94 test-commit.t
95 test-commit.t
95 test-committer.t
96 test-committer.t
96 test-completion.t
97 test-completion.t
97 test-config-env.py
98 test-config-env.py
98 test-config.t
99 test-config.t
99 test-conflict.t
100 test-conflict.t
100 test-confused-revert.t
101 test-confused-revert.t
101 test-context-metadata.t
102 test-context-metadata.t
102 test-context.py
103 test-context.py
103 test-contrib-check-code.t
104 test-contrib-check-code.t
104 test-contrib-check-commit.t
105 test-contrib-check-commit.t
105 test-contrib-dumprevlog.t
106 test-contrib-dumprevlog.t
106 test-contrib-perf.t
107 test-contrib-perf.t
107 test-contrib-relnotes.t
108 test-contrib-relnotes.t
108 test-contrib-testparseutil.t
109 test-contrib-testparseutil.t
109 test-contrib.t
110 test-contrib.t
110 test-convert-authormap.t
111 test-convert-authormap.t
111 test-convert-clonebranches.t
112 test-convert-clonebranches.t
112 test-convert-cvs-branch.t
113 test-convert-cvs-branch.t
113 test-convert-cvs-detectmerge.t
114 test-convert-cvs-detectmerge.t
114 test-convert-cvs-synthetic.t
115 test-convert-cvs-synthetic.t
115 test-convert-cvs.t
116 test-convert-cvs.t
116 test-convert-cvsnt-mergepoints.t
117 test-convert-cvsnt-mergepoints.t
117 test-convert-datesort.t
118 test-convert-datesort.t
118 test-convert-filemap.t
119 test-convert-filemap.t
119 test-convert-git.t
120 test-convert-git.t
120 test-convert-hg-sink.t
121 test-convert-hg-sink.t
121 test-convert-hg-source.t
122 test-convert-hg-source.t
122 test-convert-hg-startrev.t
123 test-convert-hg-startrev.t
123 test-convert-splicemap.t
124 test-convert-splicemap.t
124 test-convert-svn-sink.t
125 test-convert-svn-sink.t
125 test-convert-tagsbranch-topology.t
126 test-convert-tagsbranch-topology.t
126 test-convert.t
127 test-convert.t
127 test-copy-move-merge.t
128 test-copy-move-merge.t
128 test-copy.t
129 test-copy.t
129 test-copytrace-heuristics.t
130 test-copytrace-heuristics.t
130 test-custom-filters.t
131 test-custom-filters.t
131 test-debugbuilddag.t
132 test-debugbuilddag.t
132 test-debugbundle.t
133 test-debugbundle.t
133 test-debugcommands.t
134 test-debugcommands.t
134 test-debugextensions.t
135 test-debugextensions.t
135 test-debugindexdot.t
136 test-debugindexdot.t
136 test-debugrename.t
137 test-debugrename.t
137 test-default-push.t
138 test-default-push.t
138 test-diff-antipatience.t
139 test-diff-antipatience.t
139 test-diff-binary-file.t
140 test-diff-binary-file.t
140 test-diff-change.t
141 test-diff-change.t
141 test-diff-color.t
142 test-diff-color.t
142 test-diff-copy-depth.t
143 test-diff-copy-depth.t
143 test-diff-hashes.t
144 test-diff-hashes.t
144 test-diff-ignore-whitespace.t
145 test-diff-ignore-whitespace.t
145 test-diff-indent-heuristic.t
146 test-diff-indent-heuristic.t
146 test-diff-issue2761.t
147 test-diff-issue2761.t
147 test-diff-newlines.t
148 test-diff-newlines.t
148 test-diff-reverse.t
149 test-diff-reverse.t
149 test-diff-subdir.t
150 test-diff-subdir.t
150 test-diff-unified.t
151 test-diff-unified.t
151 test-diff-upgrade.t
152 test-diff-upgrade.t
152 test-diffdir.t
153 test-diffdir.t
153 test-diffstat.t
154 test-diffstat.t
154 test-directaccess.t
155 test-directaccess.t
155 test-dirstate-backup.t
156 test-dirstate-backup.t
156 test-dirstate-nonnormalset.t
157 test-dirstate-nonnormalset.t
157 test-dirstate-race.t
158 test-dirstate-race.t
158 test-dirstate.t
159 test-dirstate.t
159 test-dispatch.py
160 test-dispatch.py
160 test-dispatch.t
161 test-dispatch.t
161 test-doctest.py
162 test-doctest.py
162 test-double-merge.t
163 test-double-merge.t
163 test-drawdag.t
164 test-drawdag.t
164 test-duplicateoptions.py
165 test-duplicateoptions.py
165 test-editor-filename.t
166 test-editor-filename.t
166 test-empty-dir.t
167 test-empty-dir.t
167 test-empty-file.t
168 test-empty-file.t
168 test-empty-group.t
169 test-empty-group.t
169 test-empty.t
170 test-empty.t
170 test-encode.t
171 test-encode.t
171 test-encoding-align.t
172 test-encoding-align.t
172 test-encoding-func.py
173 test-encoding-func.py
173 test-encoding-textwrap.t
174 test-encoding-textwrap.t
174 test-encoding.t
175 test-encoding.t
175 test-eol-add.t
176 test-eol-add.t
176 test-eol-clone.t
177 test-eol-clone.t
177 test-eol-hook.t
178 test-eol-hook.t
178 test-eol-patch.t
179 test-eol-patch.t
179 test-eol-tag.t
180 test-eol-tag.t
180 test-eol-update.t
181 test-eol-update.t
181 test-eol.t
182 test-eol.t
182 test-eolfilename.t
183 test-eolfilename.t
183 test-excessive-merge.t
184 test-excessive-merge.t
184 test-exchange-obsmarkers-case-A1.t
185 test-exchange-obsmarkers-case-A1.t
185 test-exchange-obsmarkers-case-A2.t
186 test-exchange-obsmarkers-case-A2.t
186 test-exchange-obsmarkers-case-A3.t
187 test-exchange-obsmarkers-case-A3.t
187 test-exchange-obsmarkers-case-A4.t
188 test-exchange-obsmarkers-case-A4.t
188 test-exchange-obsmarkers-case-A5.t
189 test-exchange-obsmarkers-case-A5.t
189 test-exchange-obsmarkers-case-A6.t
190 test-exchange-obsmarkers-case-A6.t
190 test-exchange-obsmarkers-case-A7.t
191 test-exchange-obsmarkers-case-A7.t
191 test-exchange-obsmarkers-case-B1.t
192 test-exchange-obsmarkers-case-B1.t
192 test-exchange-obsmarkers-case-B2.t
193 test-exchange-obsmarkers-case-B2.t
193 test-exchange-obsmarkers-case-B3.t
194 test-exchange-obsmarkers-case-B3.t
194 test-exchange-obsmarkers-case-B4.t
195 test-exchange-obsmarkers-case-B4.t
195 test-exchange-obsmarkers-case-B5.t
196 test-exchange-obsmarkers-case-B5.t
196 test-exchange-obsmarkers-case-B6.t
197 test-exchange-obsmarkers-case-B6.t
197 test-exchange-obsmarkers-case-B7.t
198 test-exchange-obsmarkers-case-B7.t
198 test-exchange-obsmarkers-case-C1.t
199 test-exchange-obsmarkers-case-C1.t
199 test-exchange-obsmarkers-case-C2.t
200 test-exchange-obsmarkers-case-C2.t
200 test-exchange-obsmarkers-case-C3.t
201 test-exchange-obsmarkers-case-C3.t
201 test-exchange-obsmarkers-case-C4.t
202 test-exchange-obsmarkers-case-C4.t
202 test-exchange-obsmarkers-case-D1.t
203 test-exchange-obsmarkers-case-D1.t
203 test-exchange-obsmarkers-case-D2.t
204 test-exchange-obsmarkers-case-D2.t
204 test-exchange-obsmarkers-case-D3.t
205 test-exchange-obsmarkers-case-D3.t
205 test-exchange-obsmarkers-case-D4.t
206 test-exchange-obsmarkers-case-D4.t
206 test-execute-bit.t
207 test-execute-bit.t
207 test-export.t
208 test-export.t
208 test-extdata.t
209 test-extdata.t
209 test-extdiff.t
210 test-extdiff.t
210 test-extension-timing.t
211 test-extension-timing.t
211 test-extensions-afterloaded.t
212 test-extensions-afterloaded.t
212 test-extensions-wrapfunction.py
213 test-extensions-wrapfunction.py
213 test-extra-filelog-entry.t
214 test-extra-filelog-entry.t
214 test-fastannotate-corrupt.t
215 test-fastannotate-corrupt.t
215 test-fastannotate-diffopts.t
216 test-fastannotate-diffopts.t
216 test-fastannotate-hg.t
217 test-fastannotate-hg.t
217 test-fastannotate-perfhack.t
218 test-fastannotate-perfhack.t
218 test-fastannotate-protocol.t
219 test-fastannotate-protocol.t
219 test-fastannotate-renames.t
220 test-fastannotate-renames.t
220 test-fastannotate-revmap.py
221 test-fastannotate-revmap.py
221 test-fastannotate.t
222 test-fastannotate.t
222 test-fetch.t
223 test-fetch.t
223 test-filebranch.t
224 test-filebranch.t
224 test-filecache.py
225 test-filecache.py
225 test-filelog.py
226 test-filelog.py
226 test-fileset-generated.t
227 test-fileset-generated.t
227 test-fileset.t
228 test-fileset.t
228 test-fix-topology.t
229 test-fix-topology.t
229 test-fix.t
230 test-fix.t
230 test-flags.t
231 test-flags.t
231 test-fncache.t
232 test-fncache.t
232 test-gendoc-da.t
233 test-gendoc-da.t
233 test-gendoc-de.t
234 test-gendoc-de.t
234 test-gendoc-el.t
235 test-gendoc-el.t
235 test-gendoc-fr.t
236 test-gendoc-fr.t
236 test-gendoc-it.t
237 test-gendoc-it.t
237 test-gendoc-ja.t
238 test-gendoc-ja.t
238 test-gendoc-pt_BR.t
239 test-gendoc-pt_BR.t
239 test-gendoc-ro.t
240 test-gendoc-ro.t
240 test-gendoc-ru.t
241 test-gendoc-ru.t
241 test-gendoc-sv.t
242 test-gendoc-sv.t
242 test-gendoc-zh_CN.t
243 test-gendoc-zh_CN.t
243 test-gendoc-zh_TW.t
244 test-gendoc-zh_TW.t
244 test-gendoc.t
245 test-gendoc.t
245 test-generaldelta.t
246 test-generaldelta.t
246 test-getbundle.t
247 test-getbundle.t
247 test-git-export.t
248 test-git-export.t
248 test-githelp.t
249 test-githelp.t
249 test-globalopts.t
250 test-globalopts.t
250 test-glog-beautifygraph.t
251 test-glog-beautifygraph.t
251 test-glog-topological.t
252 test-glog-topological.t
252 test-glog.t
253 test-glog.t
253 test-gpg.t
254 test-gpg.t
254 test-graft.t
255 test-graft.t
255 test-grep.t
256 test-grep.t
256 test-hardlinks.t
257 test-hardlinks.t
257 test-help-hide.t
258 test-help-hide.t
258 test-help.t
259 test-help.t
259 test-hg-parseurl.py
260 test-hg-parseurl.py
260 test-hghave.t
261 test-hghave.t
261 test-hgignore.t
262 test-hgignore.t
262 test-hgk.t
263 test-hgk.t
263 test-hgrc.t
264 test-hgrc.t
264 test-hgweb-annotate-whitespace.t
265 test-hgweb-annotate-whitespace.t
265 test-hgweb-auth.py
266 test-hgweb-auth.py
266 test-hgweb-bundle.t
267 test-hgweb-bundle.t
267 test-hgweb-commands.t
268 test-hgweb-commands.t
268 test-hgweb-csp.t
269 test-hgweb-csp.t
269 test-hgweb-descend-empties.t
270 test-hgweb-descend-empties.t
270 test-hgweb-diffs.t
271 test-hgweb-diffs.t
271 test-hgweb-empty.t
272 test-hgweb-empty.t
272 test-hgweb-filelog.t
273 test-hgweb-filelog.t
273 test-hgweb-no-path-info.t
274 test-hgweb-no-path-info.t
274 test-hgweb-no-request-uri.t
275 test-hgweb-no-request-uri.t
275 test-hgweb-non-interactive.t
276 test-hgweb-non-interactive.t
276 test-hgweb-raw.t
277 test-hgweb-raw.t
277 test-hgweb-removed.t
278 test-hgweb-removed.t
278 test-hgweb-symrev.t
279 test-hgweb-symrev.t
279 test-hgweb.t
280 test-hgweb.t
280 test-hgwebdir-paths.py
281 test-hgwebdir-paths.py
281 test-hgwebdir.t
282 test-hgwebdir.t
282 test-hgwebdirsym.t
283 test-hgwebdirsym.t
283 test-histedit-arguments.t
284 test-histedit-arguments.t
284 test-histedit-base.t
285 test-histedit-base.t
285 test-histedit-bookmark-motion.t
286 test-histedit-bookmark-motion.t
286 test-histedit-commute.t
287 test-histedit-commute.t
287 test-histedit-drop.t
288 test-histedit-drop.t
288 test-histedit-edit.t
289 test-histedit-edit.t
289 test-histedit-fold-non-commute.t
290 test-histedit-fold-non-commute.t
290 test-histedit-fold.t
291 test-histedit-fold.t
291 test-histedit-no-backup.t
292 test-histedit-no-backup.t
292 test-histedit-no-change.t
293 test-histedit-no-change.t
293 test-histedit-non-commute-abort.t
294 test-histedit-non-commute-abort.t
294 test-histedit-non-commute.t
295 test-histedit-non-commute.t
295 test-histedit-obsolete.t
296 test-histedit-obsolete.t
296 test-histedit-outgoing.t
297 test-histedit-outgoing.t
297 test-histedit-templates.t
298 test-histedit-templates.t
298 test-http-api-httpv2.t
299 test-http-api-httpv2.t
299 test-http-api.t
300 test-http-api.t
300 test-http-bad-server.t
301 test-http-bad-server.t
301 test-http-branchmap.t
302 test-http-branchmap.t
302 test-http-bundle1.t
303 test-http-bundle1.t
303 test-http-clone-r.t
304 test-http-clone-r.t
304 test-http-permissions.t
305 test-http-permissions.t
305 test-http-protocol.t
306 test-http-protocol.t
306 test-http.t
307 test-http.t
307 test-hybridencode.py
308 test-hybridencode.py
308 test-i18n.t
309 test-i18n.t
309 test-identify.t
310 test-identify.t
310 test-impexp-branch.t
311 test-impexp-branch.t
311 test-import-bypass.t
312 test-import-bypass.t
312 test-import-context.t
313 test-import-context.t
313 test-import-eol.t
314 test-import-eol.t
314 test-import-git.t
315 test-import-git.t
315 test-import-merge.t
316 test-import-merge.t
316 test-import-unknown.t
317 test-import-unknown.t
317 test-import.t
318 test-import.t
318 test-imports-checker.t
319 test-imports-checker.t
319 test-incoming-outgoing.t
320 test-incoming-outgoing.t
320 test-infinitepush-bundlestore.t
321 test-infinitepush-bundlestore.t
321 test-infinitepush-ci.t
322 test-infinitepush-ci.t
322 test-infinitepush.t
323 test-infinitepush.t
323 test-inherit-mode.t
324 test-inherit-mode.t
324 test-init.t
325 test-init.t
325 test-install.t
326 test-install.t
326 test-issue1089.t
327 test-issue1089.t
327 test-issue1102.t
328 test-issue1102.t
328 test-issue1175.t
329 test-issue1175.t
329 test-issue1306.t
330 test-issue1306.t
330 test-issue1438.t
331 test-issue1438.t
331 test-issue1502.t
332 test-issue1502.t
332 test-issue1802.t
333 test-issue1802.t
333 test-issue1877.t
334 test-issue1877.t
334 test-issue1993.t
335 test-issue1993.t
335 test-issue2137.t
336 test-issue2137.t
336 test-issue3084.t
337 test-issue3084.t
337 test-issue4074.t
338 test-issue4074.t
338 test-issue522.t
339 test-issue522.t
339 test-issue586.t
340 test-issue586.t
340 test-issue5979.t
341 test-issue5979.t
341 test-issue612.t
342 test-issue612.t
342 test-issue619.t
343 test-issue619.t
343 test-issue660.t
344 test-issue660.t
344 test-issue672.t
345 test-issue672.t
345 test-issue842.t
346 test-issue842.t
346 test-journal-exists.t
347 test-journal-exists.t
347 test-journal-share.t
348 test-journal-share.t
348 test-journal.t
349 test-journal.t
349 test-keyword.t
350 test-keyword.t
350 test-known.t
351 test-known.t
351 test-largefiles-cache.t
352 test-largefiles-cache.t
352 test-largefiles-misc.t
353 test-largefiles-misc.t
353 test-largefiles-small-disk.t
354 test-largefiles-small-disk.t
354 test-largefiles-update.t
355 test-largefiles-update.t
355 test-largefiles-wireproto.t
356 test-largefiles-wireproto.t
356 test-largefiles.t
357 test-largefiles.t
357 test-lfconvert.t
358 test-lfconvert.t
358 test-lfs-bundle.t
359 test-lfs-bundle.t
359 test-lfs-largefiles.t
360 test-lfs-largefiles.t
360 test-lfs-pointer.py
361 test-lfs-pointer.py
361 test-lfs-test-server.t
362 test-lfs-test-server.t
362 test-lfs.t
363 test-lfs.t
363 test-linelog.py
364 test-linelog.py
364 test-linerange.py
365 test-linerange.py
365 test-locate.t
366 test-locate.t
366 test-lock-badness.t
367 test-lock-badness.t
367 test-lock.py
368 test-lock.py
368 test-log-exthook.t
369 test-log-exthook.t
369 test-log-linerange.t
370 test-log-linerange.t
370 test-log.t
371 test-log.t
371 test-logexchange.t
372 test-logexchange.t
372 test-logtoprocess.t
373 test-logtoprocess.t
373 test-lrucachedict.py
374 test-lrucachedict.py
374 test-mactext.t
375 test-mactext.t
375 test-mailmap.t
376 test-mailmap.t
376 test-manifest-merging.t
377 test-manifest-merging.t
377 test-manifest.py
378 test-manifest.py
378 test-manifest.t
379 test-manifest.t
379 test-match.py
380 test-match.py
380 test-mdiff.py
381 test-mdiff.py
381 test-merge-changedelete.t
382 test-merge-changedelete.t
382 test-merge-closedheads.t
383 test-merge-closedheads.t
383 test-merge-commit.t
384 test-merge-commit.t
384 test-merge-criss-cross.t
385 test-merge-criss-cross.t
385 test-merge-default.t
386 test-merge-default.t
386 test-merge-force.t
387 test-merge-force.t
387 test-merge-halt.t
388 test-merge-halt.t
388 test-merge-internal-tools-pattern.t
389 test-merge-internal-tools-pattern.t
389 test-merge-local.t
390 test-merge-local.t
390 test-merge-no-file-change.t
391 test-merge-no-file-change.t
391 test-merge-remove.t
392 test-merge-remove.t
392 test-merge-revert.t
393 test-merge-revert.t
393 test-merge-revert2.t
394 test-merge-revert2.t
394 test-merge-subrepos.t
395 test-merge-subrepos.t
395 test-merge-symlinks.t
396 test-merge-symlinks.t
396 test-merge-tools.t
397 test-merge-tools.t
397 test-merge-types.t
398 test-merge-types.t
398 test-merge1.t
399 test-merge1.t
399 test-merge10.t
400 test-merge10.t
400 test-merge2.t
401 test-merge2.t
401 test-merge4.t
402 test-merge4.t
402 test-merge5.t
403 test-merge5.t
403 test-merge6.t
404 test-merge6.t
404 test-merge7.t
405 test-merge7.t
405 test-merge8.t
406 test-merge8.t
406 test-merge9.t
407 test-merge9.t
407 test-minifileset.py
408 test-minifileset.py
408 test-minirst.py
409 test-minirst.py
409 test-missing-capability.t
410 test-missing-capability.t
410 test-mq-eol.t
411 test-mq-eol.t
411 test-mq-git.t
412 test-mq-git.t
412 test-mq-guards.t
413 test-mq-guards.t
413 test-mq-header-date.t
414 test-mq-header-date.t
414 test-mq-header-from.t
415 test-mq-header-from.t
415 test-mq-merge.t
416 test-mq-merge.t
416 test-mq-missingfiles.t
417 test-mq-missingfiles.t
417 test-mq-pull-from-bundle.t
418 test-mq-pull-from-bundle.t
418 test-mq-qclone-http.t
419 test-mq-qclone-http.t
419 test-mq-qdelete.t
420 test-mq-qdelete.t
420 test-mq-qdiff.t
421 test-mq-qdiff.t
421 test-mq-qfold.t
422 test-mq-qfold.t
422 test-mq-qgoto.t
423 test-mq-qgoto.t
423 test-mq-qimport-fail-cleanup.t
424 test-mq-qimport-fail-cleanup.t
424 test-mq-qimport.t
425 test-mq-qimport.t
425 test-mq-qnew.t
426 test-mq-qnew.t
426 test-mq-qpush-exact.t
427 test-mq-qpush-exact.t
427 test-mq-qpush-fail.t
428 test-mq-qpush-fail.t
428 test-mq-qqueue.t
429 test-mq-qqueue.t
429 test-mq-qrefresh-interactive.t
430 test-mq-qrefresh-interactive.t
430 test-mq-qrefresh-replace-log-message.t
431 test-mq-qrefresh-replace-log-message.t
431 test-mq-qrefresh.t
432 test-mq-qrefresh.t
432 test-mq-qrename.t
433 test-mq-qrename.t
433 test-mq-qsave.t
434 test-mq-qsave.t
434 test-mq-safety.t
435 test-mq-safety.t
435 test-mq-subrepo.t
436 test-mq-subrepo.t
436 test-mq-symlinks.t
437 test-mq-symlinks.t
437 test-mq.t
438 test-mq.t
438 test-mv-cp-st-diff.t
439 test-mv-cp-st-diff.t
439 test-narrow-acl.t
440 test-narrow-acl.t
440 test-narrow-archive.t
441 test-narrow-archive.t
441 test-narrow-clone-no-ellipsis.t
442 test-narrow-clone-no-ellipsis.t
442 test-narrow-clone-non-narrow-server.t
443 test-narrow-clone-non-narrow-server.t
443 test-narrow-clone-nonlinear.t
444 test-narrow-clone-nonlinear.t
444 test-narrow-clone-stream.t
445 test-narrow-clone-stream.t
445 test-narrow-clone.t
446 test-narrow-clone.t
446 test-narrow-commit.t
447 test-narrow-commit.t
447 test-narrow-copies.t
448 test-narrow-copies.t
448 test-narrow-debugcommands.t
449 test-narrow-debugcommands.t
449 test-narrow-debugrebuilddirstate.t
450 test-narrow-debugrebuilddirstate.t
450 test-narrow-exchange-merges.t
451 test-narrow-exchange-merges.t
451 test-narrow-exchange.t
452 test-narrow-exchange.t
452 test-narrow-expanddirstate.t
453 test-narrow-expanddirstate.t
453 test-narrow-merge.t
454 test-narrow-merge.t
454 test-narrow-patch.t
455 test-narrow-patch.t
455 test-narrow-patterns.t
456 test-narrow-patterns.t
456 test-narrow-pull.t
457 test-narrow-pull.t
457 test-narrow-rebase.t
458 test-narrow-rebase.t
458 test-narrow-shallow-merges.t
459 test-narrow-shallow-merges.t
459 test-narrow-shallow.t
460 test-narrow-shallow.t
460 test-narrow-share.t
461 test-narrow-share.t
461 test-narrow-sparse.t
462 test-narrow-sparse.t
462 test-narrow-strip.t
463 test-narrow-strip.t
463 test-narrow-trackedcmd.t
464 test-narrow-trackedcmd.t
464 test-narrow-update.t
465 test-narrow-update.t
465 test-narrow-widen-no-ellipsis.t
466 test-narrow-widen-no-ellipsis.t
466 test-narrow-widen.t
467 test-narrow-widen.t
467 test-narrow.t
468 test-narrow.t
468 test-nested-repo.t
469 test-nested-repo.t
469 test-newbranch.t
470 test-newbranch.t
470 test-newcgi.t
471 test-newcgi.t
471 test-newercgi.t
472 test-newercgi.t
472 test-nointerrupt.t
473 test-nointerrupt.t
473 test-notify-changegroup.t
474 test-notify-changegroup.t
474 test-obshistory.t
475 test-obshistory.t
475 test-obsmarker-template.t
476 test-obsmarker-template.t
476 test-obsmarkers-effectflag.t
477 test-obsmarkers-effectflag.t
477 test-obsolete-bounds-checking.t
478 test-obsolete-bounds-checking.t
478 test-obsolete-bundle-strip.t
479 test-obsolete-bundle-strip.t
479 test-obsolete-changeset-exchange.t
480 test-obsolete-changeset-exchange.t
480 test-obsolete-checkheads.t
481 test-obsolete-checkheads.t
481 test-obsolete-distributed.t
482 test-obsolete-distributed.t
482 test-obsolete-divergent.t
483 test-obsolete-divergent.t
483 test-obsolete-tag-cache.t
484 test-obsolete-tag-cache.t
484 test-obsolete.t
485 test-obsolete.t
485 test-oldcgi.t
486 test-oldcgi.t
486 test-origbackup-conflict.t
487 test-origbackup-conflict.t
487 test-pager-legacy.t
488 test-pager-legacy.t
488 test-pager.t
489 test-pager.t
489 test-parents.t
490 test-parents.t
490 test-parse-date.t
491 test-parse-date.t
491 test-parseindex.t
492 test-parseindex.t
492 test-parseindex2.py
493 test-parseindex2.py
493 test-patch-offset.t
494 test-patch-offset.t
494 test-patch.t
495 test-patch.t
495 test-patchbomb-bookmark.t
496 test-patchbomb-bookmark.t
496 test-patchbomb-tls.t
497 test-patchbomb-tls.t
497 test-patchbomb.t
498 test-patchbomb.t
498 test-pathconflicts-basic.t
499 test-pathconflicts-basic.t
499 test-pathconflicts-merge.t
500 test-pathconflicts-merge.t
500 test-pathconflicts-update.t
501 test-pathconflicts-update.t
501 test-pathencode.py
502 test-pathencode.py
502 test-pending.t
503 test-pending.t
503 test-permissions.t
504 test-permissions.t
504 test-phases-exchange.t
505 test-phases-exchange.t
505 test-phases.t
506 test-phases.t
506 test-profile.t
507 test-profile.t
507 test-progress.t
508 test-progress.t
508 test-propertycache.py
509 test-propertycache.py
509 test-pull-branch.t
510 test-pull-branch.t
510 test-pull-bundle.t
511 test-pull-bundle.t
511 test-pull-http.t
512 test-pull-http.t
512 test-pull-permission.t
513 test-pull-permission.t
513 test-pull-pull-corruption.t
514 test-pull-pull-corruption.t
514 test-pull-r.t
515 test-pull-r.t
515 test-pull-update.t
516 test-pull-update.t
516 test-pull.t
517 test-pull.t
517 test-purge.t
518 test-purge.t
518 test-push-cgi.t
519 test-push-cgi.t
519 test-push-checkheads-partial-C1.t
520 test-push-checkheads-partial-C1.t
520 test-push-checkheads-partial-C2.t
521 test-push-checkheads-partial-C2.t
521 test-push-checkheads-partial-C3.t
522 test-push-checkheads-partial-C3.t
522 test-push-checkheads-partial-C4.t
523 test-push-checkheads-partial-C4.t
523 test-push-checkheads-pruned-B1.t
524 test-push-checkheads-pruned-B1.t
524 test-push-checkheads-pruned-B2.t
525 test-push-checkheads-pruned-B2.t
525 test-push-checkheads-pruned-B3.t
526 test-push-checkheads-pruned-B3.t
526 test-push-checkheads-pruned-B4.t
527 test-push-checkheads-pruned-B4.t
527 test-push-checkheads-pruned-B5.t
528 test-push-checkheads-pruned-B5.t
528 test-push-checkheads-pruned-B6.t
529 test-push-checkheads-pruned-B6.t
529 test-push-checkheads-pruned-B7.t
530 test-push-checkheads-pruned-B7.t
530 test-push-checkheads-pruned-B8.t
531 test-push-checkheads-pruned-B8.t
531 test-push-checkheads-superceed-A1.t
532 test-push-checkheads-superceed-A1.t
532 test-push-checkheads-superceed-A2.t
533 test-push-checkheads-superceed-A2.t
533 test-push-checkheads-superceed-A3.t
534 test-push-checkheads-superceed-A3.t
534 test-push-checkheads-superceed-A4.t
535 test-push-checkheads-superceed-A4.t
535 test-push-checkheads-superceed-A5.t
536 test-push-checkheads-superceed-A5.t
536 test-push-checkheads-superceed-A6.t
537 test-push-checkheads-superceed-A6.t
537 test-push-checkheads-superceed-A7.t
538 test-push-checkheads-superceed-A7.t
538 test-push-checkheads-superceed-A8.t
539 test-push-checkheads-superceed-A8.t
539 test-push-checkheads-unpushed-D1.t
540 test-push-checkheads-unpushed-D1.t
540 test-push-checkheads-unpushed-D2.t
541 test-push-checkheads-unpushed-D2.t
541 test-push-checkheads-unpushed-D3.t
542 test-push-checkheads-unpushed-D3.t
542 test-push-checkheads-unpushed-D4.t
543 test-push-checkheads-unpushed-D4.t
543 test-push-checkheads-unpushed-D5.t
544 test-push-checkheads-unpushed-D5.t
544 test-push-checkheads-unpushed-D6.t
545 test-push-checkheads-unpushed-D6.t
545 test-push-checkheads-unpushed-D7.t
546 test-push-checkheads-unpushed-D7.t
546 test-push-http.t
547 test-push-http.t
547 test-push-race.t
548 test-push-race.t
548 test-push-warn.t
549 test-push-warn.t
549 test-push.t
550 test-push.t
550 test-pushvars.t
551 test-pushvars.t
551 test-qrecord.t
552 test-qrecord.t
552 test-rebase-abort.t
553 test-rebase-abort.t
553 test-rebase-backup.t
554 test-rebase-backup.t
554 test-rebase-base-flag.t
555 test-rebase-base-flag.t
555 test-rebase-bookmarks.t
556 test-rebase-bookmarks.t
556 test-rebase-brute-force.t
557 test-rebase-brute-force.t
557 test-rebase-cache.t
558 test-rebase-cache.t
558 test-rebase-check-restore.t
559 test-rebase-check-restore.t
559 test-rebase-collapse.t
560 test-rebase-collapse.t
560 test-rebase-conflicts.t
561 test-rebase-conflicts.t
561 test-rebase-dest.t
562 test-rebase-dest.t
562 test-rebase-detach.t
563 test-rebase-detach.t
563 test-rebase-emptycommit.t
564 test-rebase-emptycommit.t
564 test-rebase-inmemory.t
565 test-rebase-inmemory.t
565 test-rebase-interruptions.t
566 test-rebase-interruptions.t
566 test-rebase-issue-noparam-single-rev.t
567 test-rebase-issue-noparam-single-rev.t
567 test-rebase-legacy.t
568 test-rebase-legacy.t
568 test-rebase-mq-skip.t
569 test-rebase-mq-skip.t
569 test-rebase-mq.t
570 test-rebase-mq.t
570 test-rebase-named-branches.t
571 test-rebase-named-branches.t
571 test-rebase-newancestor.t
572 test-rebase-newancestor.t
572 test-rebase-obsolete.t
573 test-rebase-obsolete.t
573 test-rebase-parameters.t
574 test-rebase-parameters.t
574 test-rebase-partial.t
575 test-rebase-partial.t
575 test-rebase-pull.t
576 test-rebase-pull.t
576 test-rebase-rename.t
577 test-rebase-rename.t
577 test-rebase-scenario-global.t
578 test-rebase-scenario-global.t
578 test-rebase-templates.t
579 test-rebase-templates.t
579 test-rebase-transaction.t
580 test-rebase-transaction.t
580 test-rebuildstate.t
581 test-rebuildstate.t
581 test-record.t
582 test-record.t
582 test-releasenotes-formatting.t
583 test-releasenotes-formatting.t
583 test-releasenotes-merging.t
584 test-releasenotes-merging.t
584 test-releasenotes-parsing.t
585 test-releasenotes-parsing.t
585 test-relink.t
586 test-relink.t
586 test-remotefilelog-bad-configs.t
587 test-remotefilelog-bad-configs.t
587 test-remotefilelog-bgprefetch.t
588 test-remotefilelog-bgprefetch.t
588 test-remotefilelog-blame.t
589 test-remotefilelog-blame.t
589 test-remotefilelog-bundle2.t
590 test-remotefilelog-bundle2.t
590 test-remotefilelog-bundles.t
591 test-remotefilelog-bundles.t
591 test-remotefilelog-cacheprocess.t
592 test-remotefilelog-cacheprocess.t
592 test-remotefilelog-clone-tree.t
593 test-remotefilelog-clone-tree.t
593 test-remotefilelog-clone.t
594 test-remotefilelog-clone.t
594 test-remotefilelog-datapack.py
595 test-remotefilelog-datapack.py
595 test-remotefilelog-gcrepack.t
596 test-remotefilelog-gcrepack.t
596 test-remotefilelog-histpack.py
597 test-remotefilelog-histpack.py
597 test-remotefilelog-http.t
598 test-remotefilelog-http.t
598 test-remotefilelog-keepset.t
599 test-remotefilelog-keepset.t
599 test-remotefilelog-local.t
600 test-remotefilelog-local.t
600 test-remotefilelog-log.t
601 test-remotefilelog-log.t
601 test-remotefilelog-partial-shallow.t
602 test-remotefilelog-partial-shallow.t
602 test-remotefilelog-permissions.t
603 test-remotefilelog-permissions.t
603 test-remotefilelog-permisssions.t
604 test-remotefilelog-permisssions.t
604 test-remotefilelog-prefetch.t
605 test-remotefilelog-prefetch.t
605 test-remotefilelog-pull-noshallow.t
606 test-remotefilelog-pull-noshallow.t
606 test-remotefilelog-repack.t
607 test-remotefilelog-repack.t
607 test-remotefilelog-share.t
608 test-remotefilelog-share.t
608 test-remotefilelog-sparse.t
609 test-remotefilelog-sparse.t
609 test-remotefilelog-tags.t
610 test-remotefilelog-tags.t
610 test-remotefilelog-wireproto.t
611 test-remotefilelog-wireproto.t
611 test-remove.t
612 test-remove.t
612 test-removeemptydirs.t
613 test-removeemptydirs.t
613 test-rename-after-merge.t
614 test-rename-after-merge.t
614 test-rename-dir-merge.t
615 test-rename-dir-merge.t
615 test-rename-merge1.t
616 test-rename-merge1.t
616 test-rename-merge2.t
617 test-rename-merge2.t
617 test-rename.t
618 test-rename.t
618 test-repair-strip.t
619 test-repair-strip.t
619 test-repo-compengines.t
620 test-repo-compengines.t
620 test-requires.t
621 test-requires.t
621 test-resolve.t
622 test-resolve.t
622 test-revert-flags.t
623 test-revert-flags.t
623 test-revert-interactive.t
624 test-revert-interactive.t
624 test-revert-unknown.t
625 test-revert-unknown.t
625 test-revert.t
626 test-revert.t
626 test-revisions.t
627 test-revisions.t
627 test-revlog-ancestry.py
628 test-revlog-ancestry.py
628 test-revlog-group-emptyiter.t
629 test-revlog-group-emptyiter.t
629 test-revlog-mmapindex.t
630 test-revlog-mmapindex.t
630 test-revlog-packentry.t
631 test-revlog-packentry.t
631 test-revlog-raw.py
632 test-revlog-raw.py
632 test-revlog-v2.t
633 test-revlog-v2.t
633 test-revlog.t
634 test-revlog.t
634 test-revset-dirstate-parents.t
635 test-revset-dirstate-parents.t
635 test-revset-legacy-lookup.t
636 test-revset-legacy-lookup.t
636 test-revset-outgoing.t
637 test-revset-outgoing.t
637 test-revset2.t
638 test-revset2.t
638 test-rollback.t
639 test-rollback.t
639 test-run-tests.py
640 test-run-tests.py
640 test-run-tests.t
641 test-run-tests.t
641 test-rust-ancestor.py
642 test-rust-ancestor.py
642 test-schemes.t
643 test-schemes.t
643 test-serve.t
644 test-serve.t
644 test-setdiscovery.t
645 test-setdiscovery.t
645 test-share.t
646 test-share.t
646 test-shelve.t
647 test-shelve.t
647 test-shelve2.t
648 test-shelve2.t
648 test-show-stack.t
649 test-show-stack.t
649 test-show-work.t
650 test-show-work.t
650 test-show.t
651 test-show.t
651 test-simple-update.t
652 test-simple-update.t
652 test-simplekeyvaluefile.py
653 test-simplekeyvaluefile.py
653 test-simplemerge.py
654 test-simplemerge.py
654 test-single-head.t
655 test-single-head.t
655 test-sparse-clear.t
656 test-sparse-clear.t
656 test-sparse-clone.t
657 test-sparse-clone.t
657 test-sparse-import.t
658 test-sparse-import.t
658 test-sparse-merges.t
659 test-sparse-merges.t
659 test-sparse-profiles.t
660 test-sparse-profiles.t
660 test-sparse-requirement.t
661 test-sparse-requirement.t
661 test-sparse-verbose-json.t
662 test-sparse-verbose-json.t
662 test-sparse.t
663 test-sparse.t
663 test-split.t
664 test-split.t
664 test-ssh-bundle1.t
665 test-ssh-bundle1.t
665 test-ssh-clone-r.t
666 test-ssh-clone-r.t
666 test-ssh-proto-unbundle.t
667 test-ssh-proto-unbundle.t
667 test-ssh-proto.t
668 test-ssh-proto.t
668 test-ssh-repoerror.t
669 test-ssh-repoerror.t
669 test-ssh.t
670 test-ssh.t
670 test-sshserver.py
671 test-sshserver.py
671 test-stack.t
672 test-stack.t
672 test-static-http.t
673 test-static-http.t
673 test-status-color.t
674 test-status-color.t
674 test-status-inprocess.py
675 test-status-inprocess.py
675 test-status-rev.t
676 test-status-rev.t
676 test-status-terse.t
677 test-status-terse.t
677 test-status.t
678 test-status.t
678 test-storage.py
679 test-storage.py
679 test-stream-bundle-v2.t
680 test-stream-bundle-v2.t
680 test-strict.t
681 test-strict.t
681 test-strip-cross.t
682 test-strip-cross.t
682 test-strip.t
683 test-strip.t
683 test-subrepo-deep-nested-change.t
684 test-subrepo-deep-nested-change.t
684 test-subrepo-git.t
685 test-subrepo-git.t
685 test-subrepo-missing.t
686 test-subrepo-missing.t
686 test-subrepo-paths.t
687 test-subrepo-paths.t
687 test-subrepo-recursion.t
688 test-subrepo-recursion.t
688 test-subrepo-relative-path.t
689 test-subrepo-relative-path.t
689 test-subrepo.t
690 test-subrepo.t
690 test-symlink-os-yes-fs-no.py
691 test-symlink-os-yes-fs-no.py
691 test-symlink-placeholder.t
692 test-symlink-placeholder.t
692 test-symlinks.t
693 test-symlinks.t
693 test-tag.t
694 test-tag.t
694 test-tags.t
695 test-tags.t
695 test-template-basic.t
696 test-template-basic.t
696 test-template-functions.t
697 test-template-functions.t
697 test-template-keywords.t
698 test-template-keywords.t
698 test-template-map.t
699 test-template-map.t
699 test-tools.t
700 test-tools.t
700 test-transplant.t
701 test-transplant.t
701 test-treediscovery-legacy.t
702 test-treediscovery-legacy.t
702 test-treediscovery.t
703 test-treediscovery.t
703 test-treemanifest.t
704 test-treemanifest.t
704 test-ui-color.py
705 test-ui-color.py
705 test-ui-config.py
706 test-ui-config.py
706 test-ui-verbosity.py
707 test-ui-verbosity.py
707 test-unamend.t
708 test-unamend.t
708 test-unbundlehash.t
709 test-unbundlehash.t
709 test-uncommit.t
710 test-uncommit.t
710 test-unified-test.t
711 test-unified-test.t
711 test-unionrepo.t
712 test-unionrepo.t
712 test-unrelated-pull.t
713 test-unrelated-pull.t
713 test-up-local-change.t
714 test-up-local-change.t
714 test-update-atomic.t
715 test-update-atomic.t
715 test-update-branches.t
716 test-update-branches.t
716 test-update-dest.t
717 test-update-dest.t
717 test-update-issue1456.t
718 test-update-issue1456.t
718 test-update-names.t
719 test-update-names.t
719 test-update-reverse.t
720 test-update-reverse.t
720 test-upgrade-repo.t
721 test-upgrade-repo.t
721 test-url-download.t
722 test-url-download.t
722 test-url-rev.t
723 test-url-rev.t
723 test-url.py
724 test-url.py
724 test-username-newline.t
725 test-username-newline.t
725 test-util.py
726 test-util.py
726 test-verify.t
727 test-verify.t
727 test-walk.t
728 test-walk.t
728 test-walkrepo.py
729 test-walkrepo.py
729 test-websub.t
730 test-websub.t
730 test-win32text.t
731 test-win32text.t
731 test-wireproto-caching.t
732 test-wireproto-caching.t
732 test-wireproto-clientreactor.py
733 test-wireproto-clientreactor.py
733 test-wireproto-command-branchmap.t
734 test-wireproto-command-branchmap.t
734 test-wireproto-command-capabilities.t
735 test-wireproto-command-capabilities.t
735 test-wireproto-command-changesetdata.t
736 test-wireproto-command-changesetdata.t
736 test-wireproto-command-filedata.t
737 test-wireproto-command-filedata.t
737 test-wireproto-command-filesdata.t
738 test-wireproto-command-filesdata.t
738 test-wireproto-command-heads.t
739 test-wireproto-command-heads.t
739 test-wireproto-command-known.t
740 test-wireproto-command-known.t
740 test-wireproto-command-listkeys.t
741 test-wireproto-command-listkeys.t
741 test-wireproto-command-lookup.t
742 test-wireproto-command-lookup.t
742 test-wireproto-command-manifestdata.t
743 test-wireproto-command-manifestdata.t
743 test-wireproto-command-pushkey.t
744 test-wireproto-command-pushkey.t
744 test-wireproto-command-rawstorefiledata.t
745 test-wireproto-command-rawstorefiledata.t
745 test-wireproto-content-redirects.t
746 test-wireproto-content-redirects.t
746 test-wireproto-exchangev2.t
747 test-wireproto-exchangev2.t
747 test-wireproto-framing.py
748 test-wireproto-framing.py
748 test-wireproto-serverreactor.py
749 test-wireproto-serverreactor.py
749 test-wireproto.py
750 test-wireproto.py
750 test-wireproto.t
751 test-wireproto.t
751 test-wsgirequest.py
752 test-wsgirequest.py
752 test-xdg.t
753 test-xdg.t
@@ -1,705 +1,706 b''
1 # posix.py - Posix utility function implementations for Mercurial
1 # posix.py - Posix utility function implementations for Mercurial
2 #
2 #
3 # Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
3 # Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import errno
10 import errno
11 import fcntl
11 import fcntl
12 import getpass
12 import getpass
13 import grp
13 import grp
14 import os
14 import os
15 import pwd
15 import pwd
16 import re
16 import re
17 import select
17 import select
18 import stat
18 import stat
19 import sys
19 import sys
20 import tempfile
20 import tempfile
21 import unicodedata
21 import unicodedata
22
22
23 from .i18n import _
23 from .i18n import _
24 from . import (
24 from . import (
25 encoding,
25 encoding,
26 error,
26 error,
27 policy,
27 policy,
28 pycompat,
28 pycompat,
29 )
29 )
30
30
31 osutil = policy.importmod(r'osutil')
31 osutil = policy.importmod(r'osutil')
32
32
33 posixfile = open
33 posixfile = open
34 normpath = os.path.normpath
34 normpath = os.path.normpath
35 samestat = os.path.samestat
35 samestat = os.path.samestat
36 try:
36 try:
37 oslink = os.link
37 oslink = os.link
38 except AttributeError:
38 except AttributeError:
39 # Some platforms build Python without os.link on systems that are
39 # Some platforms build Python without os.link on systems that are
40 # vaguely unix-like but don't have hardlink support. For those
40 # vaguely unix-like but don't have hardlink support. For those
41 # poor souls, just say we tried and that it failed so we fall back
41 # poor souls, just say we tried and that it failed so we fall back
42 # to copies.
42 # to copies.
43 def oslink(src, dst):
43 def oslink(src, dst):
44 raise OSError(errno.EINVAL,
44 raise OSError(errno.EINVAL,
45 'hardlinks not supported: %s to %s' % (src, dst))
45 'hardlinks not supported: %s to %s' % (src, dst))
46 readlink = os.readlink
46 readlink = os.readlink
47 unlink = os.unlink
47 unlink = os.unlink
48 rename = os.rename
48 rename = os.rename
49 removedirs = os.removedirs
49 removedirs = os.removedirs
50 expandglobs = False
50 expandglobs = False
51
51
52 umask = os.umask(0)
52 umask = os.umask(0)
53 os.umask(umask)
53 os.umask(umask)
54
54
55 def split(p):
55 def split(p):
56 '''Same as posixpath.split, but faster
56 '''Same as posixpath.split, but faster
57
57
58 >>> import posixpath
58 >>> import posixpath
59 >>> for f in [b'/absolute/path/to/file',
59 >>> for f in [b'/absolute/path/to/file',
60 ... b'relative/path/to/file',
60 ... b'relative/path/to/file',
61 ... b'file_alone',
61 ... b'file_alone',
62 ... b'path/to/directory/',
62 ... b'path/to/directory/',
63 ... b'/multiple/path//separators',
63 ... b'/multiple/path//separators',
64 ... b'/file_at_root',
64 ... b'/file_at_root',
65 ... b'///multiple_leading_separators_at_root',
65 ... b'///multiple_leading_separators_at_root',
66 ... b'']:
66 ... b'']:
67 ... assert split(f) == posixpath.split(f), f
67 ... assert split(f) == posixpath.split(f), f
68 '''
68 '''
69 ht = p.rsplit('/', 1)
69 ht = p.rsplit('/', 1)
70 if len(ht) == 1:
70 if len(ht) == 1:
71 return '', p
71 return '', p
72 nh = ht[0].rstrip('/')
72 nh = ht[0].rstrip('/')
73 if nh:
73 if nh:
74 return nh, ht[1]
74 return nh, ht[1]
75 return ht[0] + '/', ht[1]
75 return ht[0] + '/', ht[1]
76
76
77 def openhardlinks():
77 def openhardlinks():
78 '''return true if it is safe to hold open file handles to hardlinks'''
78 '''return true if it is safe to hold open file handles to hardlinks'''
79 return True
79 return True
80
80
81 def nlinks(name):
81 def nlinks(name):
82 '''return number of hardlinks for the given file'''
82 '''return number of hardlinks for the given file'''
83 return os.lstat(name).st_nlink
83 return os.lstat(name).st_nlink
84
84
85 def parsepatchoutput(output_line):
85 def parsepatchoutput(output_line):
86 """parses the output produced by patch and returns the filename"""
86 """parses the output produced by patch and returns the filename"""
87 pf = output_line[14:]
87 pf = output_line[14:]
88 if pycompat.sysplatform == 'OpenVMS':
88 if pycompat.sysplatform == 'OpenVMS':
89 if pf[0] == '`':
89 if pf[0] == '`':
90 pf = pf[1:-1] # Remove the quotes
90 pf = pf[1:-1] # Remove the quotes
91 else:
91 else:
92 if pf.startswith("'") and pf.endswith("'") and " " in pf:
92 if pf.startswith("'") and pf.endswith("'") and " " in pf:
93 pf = pf[1:-1] # Remove the quotes
93 pf = pf[1:-1] # Remove the quotes
94 return pf
94 return pf
95
95
96 def sshargs(sshcmd, host, user, port):
96 def sshargs(sshcmd, host, user, port):
97 '''Build argument list for ssh'''
97 '''Build argument list for ssh'''
98 args = user and ("%s@%s" % (user, host)) or host
98 args = user and ("%s@%s" % (user, host)) or host
99 if '-' in args[:1]:
99 if '-' in args[:1]:
100 raise error.Abort(
100 raise error.Abort(
101 _('illegal ssh hostname or username starting with -: %s') % args)
101 _('illegal ssh hostname or username starting with -: %s') % args)
102 args = shellquote(args)
102 args = shellquote(args)
103 if port:
103 if port:
104 args = '-p %s %s' % (shellquote(port), args)
104 args = '-p %s %s' % (shellquote(port), args)
105 return args
105 return args
106
106
107 def isexec(f):
107 def isexec(f):
108 """check whether a file is executable"""
108 """check whether a file is executable"""
109 return (os.lstat(f).st_mode & 0o100 != 0)
109 return (os.lstat(f).st_mode & 0o100 != 0)
110
110
111 def setflags(f, l, x):
111 def setflags(f, l, x):
112 st = os.lstat(f)
112 st = os.lstat(f)
113 s = st.st_mode
113 s = st.st_mode
114 if l:
114 if l:
115 if not stat.S_ISLNK(s):
115 if not stat.S_ISLNK(s):
116 # switch file to link
116 # switch file to link
117 fp = open(f, 'rb')
117 fp = open(f, 'rb')
118 data = fp.read()
118 data = fp.read()
119 fp.close()
119 fp.close()
120 unlink(f)
120 unlink(f)
121 try:
121 try:
122 os.symlink(data, f)
122 os.symlink(data, f)
123 except OSError:
123 except OSError:
124 # failed to make a link, rewrite file
124 # failed to make a link, rewrite file
125 fp = open(f, "wb")
125 fp = open(f, "wb")
126 fp.write(data)
126 fp.write(data)
127 fp.close()
127 fp.close()
128 # no chmod needed at this point
128 # no chmod needed at this point
129 return
129 return
130 if stat.S_ISLNK(s):
130 if stat.S_ISLNK(s):
131 # switch link to file
131 # switch link to file
132 data = os.readlink(f)
132 data = os.readlink(f)
133 unlink(f)
133 unlink(f)
134 fp = open(f, "wb")
134 fp = open(f, "wb")
135 fp.write(data)
135 fp.write(data)
136 fp.close()
136 fp.close()
137 s = 0o666 & ~umask # avoid restatting for chmod
137 s = 0o666 & ~umask # avoid restatting for chmod
138
138
139 sx = s & 0o100
139 sx = s & 0o100
140 if st.st_nlink > 1 and bool(x) != bool(sx):
140 if st.st_nlink > 1 and bool(x) != bool(sx):
141 # the file is a hardlink, break it
141 # the file is a hardlink, break it
142 with open(f, "rb") as fp:
142 with open(f, "rb") as fp:
143 data = fp.read()
143 data = fp.read()
144 unlink(f)
144 unlink(f)
145 with open(f, "wb") as fp:
145 with open(f, "wb") as fp:
146 fp.write(data)
146 fp.write(data)
147
147
148 if x and not sx:
148 if x and not sx:
149 # Turn on +x for every +r bit when making a file executable
149 # Turn on +x for every +r bit when making a file executable
150 # and obey umask.
150 # and obey umask.
151 os.chmod(f, s | (s & 0o444) >> 2 & ~umask)
151 os.chmod(f, s | (s & 0o444) >> 2 & ~umask)
152 elif not x and sx:
152 elif not x and sx:
153 # Turn off all +x bits
153 # Turn off all +x bits
154 os.chmod(f, s & 0o666)
154 os.chmod(f, s & 0o666)
155
155
156 def copymode(src, dst, mode=None, enforcewritable=False):
156 def copymode(src, dst, mode=None, enforcewritable=False):
157 '''Copy the file mode from the file at path src to dst.
157 '''Copy the file mode from the file at path src to dst.
158 If src doesn't exist, we're using mode instead. If mode is None, we're
158 If src doesn't exist, we're using mode instead. If mode is None, we're
159 using umask.'''
159 using umask.'''
160 try:
160 try:
161 st_mode = os.lstat(src).st_mode & 0o777
161 st_mode = os.lstat(src).st_mode & 0o777
162 except OSError as inst:
162 except OSError as inst:
163 if inst.errno != errno.ENOENT:
163 if inst.errno != errno.ENOENT:
164 raise
164 raise
165 st_mode = mode
165 st_mode = mode
166 if st_mode is None:
166 if st_mode is None:
167 st_mode = ~umask
167 st_mode = ~umask
168 st_mode &= 0o666
168 st_mode &= 0o666
169
169
170 new_mode = st_mode
170 new_mode = st_mode
171
171
172 if enforcewritable:
172 if enforcewritable:
173 new_mode |= stat.S_IWUSR
173 new_mode |= stat.S_IWUSR
174
174
175 os.chmod(dst, new_mode)
175 os.chmod(dst, new_mode)
176
176
177 def checkexec(path):
177 def checkexec(path):
178 """
178 """
179 Check whether the given path is on a filesystem with UNIX-like exec flags
179 Check whether the given path is on a filesystem with UNIX-like exec flags
180
180
181 Requires a directory (like /foo/.hg)
181 Requires a directory (like /foo/.hg)
182 """
182 """
183
183
184 # VFAT on some Linux versions can flip mode but it doesn't persist
184 # VFAT on some Linux versions can flip mode but it doesn't persist
185 # a FS remount. Frequently we can detect it if files are created
185 # a FS remount. Frequently we can detect it if files are created
186 # with exec bit on.
186 # with exec bit on.
187
187
188 try:
188 try:
189 EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
189 EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
190 basedir = os.path.join(path, '.hg')
190 basedir = os.path.join(path, '.hg')
191 cachedir = os.path.join(basedir, 'wcache')
191 cachedir = os.path.join(basedir, 'wcache')
192 storedir = os.path.join(basedir, 'store')
192 storedir = os.path.join(basedir, 'store')
193 if not os.path.exists(cachedir):
193 if not os.path.exists(cachedir):
194 try:
194 try:
195 # we want to create the 'cache' directory, not the '.hg' one.
195 # we want to create the 'cache' directory, not the '.hg' one.
196 # Automatically creating '.hg' directory could silently spawn
196 # Automatically creating '.hg' directory could silently spawn
197 # invalid Mercurial repositories. That seems like a bad idea.
197 # invalid Mercurial repositories. That seems like a bad idea.
198 os.mkdir(cachedir)
198 os.mkdir(cachedir)
199 if os.path.exists(storedir):
199 if os.path.exists(storedir):
200 copymode(storedir, cachedir)
200 copymode(storedir, cachedir)
201 else:
201 else:
202 copymode(basedir, cachedir)
202 copymode(basedir, cachedir)
203 except (IOError, OSError):
203 except (IOError, OSError):
204 # we other fallback logic triggers
204 # we other fallback logic triggers
205 pass
205 pass
206 if os.path.isdir(cachedir):
206 if os.path.isdir(cachedir):
207 checkisexec = os.path.join(cachedir, 'checkisexec')
207 checkisexec = os.path.join(cachedir, 'checkisexec')
208 checknoexec = os.path.join(cachedir, 'checknoexec')
208 checknoexec = os.path.join(cachedir, 'checknoexec')
209
209
210 try:
210 try:
211 m = os.stat(checkisexec).st_mode
211 m = os.stat(checkisexec).st_mode
212 except OSError as e:
212 except OSError as e:
213 if e.errno != errno.ENOENT:
213 if e.errno != errno.ENOENT:
214 raise
214 raise
215 # checkisexec does not exist - fall through ...
215 # checkisexec does not exist - fall through ...
216 else:
216 else:
217 # checkisexec exists, check if it actually is exec
217 # checkisexec exists, check if it actually is exec
218 if m & EXECFLAGS != 0:
218 if m & EXECFLAGS != 0:
219 # ensure checkisexec exists, check it isn't exec
219 # ensure checkisexec exists, check it isn't exec
220 try:
220 try:
221 m = os.stat(checknoexec).st_mode
221 m = os.stat(checknoexec).st_mode
222 except OSError as e:
222 except OSError as e:
223 if e.errno != errno.ENOENT:
223 if e.errno != errno.ENOENT:
224 raise
224 raise
225 open(checknoexec, 'w').close() # might fail
225 open(checknoexec, 'w').close() # might fail
226 m = os.stat(checknoexec).st_mode
226 m = os.stat(checknoexec).st_mode
227 if m & EXECFLAGS == 0:
227 if m & EXECFLAGS == 0:
228 # check-exec is exec and check-no-exec is not exec
228 # check-exec is exec and check-no-exec is not exec
229 return True
229 return True
230 # checknoexec exists but is exec - delete it
230 # checknoexec exists but is exec - delete it
231 unlink(checknoexec)
231 unlink(checknoexec)
232 # checkisexec exists but is not exec - delete it
232 # checkisexec exists but is not exec - delete it
233 unlink(checkisexec)
233 unlink(checkisexec)
234
234
235 # check using one file, leave it as checkisexec
235 # check using one file, leave it as checkisexec
236 checkdir = cachedir
236 checkdir = cachedir
237 else:
237 else:
238 # check directly in path and don't leave checkisexec behind
238 # check directly in path and don't leave checkisexec behind
239 checkdir = path
239 checkdir = path
240 checkisexec = None
240 checkisexec = None
241 fh, fn = pycompat.mkstemp(dir=checkdir, prefix='hg-checkexec-')
241 fh, fn = pycompat.mkstemp(dir=checkdir, prefix='hg-checkexec-')
242 try:
242 try:
243 os.close(fh)
243 os.close(fh)
244 m = os.stat(fn).st_mode
244 m = os.stat(fn).st_mode
245 if m & EXECFLAGS == 0:
245 if m & EXECFLAGS == 0:
246 os.chmod(fn, m & 0o777 | EXECFLAGS)
246 os.chmod(fn, m & 0o777 | EXECFLAGS)
247 if os.stat(fn).st_mode & EXECFLAGS != 0:
247 if os.stat(fn).st_mode & EXECFLAGS != 0:
248 if checkisexec is not None:
248 if checkisexec is not None:
249 os.rename(fn, checkisexec)
249 os.rename(fn, checkisexec)
250 fn = None
250 fn = None
251 return True
251 return True
252 finally:
252 finally:
253 if fn is not None:
253 if fn is not None:
254 unlink(fn)
254 unlink(fn)
255 except (IOError, OSError):
255 except (IOError, OSError):
256 # we don't care, the user probably won't be able to commit anyway
256 # we don't care, the user probably won't be able to commit anyway
257 return False
257 return False
258
258
259 def checklink(path):
259 def checklink(path):
260 """check whether the given path is on a symlink-capable filesystem"""
260 """check whether the given path is on a symlink-capable filesystem"""
261 # mktemp is not racy because symlink creation will fail if the
261 # mktemp is not racy because symlink creation will fail if the
262 # file already exists
262 # file already exists
263 while True:
263 while True:
264 cachedir = os.path.join(path, '.hg', 'wcache')
264 cachedir = os.path.join(path, '.hg', 'wcache')
265 checklink = os.path.join(cachedir, 'checklink')
265 checklink = os.path.join(cachedir, 'checklink')
266 # try fast path, read only
266 # try fast path, read only
267 if os.path.islink(checklink):
267 if os.path.islink(checklink):
268 return True
268 return True
269 if os.path.isdir(cachedir):
269 if os.path.isdir(cachedir):
270 checkdir = cachedir
270 checkdir = cachedir
271 else:
271 else:
272 checkdir = path
272 checkdir = path
273 cachedir = None
273 cachedir = None
274 name = tempfile.mktemp(dir=pycompat.fsdecode(checkdir),
274 name = tempfile.mktemp(dir=pycompat.fsdecode(checkdir),
275 prefix=r'checklink-')
275 prefix=r'checklink-')
276 name = pycompat.fsencode(name)
276 name = pycompat.fsencode(name)
277 try:
277 try:
278 fd = None
278 fd = None
279 if cachedir is None:
279 if cachedir is None:
280 fd = pycompat.namedtempfile(dir=checkdir,
280 fd = pycompat.namedtempfile(dir=checkdir,
281 prefix='hg-checklink-')
281 prefix='hg-checklink-')
282 target = os.path.basename(fd.name)
282 target = os.path.basename(fd.name)
283 else:
283 else:
284 # create a fixed file to link to; doesn't matter if it
284 # create a fixed file to link to; doesn't matter if it
285 # already exists.
285 # already exists.
286 target = 'checklink-target'
286 target = 'checklink-target'
287 try:
287 try:
288 fullpath = os.path.join(cachedir, target)
288 fullpath = os.path.join(cachedir, target)
289 open(fullpath, 'w').close()
289 open(fullpath, 'w').close()
290 except IOError as inst:
290 except IOError as inst:
291 if inst[0] == errno.EACCES:
291 if inst[0] == errno.EACCES:
292 # If we can't write to cachedir, just pretend
292 # If we can't write to cachedir, just pretend
293 # that the fs is readonly and by association
293 # that the fs is readonly and by association
294 # that the fs won't support symlinks. This
294 # that the fs won't support symlinks. This
295 # seems like the least dangerous way to avoid
295 # seems like the least dangerous way to avoid
296 # data loss.
296 # data loss.
297 return False
297 return False
298 raise
298 raise
299 try:
299 try:
300 os.symlink(target, name)
300 os.symlink(target, name)
301 if cachedir is None:
301 if cachedir is None:
302 unlink(name)
302 unlink(name)
303 else:
303 else:
304 try:
304 try:
305 os.rename(name, checklink)
305 os.rename(name, checklink)
306 except OSError:
306 except OSError:
307 unlink(name)
307 unlink(name)
308 return True
308 return True
309 except OSError as inst:
309 except OSError as inst:
310 # link creation might race, try again
310 # link creation might race, try again
311 if inst.errno == errno.EEXIST:
311 if inst.errno == errno.EEXIST:
312 continue
312 continue
313 raise
313 raise
314 finally:
314 finally:
315 if fd is not None:
315 if fd is not None:
316 fd.close()
316 fd.close()
317 except AttributeError:
317 except AttributeError:
318 return False
318 return False
319 except OSError as inst:
319 except OSError as inst:
320 # sshfs might report failure while successfully creating the link
320 # sshfs might report failure while successfully creating the link
321 if inst.errno == errno.EIO and os.path.exists(name):
321 if inst.errno == errno.EIO and os.path.exists(name):
322 unlink(name)
322 unlink(name)
323 return False
323 return False
324
324
325 def checkosfilename(path):
325 def checkosfilename(path):
326 '''Check that the base-relative path is a valid filename on this platform.
326 '''Check that the base-relative path is a valid filename on this platform.
327 Returns None if the path is ok, or a UI string describing the problem.'''
327 Returns None if the path is ok, or a UI string describing the problem.'''
328 return None # on posix platforms, every path is ok
328 return None # on posix platforms, every path is ok
329
329
330 def getfsmountpoint(dirpath):
330 def getfsmountpoint(dirpath):
331 '''Get the filesystem mount point from a directory (best-effort)
331 '''Get the filesystem mount point from a directory (best-effort)
332
332
333 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc.
333 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc.
334 '''
334 '''
335 return getattr(osutil, 'getfsmountpoint', lambda x: None)(dirpath)
335 return getattr(osutil, 'getfsmountpoint', lambda x: None)(dirpath)
336
336
337 def getfstype(dirpath):
337 def getfstype(dirpath):
338 '''Get the filesystem type name from a directory (best-effort)
338 '''Get the filesystem type name from a directory (best-effort)
339
339
340 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc.
340 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc.
341 '''
341 '''
342 return getattr(osutil, 'getfstype', lambda x: None)(dirpath)
342 return getattr(osutil, 'getfstype', lambda x: None)(dirpath)
343
343
344 def setbinary(fd):
344 def setbinary(fd):
345 pass
345 pass
346
346
347 def pconvert(path):
347 def pconvert(path):
348 return path
348 return path
349
349
350 def localpath(path):
350 def localpath(path):
351 return path
351 return path
352
352
353 def samefile(fpath1, fpath2):
353 def samefile(fpath1, fpath2):
354 """Returns whether path1 and path2 refer to the same file. This is only
354 """Returns whether path1 and path2 refer to the same file. This is only
355 guaranteed to work for files, not directories."""
355 guaranteed to work for files, not directories."""
356 return os.path.samefile(fpath1, fpath2)
356 return os.path.samefile(fpath1, fpath2)
357
357
358 def samedevice(fpath1, fpath2):
358 def samedevice(fpath1, fpath2):
359 """Returns whether fpath1 and fpath2 are on the same device. This is only
359 """Returns whether fpath1 and fpath2 are on the same device. This is only
360 guaranteed to work for files, not directories."""
360 guaranteed to work for files, not directories."""
361 st1 = os.lstat(fpath1)
361 st1 = os.lstat(fpath1)
362 st2 = os.lstat(fpath2)
362 st2 = os.lstat(fpath2)
363 return st1.st_dev == st2.st_dev
363 return st1.st_dev == st2.st_dev
364
364
365 # os.path.normcase is a no-op, which doesn't help us on non-native filesystems
365 # os.path.normcase is a no-op, which doesn't help us on non-native filesystems
366 def normcase(path):
366 def normcase(path):
367 return path.lower()
367 return path.lower()
368
368
369 # what normcase does to ASCII strings
369 # what normcase does to ASCII strings
370 normcasespec = encoding.normcasespecs.lower
370 normcasespec = encoding.normcasespecs.lower
371 # fallback normcase function for non-ASCII strings
371 # fallback normcase function for non-ASCII strings
372 normcasefallback = normcase
372 normcasefallback = normcase
373
373
374 if pycompat.isdarwin:
374 if pycompat.isdarwin:
375
375
376 def normcase(path):
376 def normcase(path):
377 '''
377 '''
378 Normalize a filename for OS X-compatible comparison:
378 Normalize a filename for OS X-compatible comparison:
379 - escape-encode invalid characters
379 - escape-encode invalid characters
380 - decompose to NFD
380 - decompose to NFD
381 - lowercase
381 - lowercase
382 - omit ignored characters [200c-200f, 202a-202e, 206a-206f,feff]
382 - omit ignored characters [200c-200f, 202a-202e, 206a-206f,feff]
383
383
384 >>> normcase(b'UPPER')
384 >>> normcase(b'UPPER')
385 'upper'
385 'upper'
386 >>> normcase(b'Caf\\xc3\\xa9')
386 >>> normcase(b'Caf\\xc3\\xa9')
387 'cafe\\xcc\\x81'
387 'cafe\\xcc\\x81'
388 >>> normcase(b'\\xc3\\x89')
388 >>> normcase(b'\\xc3\\x89')
389 'e\\xcc\\x81'
389 'e\\xcc\\x81'
390 >>> normcase(b'\\xb8\\xca\\xc3\\xca\\xbe\\xc8.JPG') # issue3918
390 >>> normcase(b'\\xb8\\xca\\xc3\\xca\\xbe\\xc8.JPG') # issue3918
391 '%b8%ca%c3\\xca\\xbe%c8.jpg'
391 '%b8%ca%c3\\xca\\xbe%c8.jpg'
392 '''
392 '''
393
393
394 try:
394 try:
395 return encoding.asciilower(path) # exception for non-ASCII
395 return encoding.asciilower(path) # exception for non-ASCII
396 except UnicodeDecodeError:
396 except UnicodeDecodeError:
397 return normcasefallback(path)
397 return normcasefallback(path)
398
398
399 normcasespec = encoding.normcasespecs.lower
399 normcasespec = encoding.normcasespecs.lower
400
400
401 def normcasefallback(path):
401 def normcasefallback(path):
402 try:
402 try:
403 u = path.decode('utf-8')
403 u = path.decode('utf-8')
404 except UnicodeDecodeError:
404 except UnicodeDecodeError:
405 # OS X percent-encodes any bytes that aren't valid utf-8
405 # OS X percent-encodes any bytes that aren't valid utf-8
406 s = ''
406 s = ''
407 pos = 0
407 pos = 0
408 l = len(path)
408 l = len(path)
409 while pos < l:
409 while pos < l:
410 try:
410 try:
411 c = encoding.getutf8char(path, pos)
411 c = encoding.getutf8char(path, pos)
412 pos += len(c)
412 pos += len(c)
413 except ValueError:
413 except ValueError:
414 c = '%%%02X' % ord(path[pos:pos + 1])
414 c = '%%%02X' % ord(path[pos:pos + 1])
415 pos += 1
415 pos += 1
416 s += c
416 s += c
417
417
418 u = s.decode('utf-8')
418 u = s.decode('utf-8')
419
419
420 # Decompose then lowercase (HFS+ technote specifies lower)
420 # Decompose then lowercase (HFS+ technote specifies lower)
421 enc = unicodedata.normalize(r'NFD', u).lower().encode('utf-8')
421 enc = unicodedata.normalize(r'NFD', u).lower().encode('utf-8')
422 # drop HFS+ ignored characters
422 # drop HFS+ ignored characters
423 return encoding.hfsignoreclean(enc)
423 return encoding.hfsignoreclean(enc)
424
424
425 if pycompat.sysplatform == 'cygwin':
425 if pycompat.sysplatform == 'cygwin':
426 # workaround for cygwin, in which mount point part of path is
426 # workaround for cygwin, in which mount point part of path is
427 # treated as case sensitive, even though underlying NTFS is case
427 # treated as case sensitive, even though underlying NTFS is case
428 # insensitive.
428 # insensitive.
429
429
430 # default mount points
430 # default mount points
431 cygwinmountpoints = sorted([
431 cygwinmountpoints = sorted([
432 "/usr/bin",
432 "/usr/bin",
433 "/usr/lib",
433 "/usr/lib",
434 "/cygdrive",
434 "/cygdrive",
435 ], reverse=True)
435 ], reverse=True)
436
436
437 # use upper-ing as normcase as same as NTFS workaround
437 # use upper-ing as normcase as same as NTFS workaround
438 def normcase(path):
438 def normcase(path):
439 pathlen = len(path)
439 pathlen = len(path)
440 if (pathlen == 0) or (path[0] != pycompat.ossep):
440 if (pathlen == 0) or (path[0] != pycompat.ossep):
441 # treat as relative
441 # treat as relative
442 return encoding.upper(path)
442 return encoding.upper(path)
443
443
444 # to preserve case of mountpoint part
444 # to preserve case of mountpoint part
445 for mp in cygwinmountpoints:
445 for mp in cygwinmountpoints:
446 if not path.startswith(mp):
446 if not path.startswith(mp):
447 continue
447 continue
448
448
449 mplen = len(mp)
449 mplen = len(mp)
450 if mplen == pathlen: # mount point itself
450 if mplen == pathlen: # mount point itself
451 return mp
451 return mp
452 if path[mplen] == pycompat.ossep:
452 if path[mplen] == pycompat.ossep:
453 return mp + encoding.upper(path[mplen:])
453 return mp + encoding.upper(path[mplen:])
454
454
455 return encoding.upper(path)
455 return encoding.upper(path)
456
456
457 normcasespec = encoding.normcasespecs.other
457 normcasespec = encoding.normcasespecs.other
458 normcasefallback = normcase
458 normcasefallback = normcase
459
459
460 # Cygwin translates native ACLs to POSIX permissions,
460 # Cygwin translates native ACLs to POSIX permissions,
461 # but these translations are not supported by native
461 # but these translations are not supported by native
462 # tools, so the exec bit tends to be set erroneously.
462 # tools, so the exec bit tends to be set erroneously.
463 # Therefore, disable executable bit access on Cygwin.
463 # Therefore, disable executable bit access on Cygwin.
464 def checkexec(path):
464 def checkexec(path):
465 return False
465 return False
466
466
467 # Similarly, Cygwin's symlink emulation is likely to create
467 # Similarly, Cygwin's symlink emulation is likely to create
468 # problems when Mercurial is used from both Cygwin and native
468 # problems when Mercurial is used from both Cygwin and native
469 # Windows, with other native tools, or on shared volumes
469 # Windows, with other native tools, or on shared volumes
470 def checklink(path):
470 def checklink(path):
471 return False
471 return False
472
472
473 _needsshellquote = None
473 _needsshellquote = None
474 def shellquote(s):
474 def shellquote(s):
475 if pycompat.sysplatform == 'OpenVMS':
475 if pycompat.sysplatform == 'OpenVMS':
476 return '"%s"' % s
476 return '"%s"' % s
477 global _needsshellquote
477 global _needsshellquote
478 if _needsshellquote is None:
478 if _needsshellquote is None:
479 _needsshellquote = re.compile(br'[^a-zA-Z0-9._/+-]').search
479 _needsshellquote = re.compile(br'[^a-zA-Z0-9._/+-]').search
480 if s and not _needsshellquote(s):
480 if s and not _needsshellquote(s):
481 # "s" shouldn't have to be quoted
481 # "s" shouldn't have to be quoted
482 return s
482 return s
483 else:
483 else:
484 return "'%s'" % s.replace("'", "'\\''")
484 return "'%s'" % s.replace("'", "'\\''")
485
485
486 def shellsplit(s):
486 def shellsplit(s):
487 """Parse a command string in POSIX shell way (best-effort)"""
487 """Parse a command string in POSIX shell way (best-effort)"""
488 return pycompat.shlexsplit(s, posix=True)
488 return pycompat.shlexsplit(s, posix=True)
489
489
490 def quotecommand(cmd):
490 def quotecommand(cmd):
491 return cmd
491 return cmd
492
492
493 def testpid(pid):
493 def testpid(pid):
494 '''return False if pid dead, True if running or not sure'''
494 '''return False if pid dead, True if running or not sure'''
495 if pycompat.sysplatform == 'OpenVMS':
495 if pycompat.sysplatform == 'OpenVMS':
496 return True
496 return True
497 try:
497 try:
498 os.kill(pid, 0)
498 os.kill(pid, 0)
499 return True
499 return True
500 except OSError as inst:
500 except OSError as inst:
501 return inst.errno != errno.ESRCH
501 return inst.errno != errno.ESRCH
502
502
503 def isowner(st):
503 def isowner(st):
504 """Return True if the stat object st is from the current user."""
504 """Return True if the stat object st is from the current user."""
505 return st.st_uid == os.getuid()
505 return st.st_uid == os.getuid()
506
506
507 def findexe(command):
507 def findexe(command):
508 '''Find executable for command searching like which does.
508 '''Find executable for command searching like which does.
509 If command is a basename then PATH is searched for command.
509 If command is a basename then PATH is searched for command.
510 PATH isn't searched if command is an absolute or relative path.
510 PATH isn't searched if command is an absolute or relative path.
511 If command isn't found None is returned.'''
511 If command isn't found None is returned.'''
512 if pycompat.sysplatform == 'OpenVMS':
512 if pycompat.sysplatform == 'OpenVMS':
513 return command
513 return command
514
514
515 def findexisting(executable):
515 def findexisting(executable):
516 'Will return executable if existing file'
516 'Will return executable if existing file'
517 if os.path.isfile(executable) and os.access(executable, os.X_OK):
517 if os.path.isfile(executable) and os.access(executable, os.X_OK):
518 return executable
518 return executable
519 return None
519 return None
520
520
521 if pycompat.ossep in command:
521 if pycompat.ossep in command:
522 return findexisting(command)
522 return findexisting(command)
523
523
524 if pycompat.sysplatform == 'plan9':
524 if pycompat.sysplatform == 'plan9':
525 return findexisting(os.path.join('/bin', command))
525 return findexisting(os.path.join('/bin', command))
526
526
527 for path in encoding.environ.get('PATH', '').split(pycompat.ospathsep):
527 for path in encoding.environ.get('PATH', '').split(pycompat.ospathsep):
528 executable = findexisting(os.path.join(path, command))
528 executable = findexisting(os.path.join(path, command))
529 if executable is not None:
529 if executable is not None:
530 return executable
530 return executable
531 return None
531 return None
532
532
533 def setsignalhandler():
533 def setsignalhandler():
534 pass
534 pass
535
535
536 _wantedkinds = {stat.S_IFREG, stat.S_IFLNK}
536 _wantedkinds = {stat.S_IFREG, stat.S_IFLNK}
537
537
538 def statfiles(files):
538 def statfiles(files):
539 '''Stat each file in files. Yield each stat, or None if a file does not
539 '''Stat each file in files. Yield each stat, or None if a file does not
540 exist or has a type we don't care about.'''
540 exist or has a type we don't care about.'''
541 lstat = os.lstat
541 lstat = os.lstat
542 getkind = stat.S_IFMT
542 getkind = stat.S_IFMT
543 for nf in files:
543 for nf in files:
544 try:
544 try:
545 st = lstat(nf)
545 st = lstat(nf)
546 if getkind(st.st_mode) not in _wantedkinds:
546 if getkind(st.st_mode) not in _wantedkinds:
547 st = None
547 st = None
548 except OSError as err:
548 except OSError as err:
549 if err.errno not in (errno.ENOENT, errno.ENOTDIR):
549 if err.errno not in (errno.ENOENT, errno.ENOTDIR):
550 raise
550 raise
551 st = None
551 st = None
552 yield st
552 yield st
553
553
554 def getuser():
554 def getuser():
555 '''return name of current user'''
555 '''return name of current user'''
556 return pycompat.fsencode(getpass.getuser())
556 return pycompat.fsencode(getpass.getuser())
557
557
558 def username(uid=None):
558 def username(uid=None):
559 """Return the name of the user with the given uid.
559 """Return the name of the user with the given uid.
560
560
561 If uid is None, return the name of the current user."""
561 If uid is None, return the name of the current user."""
562
562
563 if uid is None:
563 if uid is None:
564 uid = os.getuid()
564 uid = os.getuid()
565 try:
565 try:
566 return pycompat.fsencode(pwd.getpwuid(uid)[0])
566 return pycompat.fsencode(pwd.getpwuid(uid)[0])
567 except KeyError:
567 except KeyError:
568 return b'%d' % uid
568 return b'%d' % uid
569
569
570 def groupname(gid=None):
570 def groupname(gid=None):
571 """Return the name of the group with the given gid.
571 """Return the name of the group with the given gid.
572
572
573 If gid is None, return the name of the current group."""
573 If gid is None, return the name of the current group."""
574
574
575 if gid is None:
575 if gid is None:
576 gid = os.getgid()
576 gid = os.getgid()
577 try:
577 try:
578 return grp.getgrgid(gid)[0]
578 return grp.getgrgid(gid)[0]
579 except KeyError:
579 except KeyError:
580 return str(gid)
580 return str(gid)
581
581
582 def groupmembers(name):
582 def groupmembers(name):
583 """Return the list of members of the group with the given
583 """Return the list of members of the group with the given
584 name, KeyError if the group does not exist.
584 name, KeyError if the group does not exist.
585 """
585 """
586 name = pycompat.sysstr(name)
586 return list(grp.getgrnam(name).gr_mem)
587 return list(grp.getgrnam(name).gr_mem)
587
588
588 def spawndetached(args):
589 def spawndetached(args):
589 return os.spawnvp(os.P_NOWAIT | getattr(os, 'P_DETACH', 0),
590 return os.spawnvp(os.P_NOWAIT | getattr(os, 'P_DETACH', 0),
590 args[0], args)
591 args[0], args)
591
592
592 def gethgcmd():
593 def gethgcmd():
593 return sys.argv[:1]
594 return sys.argv[:1]
594
595
595 def makedir(path, notindexed):
596 def makedir(path, notindexed):
596 os.mkdir(path)
597 os.mkdir(path)
597
598
598 def lookupreg(key, name=None, scope=None):
599 def lookupreg(key, name=None, scope=None):
599 return None
600 return None
600
601
601 def hidewindow():
602 def hidewindow():
602 """Hide current shell window.
603 """Hide current shell window.
603
604
604 Used to hide the window opened when starting asynchronous
605 Used to hide the window opened when starting asynchronous
605 child process under Windows, unneeded on other systems.
606 child process under Windows, unneeded on other systems.
606 """
607 """
607 pass
608 pass
608
609
609 class cachestat(object):
610 class cachestat(object):
610 def __init__(self, path):
611 def __init__(self, path):
611 self.stat = os.stat(path)
612 self.stat = os.stat(path)
612
613
613 def cacheable(self):
614 def cacheable(self):
614 return bool(self.stat.st_ino)
615 return bool(self.stat.st_ino)
615
616
616 __hash__ = object.__hash__
617 __hash__ = object.__hash__
617
618
618 def __eq__(self, other):
619 def __eq__(self, other):
619 try:
620 try:
620 # Only dev, ino, size, mtime and atime are likely to change. Out
621 # Only dev, ino, size, mtime and atime are likely to change. Out
621 # of these, we shouldn't compare atime but should compare the
622 # of these, we shouldn't compare atime but should compare the
622 # rest. However, one of the other fields changing indicates
623 # rest. However, one of the other fields changing indicates
623 # something fishy going on, so return False if anything but atime
624 # something fishy going on, so return False if anything but atime
624 # changes.
625 # changes.
625 return (self.stat.st_mode == other.stat.st_mode and
626 return (self.stat.st_mode == other.stat.st_mode and
626 self.stat.st_ino == other.stat.st_ino and
627 self.stat.st_ino == other.stat.st_ino and
627 self.stat.st_dev == other.stat.st_dev and
628 self.stat.st_dev == other.stat.st_dev and
628 self.stat.st_nlink == other.stat.st_nlink and
629 self.stat.st_nlink == other.stat.st_nlink and
629 self.stat.st_uid == other.stat.st_uid and
630 self.stat.st_uid == other.stat.st_uid and
630 self.stat.st_gid == other.stat.st_gid and
631 self.stat.st_gid == other.stat.st_gid and
631 self.stat.st_size == other.stat.st_size and
632 self.stat.st_size == other.stat.st_size and
632 self.stat[stat.ST_MTIME] == other.stat[stat.ST_MTIME] and
633 self.stat[stat.ST_MTIME] == other.stat[stat.ST_MTIME] and
633 self.stat[stat.ST_CTIME] == other.stat[stat.ST_CTIME])
634 self.stat[stat.ST_CTIME] == other.stat[stat.ST_CTIME])
634 except AttributeError:
635 except AttributeError:
635 return False
636 return False
636
637
637 def __ne__(self, other):
638 def __ne__(self, other):
638 return not self == other
639 return not self == other
639
640
640 def statislink(st):
641 def statislink(st):
641 '''check whether a stat result is a symlink'''
642 '''check whether a stat result is a symlink'''
642 return st and stat.S_ISLNK(st.st_mode)
643 return st and stat.S_ISLNK(st.st_mode)
643
644
644 def statisexec(st):
645 def statisexec(st):
645 '''check whether a stat result is an executable file'''
646 '''check whether a stat result is an executable file'''
646 return st and (st.st_mode & 0o100 != 0)
647 return st and (st.st_mode & 0o100 != 0)
647
648
648 def poll(fds):
649 def poll(fds):
649 """block until something happens on any file descriptor
650 """block until something happens on any file descriptor
650
651
651 This is a generic helper that will check for any activity
652 This is a generic helper that will check for any activity
652 (read, write. exception) and return the list of touched files.
653 (read, write. exception) and return the list of touched files.
653
654
654 In unsupported cases, it will raise a NotImplementedError"""
655 In unsupported cases, it will raise a NotImplementedError"""
655 try:
656 try:
656 while True:
657 while True:
657 try:
658 try:
658 res = select.select(fds, fds, fds)
659 res = select.select(fds, fds, fds)
659 break
660 break
660 except select.error as inst:
661 except select.error as inst:
661 if inst.args[0] == errno.EINTR:
662 if inst.args[0] == errno.EINTR:
662 continue
663 continue
663 raise
664 raise
664 except ValueError: # out of range file descriptor
665 except ValueError: # out of range file descriptor
665 raise NotImplementedError()
666 raise NotImplementedError()
666 return sorted(list(set(sum(res, []))))
667 return sorted(list(set(sum(res, []))))
667
668
668 def readpipe(pipe):
669 def readpipe(pipe):
669 """Read all available data from a pipe."""
670 """Read all available data from a pipe."""
670 # We can't fstat() a pipe because Linux will always report 0.
671 # We can't fstat() a pipe because Linux will always report 0.
671 # So, we set the pipe to non-blocking mode and read everything
672 # So, we set the pipe to non-blocking mode and read everything
672 # that's available.
673 # that's available.
673 flags = fcntl.fcntl(pipe, fcntl.F_GETFL)
674 flags = fcntl.fcntl(pipe, fcntl.F_GETFL)
674 flags |= os.O_NONBLOCK
675 flags |= os.O_NONBLOCK
675 oldflags = fcntl.fcntl(pipe, fcntl.F_SETFL, flags)
676 oldflags = fcntl.fcntl(pipe, fcntl.F_SETFL, flags)
676
677
677 try:
678 try:
678 chunks = []
679 chunks = []
679 while True:
680 while True:
680 try:
681 try:
681 s = pipe.read()
682 s = pipe.read()
682 if not s:
683 if not s:
683 break
684 break
684 chunks.append(s)
685 chunks.append(s)
685 except IOError:
686 except IOError:
686 break
687 break
687
688
688 return ''.join(chunks)
689 return ''.join(chunks)
689 finally:
690 finally:
690 fcntl.fcntl(pipe, fcntl.F_SETFL, oldflags)
691 fcntl.fcntl(pipe, fcntl.F_SETFL, oldflags)
691
692
692 def bindunixsocket(sock, path):
693 def bindunixsocket(sock, path):
693 """Bind the UNIX domain socket to the specified path"""
694 """Bind the UNIX domain socket to the specified path"""
694 # use relative path instead of full path at bind() if possible, since
695 # use relative path instead of full path at bind() if possible, since
695 # AF_UNIX path has very small length limit (107 chars) on common
696 # AF_UNIX path has very small length limit (107 chars) on common
696 # platforms (see sys/un.h)
697 # platforms (see sys/un.h)
697 dirname, basename = os.path.split(path)
698 dirname, basename = os.path.split(path)
698 bakwdfd = None
699 bakwdfd = None
699 if dirname:
700 if dirname:
700 bakwdfd = os.open('.', os.O_DIRECTORY)
701 bakwdfd = os.open('.', os.O_DIRECTORY)
701 os.chdir(dirname)
702 os.chdir(dirname)
702 sock.bind(basename)
703 sock.bind(basename)
703 if bakwdfd:
704 if bakwdfd:
704 os.fchdir(bakwdfd)
705 os.fchdir(bakwdfd)
705 os.close(bakwdfd)
706 os.close(bakwdfd)
General Comments 0
You need to be logged in to leave comments. Login now