Show More
@@ -7,7 +7,7 b' image: registry.heptapod.net/mercurial/c' | |||||
7 | variables: |
|
7 | variables: | |
8 | PYTHON: python |
|
8 | PYTHON: python | |
9 | TEST_HGMODULEPOLICY: "allow" |
|
9 | TEST_HGMODULEPOLICY: "allow" | |
10 |
HG_CI_IMAGE_TAG: " |
|
10 | HG_CI_IMAGE_TAG: "v1.0" | |
11 | TEST_HGTESTS_ALLOW_NETIO: "0" |
|
11 | TEST_HGTESTS_ALLOW_NETIO: "0" | |
12 |
|
12 | |||
13 | .all_template: &all |
|
13 | .all_template: &all |
@@ -2905,7 +2905,14 b' def amend(ui, repo, old, extra, pats, op' | |||||
2905 | filestoamend = {f for f in wctx.files() if matcher(f)} |
|
2905 | filestoamend = {f for f in wctx.files() if matcher(f)} | |
2906 |
|
2906 | |||
2907 | changes = len(filestoamend) > 0 |
|
2907 | changes = len(filestoamend) > 0 | |
2908 |
|
|
2908 | changeset_copies = ( | |
|
2909 | repo.ui.config(b'experimental', b'copies.read-from') | |||
|
2910 | != b'filelog-only' | |||
|
2911 | ) | |||
|
2912 | # If there are changes to amend or if copy information needs to be read | |||
|
2913 | # from the changeset extras, we cannot take the fast path of using | |||
|
2914 | # filectxs from the old commit. | |||
|
2915 | if changes or changeset_copies: | |||
2909 | # Recompute copies (avoid recording a -> b -> a) |
|
2916 | # Recompute copies (avoid recording a -> b -> a) | |
2910 | copied = copies.pathcopies(base, wctx, matcher) |
|
2917 | copied = copies.pathcopies(base, wctx, matcher) | |
2911 | if old.p2: |
|
2918 | if old.p2: | |
@@ -2926,19 +2933,19 b' def amend(ui, repo, old, extra, pats, op' | |||||
2926 |
|
2933 | |||
2927 | def filectxfn(repo, ctx_, path): |
|
2934 | def filectxfn(repo, ctx_, path): | |
2928 | try: |
|
2935 | try: | |
|
2936 | # Return None for removed files. | |||
|
2937 | if path in wctx.removed(): | |||
|
2938 | return None | |||
|
2939 | ||||
2929 | # If the file being considered is not amongst the files |
|
2940 | # If the file being considered is not amongst the files | |
2930 |
# to be amended, we should |
|
2941 | # to be amended, we should use the file context from the | |
2931 | # old changeset. This avoids issues when only some files in |
|
2942 | # old changeset. This avoids issues when only some files in | |
2932 | # the working copy are being amended but there are also |
|
2943 | # the working copy are being amended but there are also | |
2933 | # changes to other files from the old changeset. |
|
2944 | # changes to other files from the old changeset. | |
2934 |
if path |
|
2945 | if path in filestoamend: | |
2935 |
|
|
2946 | fctx = wctx[path] | |
2936 |
|
2947 | else: | ||
2937 |
|
|
2948 | fctx = old.filectx(path) | |
2938 | if path in wctx.removed(): |
|
|||
2939 | return None |
|
|||
2940 |
|
||||
2941 | fctx = wctx[path] |
|
|||
2942 | flags = fctx.flags() |
|
2949 | flags = fctx.flags() | |
2943 | mctx = context.memfilectx( |
|
2950 | mctx = context.memfilectx( | |
2944 | repo, |
|
2951 | repo, |
@@ -47,6 +47,17 b" pub fn status<'tree, 'on_disk: 'tree>(" | |||||
47 | ignore_files: Vec<PathBuf>, |
|
47 | ignore_files: Vec<PathBuf>, | |
48 | options: StatusOptions, |
|
48 | options: StatusOptions, | |
49 | ) -> Result<(DirstateStatus<'on_disk>, Vec<PatternFileWarning>), StatusError> { |
|
49 | ) -> Result<(DirstateStatus<'on_disk>, Vec<PatternFileWarning>), StatusError> { | |
|
50 | // Force the global rayon threadpool to not exceed 16 concurrent threads. | |||
|
51 | // This is a stop-gap measure until we figure out why using more than 16 | |||
|
52 | // threads makes `status` slower for each additional thread. | |||
|
53 | // We use `ok()` in case the global threadpool has already been | |||
|
54 | // instantiated in `rhg` or some other caller. | |||
|
55 | // TODO find the underlying cause and fix it, then remove this. | |||
|
56 | rayon::ThreadPoolBuilder::new() | |||
|
57 | .num_threads(16) | |||
|
58 | .build_global() | |||
|
59 | .ok(); | |||
|
60 | ||||
50 | let (ignore_fn, warnings, patterns_changed): (IgnoreFnType, _, _) = |
|
61 | let (ignore_fn, warnings, patterns_changed): (IgnoreFnType, _, _) = | |
51 | if options.list_ignored || options.list_unknown { |
|
62 | if options.list_ignored || options.list_unknown { | |
52 | let mut hasher = Sha1::new(); |
|
63 | let mut hasher = Sha1::new(); |
@@ -316,6 +316,15 b' Test writing only to filelog' | |||||
316 | a -> k |
|
316 | a -> k | |
317 | #endif |
|
317 | #endif | |
318 |
|
318 | |||
|
319 | Existing copy information is preserved by amend | |||
|
320 | $ hg cp a l | |||
|
321 | $ hg ci -m 'copy a to l' | |||
|
322 | $ hg showcopies | |||
|
323 | a -> l | |||
|
324 | $ hg ci --amend -m 'new description' | |||
|
325 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-*-amend.hg (glob) | |||
|
326 | $ hg showcopies | |||
|
327 | a -> l | |||
319 | $ cd .. |
|
328 | $ cd .. | |
320 |
|
329 | |||
321 | Test rebasing a commit with copy information |
|
330 | Test rebasing a commit with copy information |
@@ -14,14 +14,7 b" while we're running" | |||||
14 | > f="\${WAITLOCK_FILE}" |
|
14 | > f="\${WAITLOCK_FILE}" | |
15 | > start=\`date +%s\` |
|
15 | > start=\`date +%s\` | |
16 | > timeout=5 |
|
16 | > timeout=5 | |
17 | > while [ \\( ! -f \$f \\) -a \\( ! -L \$f \\) ]; do |
|
17 | > $RUNTESTDIR/testlib/wait-on-file "\$timeout" "\$f" | |
18 | > now=\`date +%s\` |
|
|||
19 | > if [ "\`expr \$now - \$start\`" -gt \$timeout ]; then |
|
|||
20 | > echo "timeout: \$f was not created in \$timeout seconds (it is now \$(date +%s))" |
|
|||
21 | > exit 1 |
|
|||
22 | > fi |
|
|||
23 | > sleep 0.1 |
|
|||
24 | > done |
|
|||
25 |
> if [ \$# -gt |
|
18 | > if [ \$# -gt 1 ]; then | |
26 |
> cat |
|
19 | > cat "\$@" | |
27 | > fi |
|
20 | > fi |
General Comments 0
You need to be logged in to leave comments.
Login now