2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2020-01-20 13:42:49 +03:00
|
|
|
$ disable treemanifest
|
2010-09-02 16:58:47 +04:00
|
|
|
|
2020-01-20 13:42:49 +03:00
|
|
|
$ enable convert
|
|
|
|
$ setconfig convert.hg.saverev=yes
|
2010-09-02 16:58:47 +04:00
|
|
|
|
|
|
|
$ glog()
|
|
|
|
> {
|
2020-10-08 06:58:22 +03:00
|
|
|
> hg -R "$1" log -G --template '"{desc}" files: {files}\n'
|
2010-09-02 16:58:47 +04:00
|
|
|
> }
|
|
|
|
|
|
|
|
$ hg init source
|
|
|
|
$ cd source
|
|
|
|
|
|
|
|
$ echo a > a
|
|
|
|
$ echo b > b
|
2013-07-19 03:18:15 +04:00
|
|
|
$ echo f > f
|
|
|
|
$ hg ci -d '0 0' -qAm '0: add a b f'
|
2010-09-02 16:58:47 +04:00
|
|
|
$ echo c > c
|
2013-07-19 03:18:15 +04:00
|
|
|
$ hg move f d
|
|
|
|
$ hg ci -d '1 0' -qAm '1: add c, move f to d'
|
2010-09-02 16:58:47 +04:00
|
|
|
$ hg copy a e
|
|
|
|
$ echo b >> b
|
|
|
|
$ hg ci -d '2 0' -qAm '2: copy e from a, change b'
|
|
|
|
$ hg up -C 0
|
2013-07-19 03:18:15 +04:00
|
|
|
2 files updated, 0 files merged, 3 files removed, 0 files unresolved
|
2010-09-02 16:58:47 +04:00
|
|
|
$ echo a >> a
|
|
|
|
$ hg ci -d '3 0' -qAm '3: change a'
|
|
|
|
$ hg merge
|
|
|
|
merging a and e to e
|
2013-07-19 03:18:15 +04:00
|
|
|
3 files updated, 1 files merged, 1 files removed, 0 files unresolved
|
2010-09-02 16:58:47 +04:00
|
|
|
(branch merge, don't forget to commit)
|
2013-07-19 03:18:15 +04:00
|
|
|
$ hg ci -d '4 0' -qAm '4: merge 2 and 3'
|
2010-09-02 16:58:47 +04:00
|
|
|
$ echo a >> a
|
|
|
|
$ hg ci -d '5 0' -qAm '5: change a'
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Convert from null revision
|
|
|
|
|
2010-11-07 12:23:48 +03:00
|
|
|
$ hg convert --config convert.hg.startrev=null source full
|
|
|
|
initializing destination full repository
|
2010-09-02 16:58:47 +04:00
|
|
|
scanning source...
|
|
|
|
sorting...
|
|
|
|
converting...
|
2013-07-19 03:18:15 +04:00
|
|
|
5 0: add a b f
|
|
|
|
4 1: add c, move f to d
|
2010-11-07 12:23:48 +03:00
|
|
|
3 2: copy e from a, change b
|
|
|
|
2 3: change a
|
2013-07-19 03:18:15 +04:00
|
|
|
1 4: merge 2 and 3
|
2010-11-07 12:23:48 +03:00
|
|
|
0 5: change a
|
2010-09-02 16:58:47 +04:00
|
|
|
|
2010-11-07 12:23:48 +03:00
|
|
|
$ glog full
|
2020-10-08 06:58:22 +03:00
|
|
|
o "5: change a" files: a
|
2010-11-07 12:23:48 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o "4: merge 2 and 3" files: e f
|
2010-11-07 12:23:48 +03:00
|
|
|
|\
|
2020-10-08 06:58:22 +03:00
|
|
|
| o "3: change a" files: a
|
2010-11-07 12:23:48 +03:00
|
|
|
| |
|
2020-10-08 06:58:22 +03:00
|
|
|
o | "2: copy e from a, change b" files: b e
|
2010-11-07 12:23:48 +03:00
|
|
|
| |
|
2020-10-08 06:58:22 +03:00
|
|
|
o | "1: add c, move f to d" files: c d f
|
2010-11-07 12:23:48 +03:00
|
|
|
|/
|
2020-10-08 06:58:22 +03:00
|
|
|
o "0: add a b f" files: a b f
|
2010-11-07 12:23:48 +03:00
|
|
|
|
|
|
|
$ rm -Rf full
|
2010-09-02 16:58:47 +04:00
|
|
|
|
|
|
|
Convert from zero revision
|
|
|
|
|
|
|
|
$ hg convert --config convert.hg.startrev=0 source full
|
|
|
|
initializing destination full repository
|
|
|
|
scanning source...
|
|
|
|
sorting...
|
|
|
|
converting...
|
2013-07-19 03:18:15 +04:00
|
|
|
5 0: add a b f
|
|
|
|
4 1: add c, move f to d
|
2010-09-02 16:58:47 +04:00
|
|
|
3 2: copy e from a, change b
|
|
|
|
2 3: change a
|
2013-07-19 03:18:15 +04:00
|
|
|
1 4: merge 2 and 3
|
2010-09-02 16:58:47 +04:00
|
|
|
0 5: change a
|
|
|
|
|
|
|
|
$ glog full
|
2020-10-08 06:58:22 +03:00
|
|
|
o "5: change a" files: a
|
2010-09-02 16:58:47 +04:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o "4: merge 2 and 3" files: e f
|
2010-09-02 16:58:47 +04:00
|
|
|
|\
|
2020-10-08 06:58:22 +03:00
|
|
|
| o "3: change a" files: a
|
2010-09-02 16:58:47 +04:00
|
|
|
| |
|
2020-10-08 06:58:22 +03:00
|
|
|
o | "2: copy e from a, change b" files: b e
|
2010-09-02 16:58:47 +04:00
|
|
|
| |
|
2020-10-08 06:58:22 +03:00
|
|
|
o | "1: add c, move f to d" files: c d f
|
2010-09-02 16:58:47 +04:00
|
|
|
|/
|
2020-10-08 06:58:22 +03:00
|
|
|
o "0: add a b f" files: a b f
|
2010-09-02 16:58:47 +04:00
|
|
|
|
|
|
|
Convert from merge parent
|
|
|
|
|
|
|
|
$ hg convert --config convert.hg.startrev=1 source conv1
|
|
|
|
initializing destination conv1 repository
|
|
|
|
scanning source...
|
|
|
|
sorting...
|
|
|
|
converting...
|
2013-07-19 03:18:15 +04:00
|
|
|
3 1: add c, move f to d
|
2010-09-02 16:58:47 +04:00
|
|
|
2 2: copy e from a, change b
|
2013-07-19 03:18:15 +04:00
|
|
|
1 4: merge 2 and 3
|
2010-09-02 16:58:47 +04:00
|
|
|
0 5: change a
|
|
|
|
|
|
|
|
$ glog conv1
|
2020-10-08 06:58:22 +03:00
|
|
|
o "5: change a" files: a
|
2010-09-02 16:58:47 +04:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o "4: merge 2 and 3" files: a e
|
2010-09-02 16:58:47 +04:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o "2: copy e from a, change b" files: b e
|
2010-09-02 16:58:47 +04:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o "1: add c, move f to d" files: a b c d
|
2010-09-02 16:58:47 +04:00
|
|
|
|
|
|
|
$ cd conv1
|
2012-02-24 23:57:59 +04:00
|
|
|
$ hg up -q
|
2010-09-02 16:58:47 +04:00
|
|
|
|
|
|
|
Check copy preservation
|
|
|
|
|
2013-07-19 03:40:57 +04:00
|
|
|
$ hg st -C --change 2 e
|
|
|
|
M e
|
|
|
|
$ hg st -C --change 1 e
|
|
|
|
A e
|
|
|
|
a
|
|
|
|
$ hg st -C --change 0 a
|
|
|
|
A a
|
|
|
|
|
|
|
|
(It seems like a bug in log that the following doesn't show rev 1.)
|
|
|
|
|
2010-09-02 16:58:47 +04:00
|
|
|
$ hg log --follow --copies e
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 82bbac3d2cf4
|
2010-09-02 16:58:47 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:04 1970 +0000
|
2013-07-19 03:18:15 +04:00
|
|
|
summary: 4: merge 2 and 3
|
2010-09-02 16:58:47 +04:00
|
|
|
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 23c3be426dce
|
2010-09-02 16:58:47 +04:00
|
|
|
user: test
|
2013-07-19 03:40:57 +04:00
|
|
|
date: Thu Jan 01 00:00:01 1970 +0000
|
|
|
|
summary: 1: add c, move f to d
|
2010-09-02 16:58:47 +04:00
|
|
|
|
|
|
|
Check copy removal on missing parent
|
|
|
|
|
|
|
|
$ hg log --follow --copies d
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 23c3be426dce
|
2010-09-02 16:58:47 +04:00
|
|
|
user: test
|
2013-07-19 03:18:15 +04:00
|
|
|
date: Thu Jan 01 00:00:01 1970 +0000
|
|
|
|
summary: 1: add c, move f to d
|
2010-09-02 16:58:47 +04:00
|
|
|
|
|
|
|
$ hg cat -r tip a b
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
b
|
|
|
|
b
|
|
|
|
$ hg -q verify
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Convert from merge
|
|
|
|
|
|
|
|
$ hg convert --config convert.hg.startrev=4 source conv4
|
|
|
|
initializing destination conv4 repository
|
|
|
|
scanning source...
|
|
|
|
sorting...
|
|
|
|
converting...
|
2013-07-19 03:18:15 +04:00
|
|
|
1 4: merge 2 and 3
|
2010-09-02 16:58:47 +04:00
|
|
|
0 5: change a
|
|
|
|
$ glog conv4
|
2020-10-08 06:58:22 +03:00
|
|
|
o "5: change a" files: a
|
2010-09-02 16:58:47 +04:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o "4: merge 2 and 3" files: a b c d e
|
2010-09-02 16:58:47 +04:00
|
|
|
|
|
|
|
$ cd conv4
|
|
|
|
$ hg up -C
|
|
|
|
5 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg cat -r tip a b
|
|
|
|
a
|
|
|
|
a
|
|
|
|
a
|
|
|
|
b
|
|
|
|
b
|
|
|
|
$ hg -q verify
|
|
|
|
$ cd ..
|
2013-07-20 02:43:08 +04:00
|
|
|
|
|
|
|
Convert from revset in convert.hg.revs
|
|
|
|
|
|
|
|
$ hg convert --config convert.hg.revs='3:4+0' source revsetrepo
|
|
|
|
initializing destination revsetrepo repository
|
|
|
|
scanning source...
|
|
|
|
sorting...
|
|
|
|
converting...
|
|
|
|
2 0: add a b f
|
|
|
|
1 3: change a
|
|
|
|
0 4: merge 2 and 3
|
|
|
|
|
|
|
|
$ glog revsetrepo
|
2020-10-08 06:58:22 +03:00
|
|
|
o "4: merge 2 and 3" files: b c d e f
|
2013-07-20 02:43:08 +04:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o "3: change a" files: a
|
2013-07-20 02:43:08 +04:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o "0: add a b f" files: a b f
|
2013-07-20 02:43:08 +04:00
|
|
|
|
2015-09-03 20:29:42 +03:00
|
|
|
Convert from specified revs
|
|
|
|
|
|
|
|
$ hg convert --rev 3 --rev 2 source multiplerevs
|
|
|
|
initializing destination multiplerevs repository
|
|
|
|
scanning source...
|
|
|
|
sorting...
|
|
|
|
converting...
|
|
|
|
3 0: add a b f
|
|
|
|
2 1: add c, move f to d
|
|
|
|
1 2: copy e from a, change b
|
|
|
|
0 3: change a
|
|
|
|
$ glog multiplerevs
|
2020-10-08 06:58:22 +03:00
|
|
|
o "3: change a" files: a
|
2015-09-03 20:29:42 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
| o "2: copy e from a, change b" files: b e
|
2015-09-03 20:29:42 +03:00
|
|
|
| |
|
2020-10-08 06:58:22 +03:00
|
|
|
| o "1: add c, move f to d" files: c d f
|
2015-09-03 20:29:42 +03:00
|
|
|
|/
|
2020-10-08 06:58:22 +03:00
|
|
|
o "0: add a b f" files: a b f
|
2015-09-03 20:29:42 +03:00
|
|
|
|
2016-03-25 02:01:07 +03:00
|
|
|
Convert in multiple steps that doesn't overlap - the link to the parent is
|
2016-04-13 01:16:21 +03:00
|
|
|
preserved anyway
|
2016-03-25 02:01:07 +03:00
|
|
|
|
|
|
|
$ hg convert --config convert.hg.revs=::1 source multistep
|
|
|
|
initializing destination multistep repository
|
|
|
|
scanning source...
|
|
|
|
sorting...
|
|
|
|
converting...
|
|
|
|
1 0: add a b f
|
|
|
|
0 1: add c, move f to d
|
|
|
|
$ hg convert --config convert.hg.revs=2 source multistep
|
|
|
|
scanning source...
|
|
|
|
sorting...
|
|
|
|
converting...
|
|
|
|
0 2: copy e from a, change b
|
|
|
|
$ glog multistep
|
2020-10-08 06:58:22 +03:00
|
|
|
o "2: copy e from a, change b" files: b e
|
2016-04-13 01:16:21 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o "1: add c, move f to d" files: c d f
|
2016-03-25 02:01:07 +03:00
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
o "0: add a b f" files: a b f
|
2016-03-25 02:01:07 +03:00
|
|
|
|