2019-05-28 13:12:27 +03:00
|
|
|
$ setconfig extensions.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
|
2019-02-13 08:39:22 +03:00
|
|
|
changeset: 1:17d330177ee9
|
|
|
|
bookmark: foo
|
2010-09-14 18:42:02 +04:00
|
|
|
tag: tip
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: change a
|
|
|
|
|
|
|
|
$ hg --cwd clone parents
|
2019-02-13 08:39:22 +03:00
|
|
|
changeset: 1:17d330177ee9
|
|
|
|
bookmark: foo
|
2010-09-14 18:42:02 +04:00
|
|
|
tag: tip
|
|
|
|
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
|
2019-02-13 08:39:22 +03:00
|
|
|
changeset: 3:ad4513930219
|
2010-09-14 18:42:02 +04:00
|
|
|
tag: tip
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: add bar
|
|
|
|
|
2019-02-13 08:39:22 +03:00
|
|
|
changeset: 2:7d4251d04d20
|
|
|
|
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
|
|
|
|
|
2019-02-13 08:39:22 +03:00
|
|
|
changeset: 1:17d330177ee9
|
2010-09-14 18:42:02 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: change a
|
|
|
|
|
|
|
|
changeset: 0:1f0dee641bb7
|
|
|
|
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'
|
2019-02-13 08:39:22 +03:00
|
|
|
2:7d4251d04d20
|
|
|
|
3:ad4513930219
|
2013-04-09 18:40:10 +04:00
|
|
|
$ hg summary --remote --config paths.default='../clone'
|
2019-02-13 08:39:22 +03:00
|
|
|
parent: 3:ad4513930219 tip
|
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'
|
2019-02-13 08:39:22 +03:00
|
|
|
2:7d4251d04d20
|
2013-04-09 18:40:10 +04:00
|
|
|
$ hg summary --remote --config paths.default='../clone#foo'
|
2019-02-13 08:39:22 +03:00
|
|
|
parent: 3:ad4513930219 tip
|
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'
|
2019-02-13 08:39:22 +03:00
|
|
|
2:7d4251d04d20
|
2013-04-09 18:40:11 +04:00
|
|
|
$ hg --cwd ../clone summary --remote --config paths.default='../repo#foo'
|
2019-02-13 08:39:22 +03:00
|
|
|
parent: 1:17d330177ee9 tip
|
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)
|
|
|
|
remote: 1 or more incoming
|
|
|
|
|
2010-09-14 18:42:02 +04:00
|
|
|
$ hg -q push '../clone#foo'
|
|
|
|
|
|
|
|
$ hg --cwd ../clone heads
|
2019-02-13 08:39:22 +03:00
|
|
|
changeset: 2:7d4251d04d20
|
|
|
|
bookmark: foo
|
2010-09-14 18:42:02 +04:00
|
|
|
tag: tip
|
|
|
|
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'
|
2019-02-13 08:39:22 +03:00
|
|
|
parent: 1:17d330177ee9
|
2013-04-09 18:40:11 +04:00
|
|
|
change a
|
|
|
|
commit: (clean)
|
|
|
|
remote: (synced)
|
|
|
|
|
2010-09-14 18:42:02 +04:00
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ cd clone
|
|
|
|
$ hg rollback
|
2011-02-10 11:03:06 +03:00
|
|
|
repository tip rolled back to revision 1 (undo push)
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
$ hg -q incoming
|
2019-02-13 08:39:22 +03:00
|
|
|
2:7d4251d04d20
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
$ hg -q pull
|
|
|
|
|
|
|
|
$ hg heads
|
2019-02-13 08:39:22 +03:00
|
|
|
changeset: 2:7d4251d04d20
|
|
|
|
bookmark: foo
|
2010-09-14 18:42:02 +04:00
|
|
|
tag: tip
|
|
|
|
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
|
2019-02-13 08:39:22 +03:00
|
|
|
1:17d330177ee9
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
Going back to the default branch:
|
|
|
|
|
|
|
|
$ hg up -C 0
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ hg parents
|
|
|
|
changeset: 0:1f0dee641bb7
|
|
|
|
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
|
|
|
|
0:1f0dee641bb7
|
|
|
|
|
|
|
|
$ hg rollback
|
2011-02-10 11:03:06 +03:00
|
|
|
repository tip rolled back to revision 1 (undo pull)
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
$ hg parents -q
|
|
|
|
0:1f0dee641bb7
|
|
|
|
|
|
|
|
Pull -u takes us back to branch foo:
|
|
|
|
|
|
|
|
$ hg pull -qu
|
|
|
|
|
|
|
|
$ hg parents
|
2019-02-13 08:39:22 +03:00
|
|
|
changeset: 2:7d4251d04d20
|
|
|
|
bookmark: foo
|
2010-09-14 18:42:02 +04:00
|
|
|
tag: tip
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: new head of branch foo
|
|
|
|
|
|
|
|
$ hg rollback
|
2011-02-10 11:03:06 +03:00
|
|
|
repository tip rolled back to revision 1 (undo pull)
|
|
|
|
working directory now based on revision 0
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
$ hg up -C 0
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2019-02-13 08:39:22 +03:00
|
|
|
(leaving bookmark foo)
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
$ hg parents -q
|
|
|
|
0:1f0dee641bb7
|
|
|
|
|
|
|
|
$ hg heads -q
|
2019-02-13 08:39:22 +03:00
|
|
|
1:17d330177ee9
|
2010-09-14 18:42:02 +04:00
|
|
|
|
|
|
|
$ hg pull -qur default default
|
|
|
|
|
|
|
|
$ hg parents
|
2019-02-13 08:39:22 +03:00
|
|
|
changeset: 3:ad4513930219
|
2010-09-14 18:42:02 +04:00
|
|
|
tag: tip
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: add bar
|
|
|
|
|
|
|
|
$ hg heads
|
2019-02-13 08:39:22 +03:00
|
|
|
changeset: 3:ad4513930219
|
2010-09-14 18:42:02 +04:00
|
|
|
tag: tip
|
|
|
|
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"
|
|
|
|
|
|
|
|
$ hg -R clone rollback
|
|
|
|
repository tip rolled back to revision 1 (undo pull)
|
|
|
|
working directory now based on revision 0
|
|
|
|
|
|
|
|
$ cd repo
|
|
|
|
|
|
|
|
$ hg update -q -C default
|
|
|
|
$ echo modified >> bar
|
|
|
|
$ hg commit -m "new head to push current default head"
|
|
|
|
$ hg -q push -r ".^1" '../clone'
|
|
|
|
|
|
|
|
$ hg -q outgoing '../clone'
|
2019-02-13 08:39:22 +03:00
|
|
|
4: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'
|
2019-02-13 08:39:22 +03:00
|
|
|
parent: 4:44b4e0c07491 tip
|
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)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 1 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'
|
|
|
|
parent: 4:44b4e0c07491 tip
|
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)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 1 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
|