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'
|
|
|
|
$ hg branch foo
|
|
|
|
marked working directory as branch foo
|
2011-12-09 00:32:44 +04:00
|
|
|
(branches are permanent and global, did you want a bookmark?)
|
2010-09-14 18:42:02 +04:00
|
|
|
$ echo >> a
|
|
|
|
$ hg ci -m 'change a'
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ hg clone 'repo#foo' clone
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 2 changesets with 2 changes to 1 files
|
2017-10-12 10:39:50 +03:00
|
|
|
new changesets 1f0dee641bb7:cd2a86ecc814
|
2010-09-14 18:42:02 +04:00
|
|
|
updating to branch foo
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ hg --cwd clone heads
|
|
|
|
changeset: 1:cd2a86ecc814
|
|
|
|
branch: foo
|
|
|
|
tag: tip
|
|
|
|
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
|
|
|
|
|
|
|
|
$ hg --cwd clone parents
|
|
|
|
changeset: 1:cd2a86ecc814
|
|
|
|
branch: foo
|
|
|
|
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]
|
2014-10-20 17:08:08 +04:00
|
|
|
default = $TESTTMP/repo#foo (glob)
|
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
|
|
|
|
changeset: 3:4cd725637392
|
|
|
|
tag: tip
|
|
|
|
parent: 0:1f0dee641bb7
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: add bar
|
|
|
|
|
|
|
|
changeset: 2:faba9097cad4
|
|
|
|
branch: foo
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: new head of branch foo
|
|
|
|
|
|
|
|
changeset: 1:cd2a86ecc814
|
|
|
|
branch: foo
|
|
|
|
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'
|
|
|
|
2:faba9097cad4
|
|
|
|
3:4cd725637392
|
|
|
|
$ hg summary --remote --config paths.default='../clone'
|
|
|
|
parent: 3:4cd725637392 tip
|
|
|
|
add bar
|
|
|
|
branch: default
|
|
|
|
commit: (clean)
|
|
|
|
update: (current)
|
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'
|
|
|
|
2:faba9097cad4
|
2013-04-09 18:40:10 +04:00
|
|
|
$ hg summary --remote --config paths.default='../clone#foo'
|
|
|
|
parent: 3:4cd725637392 tip
|
|
|
|
add bar
|
|
|
|
branch: default
|
|
|
|
commit: (clean)
|
|
|
|
update: (current)
|
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'
|
|
|
|
2:faba9097cad4
|
|
|
|
$ hg --cwd ../clone summary --remote --config paths.default='../repo#foo'
|
|
|
|
parent: 1:cd2a86ecc814 tip
|
|
|
|
change a
|
|
|
|
branch: foo
|
|
|
|
commit: (clean)
|
|
|
|
update: (current)
|
|
|
|
remote: 1 or more incoming
|
|
|
|
|
2010-09-14 18:42:02 +04:00
|
|
|
$ hg -q push '../clone#foo'
|
|
|
|
|
|
|
|
$ hg --cwd ../clone heads
|
|
|
|
changeset: 2:faba9097cad4
|
|
|
|
branch: foo
|
|
|
|
tag: tip
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: new head of branch foo
|
|
|
|
|
|
|
|
changeset: 0:1f0dee641bb7
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: add a
|
|
|
|
|
2013-04-09 18:40:11 +04:00
|
|
|
$ hg -q --cwd ../clone incoming '../repo#foo'
|
|
|
|
[1]
|
|
|
|
$ hg --cwd ../clone summary --remote --config paths.default='../repo#foo'
|
|
|
|
parent: 1:cd2a86ecc814
|
|
|
|
change a
|
|
|
|
branch: foo
|
|
|
|
commit: (clean)
|
|
|
|
update: 1 new changesets (update)
|
|
|
|
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
|
|
|
|
2:faba9097cad4
|
|
|
|
|
|
|
|
$ hg -q pull
|
|
|
|
|
|
|
|
$ hg heads
|
|
|
|
changeset: 2:faba9097cad4
|
|
|
|
branch: foo
|
|
|
|
tag: tip
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: new head of branch foo
|
|
|
|
|
|
|
|
changeset: 0:1f0dee641bb7
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: add a
|
|
|
|
|
|
|
|
Pull should not have updated:
|
|
|
|
|
|
|
|
$ hg parents -q
|
|
|
|
1:cd2a86ecc814
|
|
|
|
|
|
|
|
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
|
|
|
|
changeset: 2:faba9097cad4
|
|
|
|
branch: foo
|
|
|
|
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
|
|
|
|
|
|
|
|
$ hg parents -q
|
|
|
|
0:1f0dee641bb7
|
|
|
|
|
|
|
|
$ hg heads -q
|
|
|
|
1:cd2a86ecc814
|
|
|
|
0:1f0dee641bb7
|
|
|
|
|
|
|
|
$ hg pull -qur default default
|
|
|
|
|
|
|
|
$ hg parents
|
|
|
|
changeset: 3:4cd725637392
|
|
|
|
tag: tip
|
|
|
|
parent: 0:1f0dee641bb7
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: add bar
|
|
|
|
|
|
|
|
$ hg heads
|
|
|
|
changeset: 3:4cd725637392
|
|
|
|
tag: tip
|
|
|
|
parent: 0:1f0dee641bb7
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: add bar
|
|
|
|
|
|
|
|
changeset: 2:faba9097cad4
|
|
|
|
branch: foo
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: new head of branch foo
|
|
|
|
|
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'
|
|
|
|
2:faba9097cad4
|
|
|
|
4:d515801a8f3d
|
|
|
|
|
|
|
|
$ hg summary --remote --config paths.default='../clone#default' --config paths.default-push='../clone#foo'
|
|
|
|
parent: 4:d515801a8f3d tip
|
|
|
|
new head to push current default head
|
|
|
|
branch: default
|
|
|
|
commit: (clean)
|
|
|
|
update: (current)
|
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
|
|
|
|
|
|
|
|
$ hg summary --remote --config paths.default='../clone#foo' --config paths.default-push='../clone'
|
|
|
|
parent: 4:d515801a8f3d tip
|
|
|
|
new head to push current default head
|
|
|
|
branch: default
|
|
|
|
commit: (clean)
|
|
|
|
update: (current)
|
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: 2 outgoing
|
|
|
|
|
|
|
|
$ hg summary --remote --config paths.default='../clone' --config paths.default-push='../clone#foo'
|
|
|
|
parent: 4:d515801a8f3d tip
|
|
|
|
new head to push current default head
|
|
|
|
branch: default
|
|
|
|
commit: (clean)
|
|
|
|
update: (current)
|
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
|
|
|
|
|
|
|
|
$ hg clone -q -r 0 . ../another
|
|
|
|
$ hg -q outgoing '../another#default'
|
|
|
|
3:4cd725637392
|
|
|
|
4:d515801a8f3d
|
|
|
|
|
|
|
|
$ hg summary --remote --config paths.default='../another#default' --config paths.default-push='../clone#default'
|
|
|
|
parent: 4:d515801a8f3d tip
|
|
|
|
new head to push current default head
|
|
|
|
branch: default
|
|
|
|
commit: (clean)
|
|
|
|
update: (current)
|
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
|
|
|
|
|
|
|
|
$ 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'
|
|
|
|
$TESTTMP/#foo (glob)
|