2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2020-01-20 13:42:49 +03:00
|
|
|
$ disable treemanifest
|
2010-09-18 02:03:08 +04:00
|
|
|
Test basic functionality of url#rev syntax
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
$ hg init repo
|
|
|
|
$ cd repo
|
|
|
|
$ echo a > a
|
|
|
|
$ hg ci -qAm 'add a'
|
|
|
|
$ echo >> a
|
|
|
|
$ hg ci -m 'change a'
|
2019-02-13 08:39:22 +03:00
|
|
|
$ hg bookmark foo
|
2010-09-14 18:42:02 +04:00
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ hg clone 'repo#foo' clone
|
2019-02-13 08:39:22 +03:00
|
|
|
updating to branch default
|
2010-09-14 18:42:02 +04:00
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ hg --cwd clone heads
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 17d330177ee9
|
2019-02-13 08:39:22 +03:00
|
|
|
bookmark: foo
|
2010-09-14 18:42:02 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: change a
|
|
|
|
|
|
|
|
$ hg --cwd clone parents
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 17d330177ee9
|
2019-02-13 08:39:22 +03:00
|
|
|
bookmark: foo
|
2010-09-14 18:42:02 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: change a
|
|
|
|
|
|
|
|
$ cat clone/.hg/hgrc
|
2016-09-21 02:49:00 +03:00
|
|
|
# example repository config (see 'hg help config' for more info)
|
2010-09-14 18:42:02 +04:00
|
|
|
[paths]
|
2017-12-11 06:50:57 +03:00
|
|
|
default = $TESTTMP/repo#foo
|
2014-10-07 00:35:02 +04:00
|
|
|
|
|
|
|
# path aliases to other clones of this repo in URLs or filesystem paths
|
2016-09-21 02:49:00 +03:00
|
|
|
# (see 'hg help config.paths' for more info)
|
2014-10-07 00:35:02 +04:00
|
|
|
#
|
2017-02-25 14:27:21 +03:00
|
|
|
# default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork
|
|
|
|
# my-fork = ssh://jdoe@example.net/hg/jdoes-fork
|
|
|
|
# my-clone = /home/jdoe/jdoes-clone
|
2014-10-07 00:35:02 +04:00
|
|
|
|
|
|
|
[ui]
|
|
|
|
# name and email (local to this repository, optional), e.g.
|
|
|
|
# username = Jane Doe <jdoe@example.com>
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
Changing original repo:
|
|
|
|
|
|
|
|
$ cd repo
|
|
|
|
|
|
|
|
$ echo >> a
|
|
|
|
$ hg ci -m 'new head of branch foo'
|
|
|
|
|
|
|
|
$ hg up -qC default
|
|
|
|
$ echo bar > bar
|
|
|
|
$ hg ci -qAm 'add bar'
|
|
|
|
|
|
|
|
$ hg log
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: ad4513930219
|
2010-09-14 18:42:02 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: add bar
|
|
|
|
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 7d4251d04d20
|
2019-02-13 08:39:22 +03:00
|
|
|
bookmark: foo
|
2010-09-14 18:42:02 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: new head of branch foo
|
|
|
|
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 17d330177ee9
|
2010-09-14 18:42:02 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: change a
|
|
|
|
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 1f0dee641bb7
|
2010-09-14 18:42:02 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: add a
|
|
|
|
|
2013-04-09 18:40:10 +04:00
|
|
|
$ hg -q outgoing '../clone'
|
2020-07-21 03:23:52 +03:00
|
|
|
7d4251d04d20
|
|
|
|
ad4513930219
|
2013-04-09 18:40:10 +04:00
|
|
|
$ hg summary --remote --config paths.default='../clone'
|
2020-10-09 23:50:58 +03:00
|
|
|
parent: ad4513930219
|
2013-04-09 18:40:10 +04:00
|
|
|
add bar
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 4 draft
|
2013-04-09 18:40:10 +04:00
|
|
|
remote: 2 outgoing
|
2010-09-14 18:42:02 +04:00
|
|
|
$ hg -q outgoing '../clone#foo'
|
2020-07-21 03:23:52 +03:00
|
|
|
7d4251d04d20
|
2013-04-09 18:40:10 +04:00
|
|
|
$ hg summary --remote --config paths.default='../clone#foo'
|
2020-10-09 23:50:58 +03:00
|
|
|
parent: ad4513930219
|
2013-04-09 18:40:10 +04:00
|
|
|
add bar
|
|
|
|
commit: (clean)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 4 draft
|
2013-04-09 18:40:10 +04:00
|
|
|
remote: 1 outgoing
|
2010-09-14 18:42:02 +04:00
|
|
|
|
2013-04-09 18:40:11 +04:00
|
|
|
$ hg -q --cwd ../clone incoming '../repo#foo'
|
2020-07-21 03:23:52 +03:00
|
|
|
7d4251d04d20
|
2013-04-09 18:40:11 +04:00
|
|
|
$ hg --cwd ../clone summary --remote --config paths.default='../repo#foo'
|
2020-10-09 23:50:58 +03:00
|
|
|
parent: 17d330177ee9
|
2013-04-09 18:40:11 +04:00
|
|
|
change a
|
2019-02-13 08:39:22 +03:00
|
|
|
bookmarks: foo
|
2013-04-09 18:40:11 +04:00
|
|
|
commit: (clean)
|
2020-07-02 23:11:57 +03:00
|
|
|
phases: 2 draft
|
2013-04-09 18:40:11 +04:00
|
|
|
remote: 1 or more incoming
|
|
|
|
|
2010-09-14 18:42:02 +04:00
|
|
|
$ hg -q push '../clone#foo'
|
|
|
|
|
|
|
|
$ hg --cwd ../clone heads
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 7d4251d04d20
|
2019-02-13 08:39:22 +03:00
|
|
|
bookmark: foo
|
2010-09-14 18:42:02 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: new head of branch foo
|
|
|
|
|
2013-04-09 18:40:11 +04:00
|
|
|
$ hg -q --cwd ../clone incoming '../repo#foo'
|
|
|
|
$ hg --cwd ../clone summary --remote --config paths.default='../repo#foo'
|
2020-10-09 23:50:58 +03:00
|
|
|
parent: 17d330177ee9
|
2013-04-09 18:40:11 +04:00
|
|
|
change a
|
|
|
|
commit: (clean)
|
2020-07-02 23:11:57 +03:00
|
|
|
phases: 3 draft
|
2013-04-09 18:40:11 +04:00
|
|
|
remote: (synced)
|
|
|
|
|
2010-09-14 18:42:02 +04:00
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ cd clone
|
|
|
|
|
|
|
|
$ hg -q incoming
|
|
|
|
|
|
|
|
$ hg -q pull
|
|
|
|
|
|
|
|
$ hg heads
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 7d4251d04d20
|
2019-02-13 08:39:22 +03:00
|
|
|
bookmark: foo
|
2010-09-14 18:42:02 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: new head of branch foo
|
|
|
|
|
|
|
|
Pull should not have updated:
|
|
|
|
|
|
|
|
$ hg parents -q
|
2020-07-21 03:23:52 +03:00
|
|
|
17d330177ee9
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
Going back to the default branch:
|
|
|
|
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg up -C 'desc(add)'
|
2010-09-14 18:42:02 +04:00
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ hg parents
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 1f0dee641bb7
|
2010-09-14 18:42:02 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: add a
|
|
|
|
|
|
|
|
No new revs, no update:
|
|
|
|
|
|
|
|
$ hg pull -qu
|
|
|
|
|
|
|
|
$ hg parents -q
|
2020-07-21 03:23:52 +03:00
|
|
|
1f0dee641bb7
|
2010-09-14 18:42:02 +04:00
|
|
|
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg debugstrip 'desc(change)' --no-backup
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
$ hg parents -q
|
2020-07-21 03:23:52 +03:00
|
|
|
1f0dee641bb7
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
Pull -u takes us back to branch foo:
|
|
|
|
|
|
|
|
$ hg pull -qu
|
|
|
|
|
|
|
|
$ hg parents
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 7d4251d04d20
|
2019-02-13 08:39:22 +03:00
|
|
|
bookmark: foo
|
2010-09-14 18:42:02 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: new head of branch foo
|
|
|
|
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg debugstrip 'desc(new)' --no-backup
|
2020-01-15 08:00:48 +03:00
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2010-09-14 18:42:02 +04:00
|
|
|
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg up -C 'desc(add)'
|
2010-09-14 18:42:02 +04:00
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2020-01-15 08:00:48 +03:00
|
|
|
(leaving bookmark foo)
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
$ hg parents -q
|
2020-07-21 03:23:52 +03:00
|
|
|
1f0dee641bb7
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
$ hg heads -q
|
2020-07-21 03:23:52 +03:00
|
|
|
17d330177ee9
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
$ hg pull -qur default default
|
|
|
|
|
|
|
|
$ hg parents
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: ad4513930219
|
2010-09-14 18:42:02 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: add bar
|
|
|
|
|
|
|
|
$ hg heads
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: ad4513930219
|
2010-09-14 18:42:02 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: add bar
|
|
|
|
|
2011-10-13 06:27:49 +04:00
|
|
|
Test handling of invalid urls
|
2010-09-14 18:42:02 +04:00
|
|
|
|
2011-10-13 06:27:49 +04:00
|
|
|
$ hg id http://foo/?bar
|
|
|
|
abort: unsupported URL component: "bar"
|
|
|
|
[255]
|
2012-06-11 03:40:51 +04:00
|
|
|
|
|
|
|
$ cd ..
|
summary: clear "commonincoming" also if branches are different
Before this patch, "commonincoming" calculated by
"discovery.findcommonincoming()" is cleared, only if "default" URL
without branch part (tail "#branch" of URL) differs from
"default-push" URL without branch part.
But common revisions in "commonincoming" calculated for a branch
doesn't include ones for another branch, even if URLs without branch
part are same. The result of "discovery.findcommonoutgoing()"
invocation with such "commonincoming" becomes incorrect in some cases.
This patch clears "commonincoming", also if branch part of "default"
differs from one of "default-push".
To avoid redundant looking up:
- "ui.expandpath('default')" and "ui.expandpath('default-push',
'default')" are not compared directly, even though they contain
branch information, because they are not yet normalized by
"hg.parseurl()": tail "/" of path, for example
- "commonincoming" is not cleared, if branch isn't specified in
"default" URL, because such "commonincoming" contains common
revisions for all branches
This patch also tests "different path, same branch" pattern to check
careless degrading around comparison between source and destination.
2013-04-09 18:40:11 +04:00
|
|
|
|
|
|
|
Test handling common incoming revisions between "default" and
|
|
|
|
"default-push"
|
|
|
|
|
|
|
|
$ cd repo
|
|
|
|
|
|
|
|
$ hg update -q -C default
|
|
|
|
$ echo modified >> bar
|
|
|
|
$ hg commit -m "new head to push current default head"
|
|
|
|
|
|
|
|
$ hg -q outgoing '../clone'
|
2020-07-21 03:23:52 +03:00
|
|
|
44b4e0c07491
|
summary: clear "commonincoming" also if branches are different
Before this patch, "commonincoming" calculated by
"discovery.findcommonincoming()" is cleared, only if "default" URL
without branch part (tail "#branch" of URL) differs from
"default-push" URL without branch part.
But common revisions in "commonincoming" calculated for a branch
doesn't include ones for another branch, even if URLs without branch
part are same. The result of "discovery.findcommonoutgoing()"
invocation with such "commonincoming" becomes incorrect in some cases.
This patch clears "commonincoming", also if branch part of "default"
differs from one of "default-push".
To avoid redundant looking up:
- "ui.expandpath('default')" and "ui.expandpath('default-push',
'default')" are not compared directly, even though they contain
branch information, because they are not yet normalized by
"hg.parseurl()": tail "/" of path, for example
- "commonincoming" is not cleared, if branch isn't specified in
"default" URL, because such "commonincoming" contains common
revisions for all branches
This patch also tests "different path, same branch" pattern to check
careless degrading around comparison between source and destination.
2013-04-09 18:40:11 +04:00
|
|
|
|
|
|
|
$ hg summary --remote --config paths.default='../clone#foo' --config paths.default-push='../clone'
|
2020-10-09 23:50:58 +03:00
|
|
|
parent: 44b4e0c07491
|
summary: clear "commonincoming" also if branches are different
Before this patch, "commonincoming" calculated by
"discovery.findcommonincoming()" is cleared, only if "default" URL
without branch part (tail "#branch" of URL) differs from
"default-push" URL without branch part.
But common revisions in "commonincoming" calculated for a branch
doesn't include ones for another branch, even if URLs without branch
part are same. The result of "discovery.findcommonoutgoing()"
invocation with such "commonincoming" becomes incorrect in some cases.
This patch clears "commonincoming", also if branch part of "default"
differs from one of "default-push".
To avoid redundant looking up:
- "ui.expandpath('default')" and "ui.expandpath('default-push',
'default')" are not compared directly, even though they contain
branch information, because they are not yet normalized by
"hg.parseurl()": tail "/" of path, for example
- "commonincoming" is not cleared, if branch isn't specified in
"default" URL, because such "commonincoming" contains common
revisions for all branches
This patch also tests "different path, same branch" pattern to check
careless degrading around comparison between source and destination.
2013-04-09 18:40:11 +04:00
|
|
|
new head to push current default head
|
|
|
|
commit: (clean)
|
2020-07-02 23:11:57 +03:00
|
|
|
phases: 5 draft
|
summary: clear "commonincoming" also if branches are different
Before this patch, "commonincoming" calculated by
"discovery.findcommonincoming()" is cleared, only if "default" URL
without branch part (tail "#branch" of URL) differs from
"default-push" URL without branch part.
But common revisions in "commonincoming" calculated for a branch
doesn't include ones for another branch, even if URLs without branch
part are same. The result of "discovery.findcommonoutgoing()"
invocation with such "commonincoming" becomes incorrect in some cases.
This patch clears "commonincoming", also if branch part of "default"
differs from one of "default-push".
To avoid redundant looking up:
- "ui.expandpath('default')" and "ui.expandpath('default-push',
'default')" are not compared directly, even though they contain
branch information, because they are not yet normalized by
"hg.parseurl()": tail "/" of path, for example
- "commonincoming" is not cleared, if branch isn't specified in
"default" URL, because such "commonincoming" contains common
revisions for all branches
This patch also tests "different path, same branch" pattern to check
careless degrading around comparison between source and destination.
2013-04-09 18:40:11 +04:00
|
|
|
remote: 1 outgoing
|
|
|
|
|
2019-02-13 08:39:22 +03:00
|
|
|
$ hg summary --remote --config paths.default='../clone' --config paths.default-push='../clone#foo'
|
2020-10-09 23:50:58 +03:00
|
|
|
parent: 44b4e0c07491
|
summary: clear "commonincoming" also if branches are different
Before this patch, "commonincoming" calculated by
"discovery.findcommonincoming()" is cleared, only if "default" URL
without branch part (tail "#branch" of URL) differs from
"default-push" URL without branch part.
But common revisions in "commonincoming" calculated for a branch
doesn't include ones for another branch, even if URLs without branch
part are same. The result of "discovery.findcommonoutgoing()"
invocation with such "commonincoming" becomes incorrect in some cases.
This patch clears "commonincoming", also if branch part of "default"
differs from one of "default-push".
To avoid redundant looking up:
- "ui.expandpath('default')" and "ui.expandpath('default-push',
'default')" are not compared directly, even though they contain
branch information, because they are not yet normalized by
"hg.parseurl()": tail "/" of path, for example
- "commonincoming" is not cleared, if branch isn't specified in
"default" URL, because such "commonincoming" contains common
revisions for all branches
This patch also tests "different path, same branch" pattern to check
careless degrading around comparison between source and destination.
2013-04-09 18:40:11 +04:00
|
|
|
new head to push current default head
|
|
|
|
commit: (clean)
|
2020-07-02 23:11:57 +03:00
|
|
|
phases: 5 draft
|
2019-02-13 08:39:22 +03:00
|
|
|
remote: (synced)
|
summary: clear "commonincoming" also if branches are different
Before this patch, "commonincoming" calculated by
"discovery.findcommonincoming()" is cleared, only if "default" URL
without branch part (tail "#branch" of URL) differs from
"default-push" URL without branch part.
But common revisions in "commonincoming" calculated for a branch
doesn't include ones for another branch, even if URLs without branch
part are same. The result of "discovery.findcommonoutgoing()"
invocation with such "commonincoming" becomes incorrect in some cases.
This patch clears "commonincoming", also if branch part of "default"
differs from one of "default-push".
To avoid redundant looking up:
- "ui.expandpath('default')" and "ui.expandpath('default-push',
'default')" are not compared directly, even though they contain
branch information, because they are not yet normalized by
"hg.parseurl()": tail "/" of path, for example
- "commonincoming" is not cleared, if branch isn't specified in
"default" URL, because such "commonincoming" contains common
revisions for all branches
This patch also tests "different path, same branch" pattern to check
careless degrading around comparison between source and destination.
2013-04-09 18:40:11 +04:00
|
|
|
|
|
|
|
$ cd ..
|
2016-09-30 15:38:47 +03:00
|
|
|
|
|
|
|
Test url#rev syntax of local destination path, which should be taken as
|
|
|
|
a 'url#rev' path
|
|
|
|
|
|
|
|
$ hg clone repo '#foo'
|
|
|
|
updating to branch default
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg root -R '#foo'
|
2017-12-11 06:50:57 +03:00
|
|
|
$TESTTMP/#foo
|