annotate tests/test-commit-copy.t @ 16458:55982f62651f

commit: add option to amend the working dir parent The --amend flag can be used to amend the parent of the working directory with a new commit that contains the changes in the parent in addition to those currently reported by "hg status", if there are any. The old commit is stored in a backup bundle in ".hg/strip-backup"(see "hg help bundle" and "hg help unbundle" on how to restore it). Message, user and date are taken from the amended commit unless specified. When a message isn't specified on the command line, the editor will open with the message of the amended commit. It is not possible to amend public changesets (see "hg help phases") or changesets that have children. Behind the scenes, first commit the update (if there is one) as a regular child of the current parent. Then create a new commit on the parent's parent with the updated contents. Then change the working copy parent to this new combined changeset. Finally, strip the amended commit and update commit created in the beginning. An alternative (cleaner?) approach of doing this is suggested here: http://selenic.com/pipermail/mercurial-devel/2012-March/038540.html It is currently not possible to amend merge commits or recursively, this can be added at a later time.
author Idan Kamara <idankk86@gmail.com>
date Wed, 18 Apr 2012 01:20:16 +0300
parents ec5886db9dc6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
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