tests/test-commit-copy.t
author Patrick Mezard <patrick@mezard.eu>
Tue, 07 Feb 2012 18:47:16 +0100
branchstable
changeset 16101 20ad8f0512a2
parent 14182 ec5886db9dc6
permissions -rw-r--r--
mq: restore _branchtags() fast path (issue3223) Since a5917346c72e, mq saves the nodeid of the first applied patch to cache/branchheads, which breaks the optimized cache handling introduced in fbf8320f25c8. The problem is the revision being committed is appended to mqrepo.applied after the commit succeeds, which means mqrepo._branchtags() performs a regular update and write the first applied patch to the branch cache. One solution is to set a context variable _committingpatch on the mqrepo while it is committing a patch and to take it in account when deciding to fast-path mqrepo._branchtags(). Not really elegant but it works. The changes to test-mq-caches.t reverse changes introduced by a5917346c72e. The cache should not have been updated with mq records. The changes to test-keyword.t are indirectly caused by a5917346c72e. Reported and analyzed by Yuya Nishihara <yuya@tcha.org> Notes: - qpush still makes a slow path _branchtags() call when checking heads. Maybe this can be optimized. - be careful when merging this patch in default as secretcommit() was renamed newcommit() right after the end of the code freeze.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11803
b90199179eb5 unify test-commit-copy
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 3853
diff changeset
     1
  $ hg init dir
b90199179eb5 unify test-commit-copy
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 3853
diff changeset
     2
  $ cd dir
b90199179eb5 unify test-commit-copy
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 3853
diff changeset
     3
  $ echo bleh > bar
b90199179eb5 unify test-commit-copy
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 3853
diff changeset
     4
  $ hg add bar
b90199179eb5 unify test-commit-copy
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 3853
diff changeset
     5
  $ hg ci -m 'add bar'
3675
6990e499d71a Revert almost all of 5be434785317; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     6
11803
b90199179eb5 unify test-commit-copy
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 3853
diff changeset
     7
  $ hg cp bar foo
b90199179eb5 unify test-commit-copy
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 3853
diff changeset
     8
  $ echo >> bar
b90199179eb5 unify test-commit-copy
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 3853
diff changeset
     9
  $ hg ci -m 'cp bar foo; change bar'
3675
6990e499d71a Revert almost all of 5be434785317; add a test
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    10
11803
b90199179eb5 unify test-commit-copy
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 3853
diff changeset
    11
  $ hg debugrename foo
b90199179eb5 unify test-commit-copy
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 3853
diff changeset
    12
  foo renamed from bar:26d3ca0dfd18e44d796b564e38dd173c9668d3a9
14182
ec5886db9dc6 tests: fix deprecated use of hg debugdata/debugindex
Sune Foldager <cryo@cyanite.org>
parents: 11803
diff changeset
    13
  $ hg debugindex bar
11803
b90199179eb5 unify test-commit-copy
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 3853
diff changeset
    14
     rev    offset  length   base linkrev nodeid       p1           p2
b90199179eb5 unify test-commit-copy
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 3853
diff changeset
    15
       0         0       6      0       0 26d3ca0dfd18 000000000000 000000000000
b90199179eb5 unify test-commit-copy
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 3853
diff changeset
    16
       1         6       7      1       1 d267bddd54f7 26d3ca0dfd18 000000000000