Mercurial > hg-stable
comparison tests/test-import-merge.t @ 22250:f3200bf460a8
import: change "editform" to distinguish merge commits from others
"editform" argument for "getcommiteditor" is decided according to the
format below:
COMMAND[.ROUTE]
- COMMAND: name of command
- ROUTE: name of route, if there are two or more routes in COMMAND
This patch uses "normal.normal" and "normal.merge" as ROUTE of
"editform" instead of "normal", to distinguish merge commits from
other in "hg import" without "--bypass" case.
This patch assumes "editform" variations for "hg import" below:
import.normal.normal
import.normal.merge
import.bypass.normal
import.bypass.merge
Unlike other patches in this series, this patch uses "editor.sh"
instead of "checkeditform.sh" for the name of the script to check
"HGEDITFORM", because it has to do more than checking "HGEDITFORM".
To invoke editor forcibly in "test-import-merge.t", this patch creates
the patch not having patch description as "merge.nomsg.diff".
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 16 Aug 2014 10:43:59 +0900 |
parents | 3a3731a60354 |
children | bdc0e04df243 |
comparison
equal
deleted
inserted
replaced
22249:f5ff18f65b73 | 22250:f3200bf460a8 |
---|---|
28 $ hg merge 3 | 28 $ hg merge 3 |
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
30 (branch merge, don't forget to commit) | 30 (branch merge, don't forget to commit) |
31 $ hg ci -m merge | 31 $ hg ci -m merge |
32 $ hg export . > ../merge.diff | 32 $ hg export . > ../merge.diff |
33 $ grep -v '^merge$' ../merge.diff > ../merge.nomsg.diff | |
33 $ cd .. | 34 $ cd .. |
34 $ hg clone -r2 repo repo2 | 35 $ hg clone -r2 repo repo2 |
35 adding changesets | 36 adding changesets |
36 adding manifests | 37 adding manifests |
37 adding file changes | 38 adding file changes |
50 | 51 |
51 Test without --exact and diff.p1 == workingdir.p1 | 52 Test without --exact and diff.p1 == workingdir.p1 |
52 | 53 |
53 $ hg up 1 | 54 $ hg up 1 |
54 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 55 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
55 $ hg import ../merge.diff | 56 $ cat > $TESTTMP/editor.sh <<EOF |
56 applying ../merge.diff | 57 > env | grep HGEDITFORM |
58 > echo merge > \$1 | |
59 > EOF | |
60 $ HGEDITOR="sh $TESTTMP/editor.sh" hg import --edit ../merge.nomsg.diff | |
61 applying ../merge.nomsg.diff | |
62 HGEDITFORM=import.normal.merge | |
57 $ tipparents | 63 $ tipparents |
58 1:540395c44225 changea | 64 1:540395c44225 changea |
59 3:102a90ea7b4a addb | 65 3:102a90ea7b4a addb |
60 $ hg strip --no-backup tip | 66 $ hg strip --no-backup tip |
61 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 67 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |