comparison tests/test-import.t @ 930:cac35bef8aee stable

import: --obsolete flag for automatic obsolescence marker creation A new `--obsolete` flag is added to import. When present, the new node will be marked as a successors of the one specified in the `Node` field of the imported patch. No marker are created when revision have the node expected in the patch. This improves email based work flow where implicit rebase are likely to happen and extra information are lost, changing the hash. This new behavior requires a flags, otherwise the `hg export x | hg import -` idiom would change, turning the source obsolete. (Changing from `hg graft x` to `hg rebase --dest . --rev x`) This change only takes effect when using Mercurial 3.0 and above
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 09 May 2014 03:06:36 -0700
parents
children e3f7258d05d5
comparison
equal deleted inserted replaced
929:306f67906a6c 930:cac35bef8aee
1
2 This feature requires mercurial 3.0
3 (and the `only(` revset is 3.0 specific)
4
5 $ (hg help revset | grep ' only(') || exit 80
6
7 Test creation of obsolescence marker by path import
8
9 $ hg init auto-obsolete
10 $ cd auto-obsolete
11 $ echo '[extensions]' >> $HGRCPATH
12 $ echo 'rebase=' >> $HGRCPATH
13 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
14 $ echo A > a
15 $ hg commit -Am A
16 adding a
17 $ echo B > b
18 $ hg commit -Am B
19 adding b
20 $ hg up '.^'
21 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
22 $ echo C > c
23 $ hg commit -Am C
24 adding c
25 created new head
26 $ hg log -G
27 @ changeset: 2:eb8dd0f31b51
28 | tag: tip
29 | parent: 0:f2bbf19cf96d
30 | user: test
31 | date: Thu Jan 01 00:00:00 1970 +0000
32 | summary: C
33 |
34 | o changeset: 1:95b760afef3c
35 |/ user: test
36 | date: Thu Jan 01 00:00:00 1970 +0000
37 | summary: B
38 |
39 o changeset: 0:f2bbf19cf96d
40 user: test
41 date: Thu Jan 01 00:00:00 1970 +0000
42 summary: A
43
44
45 (actual test)
46
47 $ hg export 'desc(B)' | hg import - --obsolete
48 applying patch from stdin
49 $ hg log -G
50 @ changeset: 3:00c49133f17e
51 | tag: tip
52 | user: test
53 | date: Thu Jan 01 00:00:00 1970 +0000
54 | summary: B
55 |
56 o changeset: 2:eb8dd0f31b51
57 | parent: 0:f2bbf19cf96d
58 | user: test
59 | date: Thu Jan 01 00:00:00 1970 +0000
60 | summary: C
61 |
62 o changeset: 0:f2bbf19cf96d
63 user: test
64 date: Thu Jan 01 00:00:00 1970 +0000
65 summary: A
66
67 $ hg debugobsolete
68 95b760afef3c234ffb3f9fd391edcb36e60921a4 00c49133f17e5e5a52b6ef1b6d516c0e90b56d8a 0 {'date': '* *', 'user': 'test'} (glob)
69
70 $ hg rollback
71 repository tip rolled back to revision 2 (undo import)
72 working directory now based on revision 2
73 $ hg log -G
74 @ changeset: 2:eb8dd0f31b51
75 | tag: tip
76 | parent: 0:f2bbf19cf96d
77 | user: test
78 | date: Thu Jan 01 00:00:00 1970 +0000
79 | summary: C
80 |
81 | o changeset: 1:95b760afef3c
82 |/ user: test
83 | date: Thu Jan 01 00:00:00 1970 +0000
84 | summary: B
85 |
86 o changeset: 0:f2bbf19cf96d
87 user: test
88 date: Thu Jan 01 00:00:00 1970 +0000
89 summary: A
90
91 $ hg debugobsolete
92