2012-10-31 04:03:26 +04:00
|
|
|
Load commonly used test logic
|
2018-01-09 17:08:01 +03:00
|
|
|
$ . "$TESTDIR/hggit/testutil"
|
2012-10-31 04:03:26 +04:00
|
|
|
|
2021-03-23 12:22:56 +03:00
|
|
|
$ git init -q gitrepo
|
2012-10-31 08:01:03 +04:00
|
|
|
$ cd gitrepo
|
2012-09-10 08:26:58 +04:00
|
|
|
$ echo alpha > alpha
|
|
|
|
$ git add alpha
|
2012-10-31 06:59:20 +04:00
|
|
|
$ fn_git_commit -m 'add alpha'
|
2012-09-10 08:26:58 +04:00
|
|
|
$ echo beta > beta
|
|
|
|
$ git add beta
|
2012-10-31 06:59:20 +04:00
|
|
|
$ fn_git_commit -m 'add beta'
|
2012-09-10 08:26:58 +04:00
|
|
|
$ mkdir foo
|
|
|
|
$ echo blah > foo/bar
|
|
|
|
$ git add foo
|
2012-10-31 06:59:20 +04:00
|
|
|
$ fn_git_commit -m 'add foo'
|
2012-09-10 08:26:58 +04:00
|
|
|
$ git rm alpha
|
|
|
|
rm 'alpha'
|
2012-10-31 06:59:20 +04:00
|
|
|
$ fn_git_commit -m 'remove alpha'
|
2012-09-10 08:26:58 +04:00
|
|
|
$ git rm foo/bar
|
|
|
|
rm 'foo/bar'
|
2012-10-31 06:59:20 +04:00
|
|
|
$ fn_git_commit -m 'remove foo/bar'
|
2014-12-30 23:26:10 +03:00
|
|
|
$ ln -s beta betalink
|
|
|
|
$ git add betalink
|
|
|
|
$ fn_git_commit -m 'add symlink to beta'
|
|
|
|
replace symlink with file
|
|
|
|
$ rm betalink
|
|
|
|
$ echo betalink > betalink
|
|
|
|
$ git add betalink
|
|
|
|
$ fn_git_commit -m 'replace symlink with file'
|
|
|
|
replace file with symlink
|
|
|
|
$ rm betalink
|
|
|
|
$ ln -s beta betalink
|
|
|
|
$ git add betalink
|
|
|
|
$ fn_git_commit -m 'replace file with symlink'
|
|
|
|
$ git rm betalink
|
|
|
|
rm 'betalink'
|
|
|
|
$ fn_git_commit -m 'remove betalink'
|
2012-11-04 03:14:17 +04:00
|
|
|
final manifest in git is just beta
|
2012-09-10 08:26:58 +04:00
|
|
|
$ git ls-files
|
|
|
|
beta
|
2014-12-30 23:26:10 +03:00
|
|
|
$ git log --pretty=medium
|
|
|
|
commit 5ee11eeae239d6a99df5a99901ec00ffafbcc46b
|
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:18 2007 +0000
|
|
|
|
|
|
|
|
remove betalink
|
|
|
|
|
|
|
|
commit 2c7b324faeccb1acf89c35b7ad38e7956f5705fa
|
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:17 2007 +0000
|
|
|
|
|
|
|
|
replace file with symlink
|
|
|
|
|
|
|
|
commit ff0478d2ecc2571d01eb6d406ac29e4e63e5d3d5
|
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:16 2007 +0000
|
|
|
|
|
|
|
|
replace symlink with file
|
|
|
|
|
|
|
|
commit 5492e6e410e42df527956be945286cd1ae45acb8
|
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:15 2007 +0000
|
|
|
|
|
|
|
|
add symlink to beta
|
|
|
|
|
|
|
|
commit b991de8952c482a7cd51162674ffff8474862218
|
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:14 2007 +0000
|
|
|
|
|
|
|
|
remove foo/bar
|
|
|
|
|
|
|
|
commit b0edaf0adac19392cf2867498b983bc5192b41dd
|
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:13 2007 +0000
|
|
|
|
|
|
|
|
remove alpha
|
|
|
|
|
|
|
|
commit f2d0d5bfa905e12dee728b509b96cf265bb6ee43
|
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:12 2007 +0000
|
|
|
|
|
|
|
|
add foo
|
|
|
|
|
|
|
|
commit 9497a4ee62e16ee641860d7677cdb2589ea15554
|
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:11 2007 +0000
|
|
|
|
|
|
|
|
add beta
|
|
|
|
|
|
|
|
commit 7eeab2ea75ec1ac0ff3d500b5b6f8a3447dd7c03
|
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:10 2007 +0000
|
|
|
|
|
|
|
|
add alpha
|
2012-09-10 08:26:58 +04:00
|
|
|
|
|
|
|
$ cd ..
|
2021-03-23 12:22:56 +03:00
|
|
|
$ git init -q --bare gitrepo2
|
2012-09-10 08:26:58 +04:00
|
|
|
|
2012-09-14 04:49:45 +04:00
|
|
|
$ hg clone gitrepo hgrepo | grep -v '^updating'
|
2012-09-10 08:26:58 +04:00
|
|
|
importing git objects into hg
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ cd hgrepo
|
2015-03-12 20:29:58 +03:00
|
|
|
$ hg log --graph
|
2020-07-21 03:23:52 +03:00
|
|
|
@ commit: 378e6ad159a5
|
2020-10-20 03:05:23 +03:00
|
|
|
│ bookmark: master
|
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:18 2007 +0000
|
|
|
|
│ summary: remove betalink
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: cdab01d82d2c
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:17 2007 +0000
|
|
|
|
│ summary: replace file with symlink
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: 6489fe6b5d5d
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:16 2007 +0000
|
|
|
|
│ summary: replace symlink with file
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: 8b6301fee25f
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:15 2007 +0000
|
|
|
|
│ summary: add symlink to beta
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: c1cc4c542dff
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:14 2007 +0000
|
|
|
|
│ summary: remove foo/bar
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: ac85e2bfa8ee
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:13 2007 +0000
|
|
|
|
│ summary: remove alpha
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: 02c84a0b42d8
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:12 2007 +0000
|
|
|
|
│ summary: add foo
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: 3bb02b6794dd
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:11 2007 +0000
|
|
|
|
│ summary: add beta
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: 69982ec78c6d
|
2012-09-10 08:26:58 +04:00
|
|
|
user: test <test@example.org>
|
|
|
|
date: Mon Jan 01 00:00:10 2007 +0000
|
|
|
|
summary: add alpha
|
|
|
|
|
|
|
|
|
2012-11-04 03:14:17 +04:00
|
|
|
make sure alpha is not in this manifest
|
2020-10-08 21:06:31 +03:00
|
|
|
$ hg manifest -r ac85e2bfa8eee8aa65b7a49f11ab1a8d917558a7
|
2012-09-10 08:26:58 +04:00
|
|
|
beta
|
|
|
|
foo/bar
|
|
|
|
|
2012-11-04 03:14:17 +04:00
|
|
|
make sure that only beta is in the manifest
|
2012-09-10 08:26:58 +04:00
|
|
|
$ hg manifest
|
|
|
|
beta
|
|
|
|
|
|
|
|
$ hg gclear
|
|
|
|
clearing out the git cache data
|
2012-09-14 04:49:45 +04:00
|
|
|
$ hg push ../gitrepo2
|
|
|
|
pushing to ../gitrepo2
|
2012-10-08 04:11:27 +04:00
|
|
|
searching for changes
|
2013-01-06 10:46:57 +04:00
|
|
|
adding objects
|
2014-12-30 23:26:10 +03:00
|
|
|
added 9 commits with 8 trees and 5 blobs
|
2012-09-10 08:26:58 +04:00
|
|
|
|
2012-11-04 03:12:08 +04:00
|
|
|
$ cd ..
|
|
|
|
$ git --git-dir=gitrepo2 log --pretty=medium
|
2018-12-06 23:00:57 +03:00
|
|
|
commit 68c7019f1bfb2828f7f9200fac967921f06a1feb
|
2014-12-30 23:26:10 +03:00
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:18 2007 +0000
|
|
|
|
|
|
|
|
remove betalink
|
|
|
|
|
2018-12-06 23:00:57 +03:00
|
|
|
commit d59a3b386d681c94e5e79793b06c7333f221c443
|
2014-12-30 23:26:10 +03:00
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:17 2007 +0000
|
|
|
|
|
|
|
|
replace file with symlink
|
|
|
|
|
2018-12-06 23:00:57 +03:00
|
|
|
commit 9c7cc15377285c52231e122d00f0e134b352b0e6
|
2014-12-30 23:26:10 +03:00
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:16 2007 +0000
|
|
|
|
|
|
|
|
replace symlink with file
|
|
|
|
|
2018-12-06 23:00:57 +03:00
|
|
|
commit 03a89ec31682f257e820b4693e3f1b402f8c9d05
|
2014-12-30 23:26:10 +03:00
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:15 2007 +0000
|
|
|
|
|
|
|
|
add symlink to beta
|
|
|
|
|
2018-12-06 23:00:57 +03:00
|
|
|
commit e2d4ee11209b5ad206ceffb9ce31eb076b25f52e
|
2012-09-10 08:26:58 +04:00
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:14 2007 +0000
|
|
|
|
|
|
|
|
remove foo/bar
|
|
|
|
|
2018-12-06 23:00:57 +03:00
|
|
|
commit db5085c1477a08eb9735c425f9a605f919b6d3cd
|
2012-09-10 08:26:58 +04:00
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:13 2007 +0000
|
|
|
|
|
|
|
|
remove alpha
|
|
|
|
|
2018-12-06 23:00:57 +03:00
|
|
|
commit d5e6a099c8c0f2d8a407e1f1d86367b58526c2df
|
2012-09-10 08:26:58 +04:00
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:12 2007 +0000
|
|
|
|
|
|
|
|
add foo
|
|
|
|
|
2018-12-06 23:00:57 +03:00
|
|
|
commit dbed4f6a8ff04d4d1f0a5ce79f9a07cf0f461d7f
|
2012-09-10 08:26:58 +04:00
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:11 2007 +0000
|
|
|
|
|
|
|
|
add beta
|
|
|
|
|
2018-12-06 23:00:57 +03:00
|
|
|
commit 205598a42833e532ad20d80414b8e3b85a65936e
|
2012-09-10 08:26:58 +04:00
|
|
|
Author: test <test@example.org>
|
|
|
|
Date: Mon Jan 1 00:00:10 2007 +0000
|
|
|
|
|
|
|
|
add alpha
|
2014-12-31 00:25:55 +03:00
|
|
|
|
|
|
|
test with rename detection enabled
|
|
|
|
$ hg --config git.similarity=100 clone gitrepo hgreporenames | grep -v '^updating'
|
|
|
|
importing git objects into hg
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ cd hgreporenames
|
2015-03-12 20:29:58 +03:00
|
|
|
$ hg log --graph
|
2020-07-21 03:23:52 +03:00
|
|
|
@ commit: 378e6ad159a5
|
2020-10-20 03:05:23 +03:00
|
|
|
│ bookmark: master
|
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:18 2007 +0000
|
|
|
|
│ summary: remove betalink
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: cdab01d82d2c
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:17 2007 +0000
|
|
|
|
│ summary: replace file with symlink
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: 6489fe6b5d5d
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:16 2007 +0000
|
|
|
|
│ summary: replace symlink with file
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: 8b6301fee25f
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:15 2007 +0000
|
|
|
|
│ summary: add symlink to beta
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: c1cc4c542dff
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:14 2007 +0000
|
|
|
|
│ summary: remove foo/bar
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: ac85e2bfa8ee
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:13 2007 +0000
|
|
|
|
│ summary: remove alpha
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: 02c84a0b42d8
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:12 2007 +0000
|
|
|
|
│ summary: add foo
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: 3bb02b6794dd
|
2020-10-20 03:05:23 +03:00
|
|
|
│ user: test <test@example.org>
|
|
|
|
│ date: Mon Jan 01 00:00:11 2007 +0000
|
|
|
|
│ summary: add beta
|
|
|
|
│
|
2020-07-21 03:23:52 +03:00
|
|
|
o commit: 69982ec78c6d
|
2014-12-31 00:25:55 +03:00
|
|
|
user: test <test@example.org>
|
|
|
|
date: Mon Jan 01 00:00:10 2007 +0000
|
|
|
|
summary: add alpha
|
|
|
|
|