2010-11-15 02:15:26 +03:00
|
|
|
$ "$TESTDIR/hghave" git || exit 80
|
|
|
|
|
|
|
|
make git commits repeatable
|
|
|
|
|
2012-06-20 03:09:49 +04:00
|
|
|
$ echo "[core]" >> $HOME/.gitconfig
|
|
|
|
$ echo "autocrlf = false" >> $HOME/.gitconfig
|
2010-11-15 02:15:26 +03:00
|
|
|
$ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
|
|
|
|
$ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
|
|
|
|
$ GIT_AUTHOR_DATE='1234567891 +0000'; export GIT_AUTHOR_DATE
|
|
|
|
$ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
|
|
|
|
$ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
|
|
|
|
$ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
|
|
|
|
|
|
|
|
root hg repo
|
|
|
|
|
|
|
|
$ hg init t
|
|
|
|
$ cd t
|
|
|
|
$ echo a > a
|
|
|
|
$ hg add a
|
|
|
|
$ hg commit -m a
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
new external git repo
|
|
|
|
|
|
|
|
$ mkdir gitroot
|
|
|
|
$ cd gitroot
|
|
|
|
$ git init -q
|
|
|
|
$ echo g > g
|
|
|
|
$ git add g
|
|
|
|
$ git commit -q -m g
|
|
|
|
|
|
|
|
add subrepo clone
|
|
|
|
|
|
|
|
$ cd ../t
|
|
|
|
$ echo 's = [git]../gitroot' > .hgsub
|
|
|
|
$ git clone -q ../gitroot s
|
|
|
|
$ hg add .hgsub
|
|
|
|
$ hg commit -m 'new git subrepo'
|
|
|
|
$ hg debugsub
|
|
|
|
path s
|
|
|
|
source ../gitroot
|
|
|
|
revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
|
|
|
|
|
2010-11-15 02:31:29 +03:00
|
|
|
record a new commit from upstream from a different branch
|
2010-11-15 02:15:26 +03:00
|
|
|
|
|
|
|
$ cd ../gitroot
|
2010-12-07 05:17:27 +03:00
|
|
|
$ git checkout -q -b testing
|
2010-11-15 02:15:26 +03:00
|
|
|
$ echo gg >> g
|
|
|
|
$ git commit -q -a -m gg
|
|
|
|
|
|
|
|
$ cd ../t/s
|
2010-12-07 05:17:27 +03:00
|
|
|
$ git pull -q >/dev/null 2>/dev/null
|
|
|
|
$ git checkout -q -b testing origin/testing >/dev/null
|
2010-11-15 02:15:26 +03:00
|
|
|
|
|
|
|
$ cd ..
|
2010-12-20 21:59:33 +03:00
|
|
|
$ hg status --subrepos
|
|
|
|
M s/g
|
2010-11-15 02:15:26 +03:00
|
|
|
$ hg commit -m 'update git subrepo'
|
|
|
|
$ hg debugsub
|
|
|
|
path s
|
|
|
|
source ../gitroot
|
|
|
|
revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
|
2010-11-15 02:20:13 +03:00
|
|
|
|
2010-12-07 05:17:27 +03:00
|
|
|
make $GITROOT pushable, by replacing it with a clone with nothing checked out
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
$ git clone gitroot gitrootbare --bare -q
|
|
|
|
$ rm -rf gitroot
|
|
|
|
$ mv gitrootbare gitroot
|
|
|
|
|
2010-11-15 02:20:13 +03:00
|
|
|
clone root
|
|
|
|
|
2010-12-07 05:17:27 +03:00
|
|
|
$ cd t
|
2013-11-17 04:55:38 +04:00
|
|
|
$ hg clone . ../tc 2> /dev/null
|
2010-11-15 02:20:13 +03:00
|
|
|
updating to branch default
|
2011-03-02 20:19:18 +03:00
|
|
|
cloning subrepo s from $TESTTMP/gitroot
|
2010-11-15 02:20:13 +03:00
|
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ cd ../tc
|
|
|
|
$ hg debugsub
|
|
|
|
path s
|
|
|
|
source ../gitroot
|
|
|
|
revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
|
|
|
|
|
|
|
|
update to previous substate
|
|
|
|
|
2010-12-10 00:52:14 +03:00
|
|
|
$ hg update 1 -q
|
2010-11-15 02:20:13 +03:00
|
|
|
$ cat s/g
|
|
|
|
g
|
|
|
|
$ hg debugsub
|
|
|
|
path s
|
|
|
|
source ../gitroot
|
|
|
|
revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
|
2010-11-15 02:22:33 +03:00
|
|
|
|
|
|
|
clone root, make local change
|
|
|
|
|
2010-12-07 05:17:27 +03:00
|
|
|
$ cd ../t
|
2013-11-17 04:55:38 +04:00
|
|
|
$ hg clone . ../ta 2> /dev/null
|
2010-11-15 02:22:33 +03:00
|
|
|
updating to branch default
|
2011-03-02 20:19:18 +03:00
|
|
|
cloning subrepo s from $TESTTMP/gitroot
|
2010-11-15 02:22:33 +03:00
|
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ cd ../ta
|
|
|
|
$ echo ggg >> s/g
|
2010-12-20 21:59:33 +03:00
|
|
|
$ hg status --subrepos
|
|
|
|
M s/g
|
2011-10-21 02:33:08 +04:00
|
|
|
$ hg commit --subrepos -m ggg
|
2010-12-20 21:59:33 +03:00
|
|
|
committing subrepository s
|
2010-11-15 02:22:33 +03:00
|
|
|
$ hg debugsub
|
|
|
|
path s
|
|
|
|
source ../gitroot
|
|
|
|
revision 79695940086840c99328513acbe35f90fcd55e57
|
|
|
|
|
|
|
|
clone root separately, make different local change
|
|
|
|
|
|
|
|
$ cd ../t
|
2013-11-17 04:55:38 +04:00
|
|
|
$ hg clone . ../tb 2> /dev/null
|
2010-11-15 02:22:33 +03:00
|
|
|
updating to branch default
|
2011-03-02 20:19:18 +03:00
|
|
|
cloning subrepo s from $TESTTMP/gitroot
|
2010-11-15 02:22:33 +03:00
|
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
|
|
|
$ cd ../tb/s
|
|
|
|
$ echo f > f
|
|
|
|
$ git add f
|
|
|
|
$ cd ..
|
|
|
|
|
2010-12-20 21:59:33 +03:00
|
|
|
$ hg status --subrepos
|
|
|
|
A s/f
|
2011-10-21 02:33:08 +04:00
|
|
|
$ hg commit --subrepos -m f
|
2010-12-20 21:59:33 +03:00
|
|
|
committing subrepository s
|
2010-11-15 02:22:33 +03:00
|
|
|
$ hg debugsub
|
|
|
|
path s
|
|
|
|
source ../gitroot
|
|
|
|
revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
|
|
|
|
|
|
|
|
user b push changes
|
|
|
|
|
2010-12-07 05:17:27 +03:00
|
|
|
$ hg push 2>/dev/null
|
2012-06-20 03:09:49 +04:00
|
|
|
pushing to $TESTTMP/t (glob)
|
2010-11-22 06:00:51 +03:00
|
|
|
pushing branch testing of subrepo s
|
2010-11-15 02:22:33 +03:00
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files
|
|
|
|
|
|
|
|
user a pulls, merges, commits
|
|
|
|
|
|
|
|
$ cd ../ta
|
|
|
|
$ hg pull
|
2012-06-20 03:09:49 +04:00
|
|
|
pulling from $TESTTMP/t (glob)
|
2010-11-15 02:22:33 +03:00
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files (+1 heads)
|
|
|
|
(run 'hg heads' to see heads, 'hg merge' to merge)
|
2010-12-07 05:17:27 +03:00
|
|
|
$ hg merge 2>/dev/null
|
merge: let the user choose to merge, keep local or keep remote subrepo revisions
When a subrepo has changed on the local and remote revisions, prompt the user
whether it wants to merge those subrepo revisions, keep the local revision or
keep the remote revision.
Up until now mercurial would always perform a merge on a subrepo that had
changed on the local and the remote revisions. This is often inconvenient. For
example:
- You may want to perform the actual subrepo merge after you have merged the
parent subrepo files.
- Some subrepos may be considered "read only", in the sense that you are not
supposed to add new revisions to them. In those cases "merging a subrepo" means
choosing which _existing_ revision you want to use on the merged revision. This
is often the case for subrepos that contain binary dependencies (such as DLLs,
etc).
This new prompt makes mercurial better cope with those common scenarios.
Notes:
- The default behavior (which is the one that is used when ui is not
interactive) remains unchanged (i.e. merge is the default action).
- This prompt will be shown even if the ui --tool flag is set.
- I don't know of a way to test the "keep local" and "keep remote" options (i.e.
to force the test to choose those options).
# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1378420708 -7200
# Fri Sep 06 00:38:28 2013 +0200
# Node ID 2fb9cb0c7b26303ac3178b7739975e663075857d
# Parent 796d34e1b749b79834321ef1181ed8433a5515d9
merge: let the user choose to merge, keep local or keep remote subrepo revisions
When a subrepo has changed on the local and remote revisions, prompt the user
whether it wants to merge those subrepo revisions, keep the local revision or
keep the remote revision.
Up until now mercurial would always perform a merge on a subrepo that had
changed on the local and the remote revisions. This is often inconvenient. For
example:
- You may want to perform the actual subrepo merge after you have merged the
parent subrepo files.
- Some subrepos may be considered "read only", in the sense that you are not
supposed to add new revisions to them. In those cases "merging a subrepo" means
choosing which _existing_ revision you want to use on the merged revision. This
is often the case for subrepos that contain binary dependencies (such as DLLs,
etc).
This new prompt makes mercurial better cope with those common scenarios.
Notes:
- The default behavior (which is the one that is used when ui is not
interactive) remains unchanged (i.e. merge is the default action).
- This prompt will be shown even if the ui --tool flag is set.
- I don't know of a way to test the "keep local" and "keep remote" options (i.e.
to force the test to choose those options).
2013-09-06 02:38:28 +04:00
|
|
|
subrepository s diverged (local revision: 796959400868, remote revision: aa84837ccfbd)
|
|
|
|
(M)erge, keep (l)ocal or keep (r)emote? m
|
2011-03-08 23:36:56 +03:00
|
|
|
pulling subrepo s from $TESTTMP/gitroot
|
2010-11-15 02:22:33 +03:00
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
|
|
|
$ cat s/f
|
|
|
|
f
|
|
|
|
$ cat s/g
|
|
|
|
g
|
|
|
|
gg
|
|
|
|
ggg
|
2011-10-21 02:33:08 +04:00
|
|
|
$ hg commit --subrepos -m 'merge'
|
2010-12-20 21:59:33 +03:00
|
|
|
committing subrepository s
|
2010-12-20 21:59:33 +03:00
|
|
|
$ hg status --subrepos --rev 1:5
|
|
|
|
M .hgsubstate
|
|
|
|
M s/g
|
|
|
|
A s/f
|
2010-11-15 02:22:33 +03:00
|
|
|
$ hg debugsub
|
|
|
|
path s
|
|
|
|
source ../gitroot
|
|
|
|
revision f47b465e1bce645dbf37232a00574aa1546ca8d3
|
2010-12-07 05:17:27 +03:00
|
|
|
$ hg push 2>/dev/null
|
2012-06-20 03:09:49 +04:00
|
|
|
pushing to $TESTTMP/t (glob)
|
2010-11-22 06:00:51 +03:00
|
|
|
pushing branch testing of subrepo s
|
2010-11-15 02:22:33 +03:00
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 2 changesets with 2 changes to 1 files
|
2010-11-15 02:31:40 +03:00
|
|
|
|
2010-11-22 06:00:51 +03:00
|
|
|
make upstream git changes
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
$ git clone -q gitroot gitclone
|
|
|
|
$ cd gitclone
|
|
|
|
$ echo ff >> f
|
|
|
|
$ git commit -q -a -m ff
|
|
|
|
$ echo fff >> f
|
|
|
|
$ git commit -q -a -m fff
|
2010-12-07 05:17:27 +03:00
|
|
|
$ git push origin testing 2>/dev/null
|
2010-11-22 06:00:51 +03:00
|
|
|
|
|
|
|
make and push changes to hg without updating the subrepo
|
|
|
|
|
|
|
|
$ cd ../t
|
2013-11-17 04:55:38 +04:00
|
|
|
$ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.'
|
2010-11-22 06:00:51 +03:00
|
|
|
updating to branch default
|
2011-03-02 20:19:18 +03:00
|
|
|
cloning subrepo s from $TESTTMP/gitroot
|
2010-11-22 06:00:51 +03:00
|
|
|
checking out detached HEAD in subrepo s
|
|
|
|
check out a git branch if you intend to make changes
|
|
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ cd ../td
|
|
|
|
$ echo aa >> a
|
|
|
|
$ hg commit -m aa
|
|
|
|
$ hg push
|
2012-06-20 03:09:49 +04:00
|
|
|
pushing to $TESTTMP/t (glob)
|
2010-11-22 06:00:51 +03:00
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files
|
|
|
|
|
2010-11-29 01:19:23 +03:00
|
|
|
sync to upstream git, distribute changes
|
|
|
|
|
|
|
|
$ cd ../ta
|
|
|
|
$ hg pull -u -q
|
|
|
|
$ cd s
|
2010-12-07 05:17:27 +03:00
|
|
|
$ git pull -q >/dev/null 2>/dev/null
|
2010-11-29 01:19:23 +03:00
|
|
|
$ cd ..
|
|
|
|
$ hg commit -m 'git upstream sync'
|
|
|
|
$ hg debugsub
|
|
|
|
path s
|
|
|
|
source ../gitroot
|
|
|
|
revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
|
|
|
|
$ hg push -q
|
|
|
|
|
|
|
|
$ cd ../tb
|
|
|
|
$ hg pull -q
|
2010-12-07 05:17:27 +03:00
|
|
|
$ hg update 2>/dev/null
|
2011-03-08 23:36:56 +03:00
|
|
|
pulling subrepo s from $TESTTMP/gitroot
|
2010-11-29 01:19:23 +03:00
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg debugsub
|
|
|
|
path s
|
|
|
|
source ../gitroot
|
|
|
|
revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
|
|
|
|
|
2013-04-17 07:00:41 +04:00
|
|
|
create a new git branch
|
|
|
|
|
|
|
|
$ cd s
|
|
|
|
$ git checkout -b b2
|
|
|
|
Switched to a new branch 'b2'
|
|
|
|
$ echo a>a
|
|
|
|
$ git add a
|
|
|
|
$ git commit -qm 'add a'
|
|
|
|
$ cd ..
|
|
|
|
$ hg commit -m 'add branch in s'
|
|
|
|
|
|
|
|
pulling new git branch should not create tracking branch named 'origin/b2'
|
|
|
|
(issue3870)
|
|
|
|
$ cd ../td/s
|
|
|
|
$ git remote set-url origin $TESTTMP/tb/s
|
2013-02-22 01:05:06 +04:00
|
|
|
$ git branch --no-track oldtesting
|
2013-04-17 07:00:41 +04:00
|
|
|
$ cd ..
|
|
|
|
$ hg pull -q ../tb
|
|
|
|
$ hg up
|
|
|
|
From $TESTTMP/tb/s
|
|
|
|
* [new branch] b2 -> origin/b2
|
|
|
|
Previous HEAD position was f47b465... merge
|
|
|
|
Switched to a new branch 'b2'
|
|
|
|
pulling subrepo s from $TESTTMP/tb/s
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
2010-11-15 02:31:40 +03:00
|
|
|
update to a revision without the subrepo, keeping the local git repository
|
|
|
|
|
|
|
|
$ cd ../t
|
|
|
|
$ hg up 0
|
|
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
2010-11-16 15:29:35 +03:00
|
|
|
$ ls -a s
|
2010-11-15 02:31:40 +03:00
|
|
|
.
|
|
|
|
..
|
|
|
|
.git
|
|
|
|
|
|
|
|
$ hg up 2
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2010-11-16 15:29:35 +03:00
|
|
|
$ ls -a s
|
2010-11-15 02:31:40 +03:00
|
|
|
.
|
|
|
|
..
|
|
|
|
.git
|
|
|
|
g
|
2010-11-19 03:20:21 +03:00
|
|
|
|
|
|
|
archive subrepos
|
|
|
|
|
2010-12-07 05:17:27 +03:00
|
|
|
$ cd ../tc
|
|
|
|
$ hg pull -q
|
|
|
|
$ hg archive --subrepos -r 5 ../archive 2>/dev/null
|
2011-03-08 23:36:56 +03:00
|
|
|
pulling subrepo s from $TESTTMP/gitroot
|
2010-11-19 03:20:21 +03:00
|
|
|
$ cd ../archive
|
|
|
|
$ cat s/f
|
|
|
|
f
|
|
|
|
$ cat s/g
|
|
|
|
g
|
|
|
|
gg
|
|
|
|
ggg
|
2010-12-20 21:59:33 +03:00
|
|
|
|
2012-06-17 06:34:06 +04:00
|
|
|
$ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null
|
2012-07-05 04:25:49 +04:00
|
|
|
$ find ../archive_x | sort | grep -v pax_global_header
|
2012-06-17 06:34:06 +04:00
|
|
|
../archive_x
|
|
|
|
../archive_x/.hg_archival.txt
|
|
|
|
../archive_x/.hgsub
|
|
|
|
../archive_x/.hgsubstate
|
|
|
|
../archive_x/a
|
|
|
|
../archive_x/s
|
|
|
|
../archive_x/s/g
|
|
|
|
|
2010-12-20 21:59:33 +03:00
|
|
|
create nested repo
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
$ hg init outer
|
|
|
|
$ cd outer
|
|
|
|
$ echo b>b
|
|
|
|
$ hg add b
|
|
|
|
$ hg commit -m b
|
|
|
|
|
2013-11-17 04:55:38 +04:00
|
|
|
$ hg clone ../t inner 2> /dev/null
|
2010-12-20 21:59:33 +03:00
|
|
|
updating to branch default
|
2011-03-02 20:19:18 +03:00
|
|
|
cloning subrepo s from $TESTTMP/gitroot
|
2010-12-20 21:59:33 +03:00
|
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ echo inner = inner > .hgsub
|
|
|
|
$ hg add .hgsub
|
|
|
|
$ hg commit -m 'nested sub'
|
|
|
|
|
|
|
|
nested commit
|
|
|
|
|
|
|
|
$ echo ffff >> inner/s/f
|
2010-12-20 21:59:33 +03:00
|
|
|
$ hg status --subrepos
|
|
|
|
M inner/s/f
|
2011-10-21 02:33:08 +04:00
|
|
|
$ hg commit --subrepos -m nested
|
2010-12-20 21:59:33 +03:00
|
|
|
committing subrepository inner
|
2012-06-20 03:09:49 +04:00
|
|
|
committing subrepository inner/s (glob)
|
2010-12-20 21:59:33 +03:00
|
|
|
|
|
|
|
nested archive
|
|
|
|
|
|
|
|
$ hg archive --subrepos ../narchive
|
2011-01-26 03:33:46 +03:00
|
|
|
$ ls ../narchive/inner/s | grep -v pax_global_header
|
2010-12-20 21:59:33 +03:00
|
|
|
f
|
|
|
|
g
|
2011-01-31 15:40:05 +03:00
|
|
|
|
2011-02-22 23:11:10 +03:00
|
|
|
relative source expansion
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
$ mkdir d
|
2013-11-17 04:55:38 +04:00
|
|
|
$ hg clone t d/t 2> /dev/null
|
2011-02-22 23:11:10 +03:00
|
|
|
updating to branch default
|
2011-03-02 20:19:18 +03:00
|
|
|
cloning subrepo s from $TESTTMP/gitroot
|
2011-02-22 23:11:10 +03:00
|
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
|
2011-03-07 20:03:54 +03:00
|
|
|
Don't crash if the subrepo is missing
|
|
|
|
|
|
|
|
$ hg clone t missing -q
|
|
|
|
$ cd missing
|
|
|
|
$ rm -rf s
|
|
|
|
$ hg status -S
|
|
|
|
$ hg sum | grep commit
|
|
|
|
commit: 1 subrepos
|
|
|
|
$ hg push -q
|
2012-12-14 02:37:53 +04:00
|
|
|
abort: subrepo s is missing (in subrepo s)
|
2011-03-07 20:03:54 +03:00
|
|
|
[255]
|
2011-10-21 02:33:08 +04:00
|
|
|
$ hg commit --subrepos -qm missing
|
2012-12-14 02:37:53 +04:00
|
|
|
abort: subrepo s is missing (in subrepo s)
|
2011-03-07 20:03:54 +03:00
|
|
|
[255]
|
2013-11-17 04:55:38 +04:00
|
|
|
$ hg update -C 2> /dev/null
|
2011-03-08 01:19:17 +03:00
|
|
|
cloning subrepo s from $TESTTMP/gitroot
|
2011-03-07 20:03:54 +03:00
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg sum | grep commit
|
|
|
|
commit: (clean)
|
|
|
|
|
2011-05-28 19:03:48 +04:00
|
|
|
Don't crash if the .hgsubstate entry is missing
|
|
|
|
|
|
|
|
$ hg update 1 -q
|
|
|
|
$ hg rm .hgsubstate
|
|
|
|
$ hg commit .hgsubstate -m 'no substate'
|
2012-02-07 01:10:01 +04:00
|
|
|
nothing changed
|
|
|
|
[1]
|
2011-05-28 19:03:48 +04:00
|
|
|
$ hg tag -l nosubstate
|
|
|
|
$ hg manifest
|
|
|
|
.hgsub
|
2012-02-07 01:10:01 +04:00
|
|
|
.hgsubstate
|
2011-05-28 19:03:48 +04:00
|
|
|
a
|
|
|
|
|
|
|
|
$ hg status -S
|
2012-02-07 01:10:01 +04:00
|
|
|
R .hgsubstate
|
2011-05-28 19:03:48 +04:00
|
|
|
$ hg sum | grep commit
|
2012-02-07 01:10:01 +04:00
|
|
|
commit: 1 removed, 1 subrepos (new branch head)
|
2011-05-28 19:03:48 +04:00
|
|
|
|
|
|
|
$ hg commit -m 'restore substate'
|
2012-02-07 01:10:01 +04:00
|
|
|
nothing changed
|
|
|
|
[1]
|
2011-05-28 19:03:48 +04:00
|
|
|
$ hg manifest
|
|
|
|
.hgsub
|
|
|
|
.hgsubstate
|
|
|
|
a
|
|
|
|
$ hg sum | grep commit
|
2012-02-07 01:10:01 +04:00
|
|
|
commit: 1 removed, 1 subrepos (new branch head)
|
2011-05-28 19:03:48 +04:00
|
|
|
|
|
|
|
$ hg update -qC nosubstate
|
|
|
|
$ ls s
|
2012-02-07 01:10:01 +04:00
|
|
|
g
|
2011-05-28 19:03:48 +04:00
|
|
|
|
2011-11-11 04:00:11 +04:00
|
|
|
issue3109: false positives in git diff-index
|
|
|
|
|
|
|
|
$ hg update -q
|
|
|
|
$ touch -t 200001010000 s/g
|
|
|
|
$ hg status --subrepos
|
|
|
|
$ touch -t 200001010000 s/g
|
|
|
|
$ hg sum | grep commit
|
|
|
|
commit: (clean)
|
|
|
|
|
2011-01-31 15:40:05 +03:00
|
|
|
Check hg update --clean
|
2011-02-01 03:19:56 +03:00
|
|
|
$ cd $TESTTMP/ta
|
2011-01-31 15:40:05 +03:00
|
|
|
$ echo > s/g
|
|
|
|
$ cd s
|
|
|
|
$ echo c1 > f1
|
|
|
|
$ echo c1 > f2
|
|
|
|
$ git add f1
|
|
|
|
$ cd ..
|
2011-02-01 03:19:56 +03:00
|
|
|
$ hg status -S
|
|
|
|
M s/g
|
|
|
|
A s/f1
|
|
|
|
$ ls s
|
|
|
|
f
|
|
|
|
f1
|
|
|
|
f2
|
|
|
|
g
|
|
|
|
$ hg update --clean
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg status -S
|
|
|
|
$ ls s
|
|
|
|
f
|
|
|
|
f1
|
|
|
|
f2
|
|
|
|
g
|
2011-02-09 12:53:09 +03:00
|
|
|
|
|
|
|
Sticky subrepositories, no changes
|
|
|
|
$ cd $TESTTMP/ta
|
|
|
|
$ hg id -n
|
|
|
|
7
|
|
|
|
$ cd s
|
|
|
|
$ git rev-parse HEAD
|
|
|
|
32a343883b74769118bb1d3b4b1fbf9156f4dddc
|
|
|
|
$ cd ..
|
|
|
|
$ hg update 1 > /dev/null 2>&1
|
|
|
|
$ hg id -n
|
|
|
|
1
|
|
|
|
$ cd s
|
|
|
|
$ git rev-parse HEAD
|
|
|
|
da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
|
|
|
|
$ cd ..
|
|
|
|
|
2014-04-13 21:01:00 +04:00
|
|
|
Sticky subrepositories, file changes
|
2011-02-09 12:53:09 +03:00
|
|
|
$ touch s/f1
|
|
|
|
$ cd s
|
|
|
|
$ git add f1
|
|
|
|
$ cd ..
|
|
|
|
$ hg id -n
|
2012-07-27 15:56:19 +04:00
|
|
|
1+
|
2011-02-09 12:53:09 +03:00
|
|
|
$ cd s
|
|
|
|
$ git rev-parse HEAD
|
|
|
|
da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
|
|
|
|
$ cd ..
|
|
|
|
$ hg update 4
|
merge: let the user choose to merge, keep local or keep remote subrepo revisions
When a subrepo has changed on the local and remote revisions, prompt the user
whether it wants to merge those subrepo revisions, keep the local revision or
keep the remote revision.
Up until now mercurial would always perform a merge on a subrepo that had
changed on the local and the remote revisions. This is often inconvenient. For
example:
- You may want to perform the actual subrepo merge after you have merged the
parent subrepo files.
- Some subrepos may be considered "read only", in the sense that you are not
supposed to add new revisions to them. In those cases "merging a subrepo" means
choosing which _existing_ revision you want to use on the merged revision. This
is often the case for subrepos that contain binary dependencies (such as DLLs,
etc).
This new prompt makes mercurial better cope with those common scenarios.
Notes:
- The default behavior (which is the one that is used when ui is not
interactive) remains unchanged (i.e. merge is the default action).
- This prompt will be shown even if the ui --tool flag is set.
- I don't know of a way to test the "keep local" and "keep remote" options (i.e.
to force the test to choose those options).
# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1378420708 -7200
# Fri Sep 06 00:38:28 2013 +0200
# Node ID 2fb9cb0c7b26303ac3178b7739975e663075857d
# Parent 796d34e1b749b79834321ef1181ed8433a5515d9
merge: let the user choose to merge, keep local or keep remote subrepo revisions
When a subrepo has changed on the local and remote revisions, prompt the user
whether it wants to merge those subrepo revisions, keep the local revision or
keep the remote revision.
Up until now mercurial would always perform a merge on a subrepo that had
changed on the local and the remote revisions. This is often inconvenient. For
example:
- You may want to perform the actual subrepo merge after you have merged the
parent subrepo files.
- Some subrepos may be considered "read only", in the sense that you are not
supposed to add new revisions to them. In those cases "merging a subrepo" means
choosing which _existing_ revision you want to use on the merged revision. This
is often the case for subrepos that contain binary dependencies (such as DLLs,
etc).
This new prompt makes mercurial better cope with those common scenarios.
Notes:
- The default behavior (which is the one that is used when ui is not
interactive) remains unchanged (i.e. merge is the default action).
- This prompt will be shown even if the ui --tool flag is set.
- I don't know of a way to test the "keep local" and "keep remote" options (i.e.
to force the test to choose those options).
2013-09-06 02:38:28 +04:00
|
|
|
subrepository s diverged (local revision: da5f5b1d8ffc, remote revision: aa84837ccfbd)
|
|
|
|
(M)erge, keep (l)ocal or keep (r)emote? m
|
2011-02-09 12:53:09 +03:00
|
|
|
subrepository sources for s differ
|
2011-02-16 20:53:48 +03:00
|
|
|
use (l)ocal source (da5f5b1) or (r)emote source (aa84837)?
|
2011-02-09 12:53:09 +03:00
|
|
|
l
|
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg id -n
|
|
|
|
4+
|
|
|
|
$ cd s
|
|
|
|
$ git rev-parse HEAD
|
|
|
|
da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
|
|
|
|
$ cd ..
|
2012-08-08 20:10:16 +04:00
|
|
|
$ hg update --clean tip > /dev/null 2>&1
|
2011-02-09 12:53:09 +03:00
|
|
|
|
|
|
|
Sticky subrepository, revision updates
|
|
|
|
$ hg id -n
|
|
|
|
7
|
|
|
|
$ cd s
|
|
|
|
$ git rev-parse HEAD
|
|
|
|
32a343883b74769118bb1d3b4b1fbf9156f4dddc
|
|
|
|
$ cd ..
|
|
|
|
$ cd s
|
|
|
|
$ git checkout aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
|
|
|
|
Previous HEAD position was 32a3438... fff
|
|
|
|
HEAD is now at aa84837... f
|
|
|
|
$ cd ..
|
|
|
|
$ hg update 1
|
merge: let the user choose to merge, keep local or keep remote subrepo revisions
When a subrepo has changed on the local and remote revisions, prompt the user
whether it wants to merge those subrepo revisions, keep the local revision or
keep the remote revision.
Up until now mercurial would always perform a merge on a subrepo that had
changed on the local and the remote revisions. This is often inconvenient. For
example:
- You may want to perform the actual subrepo merge after you have merged the
parent subrepo files.
- Some subrepos may be considered "read only", in the sense that you are not
supposed to add new revisions to them. In those cases "merging a subrepo" means
choosing which _existing_ revision you want to use on the merged revision. This
is often the case for subrepos that contain binary dependencies (such as DLLs,
etc).
This new prompt makes mercurial better cope with those common scenarios.
Notes:
- The default behavior (which is the one that is used when ui is not
interactive) remains unchanged (i.e. merge is the default action).
- This prompt will be shown even if the ui --tool flag is set.
- I don't know of a way to test the "keep local" and "keep remote" options (i.e.
to force the test to choose those options).
# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1378420708 -7200
# Fri Sep 06 00:38:28 2013 +0200
# Node ID 2fb9cb0c7b26303ac3178b7739975e663075857d
# Parent 796d34e1b749b79834321ef1181ed8433a5515d9
merge: let the user choose to merge, keep local or keep remote subrepo revisions
When a subrepo has changed on the local and remote revisions, prompt the user
whether it wants to merge those subrepo revisions, keep the local revision or
keep the remote revision.
Up until now mercurial would always perform a merge on a subrepo that had
changed on the local and the remote revisions. This is often inconvenient. For
example:
- You may want to perform the actual subrepo merge after you have merged the
parent subrepo files.
- Some subrepos may be considered "read only", in the sense that you are not
supposed to add new revisions to them. In those cases "merging a subrepo" means
choosing which _existing_ revision you want to use on the merged revision. This
is often the case for subrepos that contain binary dependencies (such as DLLs,
etc).
This new prompt makes mercurial better cope with those common scenarios.
Notes:
- The default behavior (which is the one that is used when ui is not
interactive) remains unchanged (i.e. merge is the default action).
- This prompt will be shown even if the ui --tool flag is set.
- I don't know of a way to test the "keep local" and "keep remote" options (i.e.
to force the test to choose those options).
2013-09-06 02:38:28 +04:00
|
|
|
subrepository s diverged (local revision: 32a343883b74, remote revision: da5f5b1d8ffc)
|
|
|
|
(M)erge, keep (l)ocal or keep (r)emote? m
|
2011-02-09 12:53:09 +03:00
|
|
|
subrepository sources for s differ (in checked out version)
|
2011-02-16 20:53:48 +03:00
|
|
|
use (l)ocal source (32a3438) or (r)emote source (da5f5b1)?
|
2011-02-09 12:53:09 +03:00
|
|
|
l
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg id -n
|
|
|
|
1+
|
|
|
|
$ cd s
|
|
|
|
$ git rev-parse HEAD
|
|
|
|
aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Sticky subrepository, file changes and revision updates
|
|
|
|
$ touch s/f1
|
|
|
|
$ cd s
|
|
|
|
$ git add f1
|
|
|
|
$ git rev-parse HEAD
|
|
|
|
aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
|
|
|
|
$ cd ..
|
|
|
|
$ hg id -n
|
|
|
|
1+
|
|
|
|
$ hg update 7
|
merge: let the user choose to merge, keep local or keep remote subrepo revisions
When a subrepo has changed on the local and remote revisions, prompt the user
whether it wants to merge those subrepo revisions, keep the local revision or
keep the remote revision.
Up until now mercurial would always perform a merge on a subrepo that had
changed on the local and the remote revisions. This is often inconvenient. For
example:
- You may want to perform the actual subrepo merge after you have merged the
parent subrepo files.
- Some subrepos may be considered "read only", in the sense that you are not
supposed to add new revisions to them. In those cases "merging a subrepo" means
choosing which _existing_ revision you want to use on the merged revision. This
is often the case for subrepos that contain binary dependencies (such as DLLs,
etc).
This new prompt makes mercurial better cope with those common scenarios.
Notes:
- The default behavior (which is the one that is used when ui is not
interactive) remains unchanged (i.e. merge is the default action).
- This prompt will be shown even if the ui --tool flag is set.
- I don't know of a way to test the "keep local" and "keep remote" options (i.e.
to force the test to choose those options).
# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1378420708 -7200
# Fri Sep 06 00:38:28 2013 +0200
# Node ID 2fb9cb0c7b26303ac3178b7739975e663075857d
# Parent 796d34e1b749b79834321ef1181ed8433a5515d9
merge: let the user choose to merge, keep local or keep remote subrepo revisions
When a subrepo has changed on the local and remote revisions, prompt the user
whether it wants to merge those subrepo revisions, keep the local revision or
keep the remote revision.
Up until now mercurial would always perform a merge on a subrepo that had
changed on the local and the remote revisions. This is often inconvenient. For
example:
- You may want to perform the actual subrepo merge after you have merged the
parent subrepo files.
- Some subrepos may be considered "read only", in the sense that you are not
supposed to add new revisions to them. In those cases "merging a subrepo" means
choosing which _existing_ revision you want to use on the merged revision. This
is often the case for subrepos that contain binary dependencies (such as DLLs,
etc).
This new prompt makes mercurial better cope with those common scenarios.
Notes:
- The default behavior (which is the one that is used when ui is not
interactive) remains unchanged (i.e. merge is the default action).
- This prompt will be shown even if the ui --tool flag is set.
- I don't know of a way to test the "keep local" and "keep remote" options (i.e.
to force the test to choose those options).
2013-09-06 02:38:28 +04:00
|
|
|
subrepository s diverged (local revision: 32a343883b74, remote revision: 32a343883b74)
|
|
|
|
(M)erge, keep (l)ocal or keep (r)emote? m
|
2011-02-09 12:53:09 +03:00
|
|
|
subrepository sources for s differ
|
2011-02-16 20:53:48 +03:00
|
|
|
use (l)ocal source (32a3438) or (r)emote source (32a3438)?
|
2011-02-09 12:53:09 +03:00
|
|
|
l
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg id -n
|
2012-07-27 15:56:19 +04:00
|
|
|
7+
|
2011-02-09 12:53:09 +03:00
|
|
|
$ cd s
|
|
|
|
$ git rev-parse HEAD
|
|
|
|
aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Sticky repository, update --clean
|
2012-03-16 03:02:31 +04:00
|
|
|
$ hg update --clean tip 2>/dev/null
|
2011-02-09 12:53:09 +03:00
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg id -n
|
|
|
|
7
|
|
|
|
$ cd s
|
|
|
|
$ git rev-parse HEAD
|
|
|
|
32a343883b74769118bb1d3b4b1fbf9156f4dddc
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Test subrepo already at intended revision:
|
|
|
|
$ cd s
|
|
|
|
$ git checkout 32a343883b74769118bb1d3b4b1fbf9156f4dddc
|
|
|
|
HEAD is now at 32a3438... fff
|
|
|
|
$ cd ..
|
|
|
|
$ hg update 1
|
|
|
|
Previous HEAD position was 32a3438... fff
|
|
|
|
HEAD is now at da5f5b1... g
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg id -n
|
|
|
|
1
|
|
|
|
$ cd s
|
|
|
|
$ git rev-parse HEAD
|
|
|
|
da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
|
|
|
|
$ cd ..
|
|
|
|
|
2012-04-27 13:02:16 +04:00
|
|
|
Test forgetting files, not implemented in git subrepo, used to
|
|
|
|
traceback
|
2012-06-20 03:09:49 +04:00
|
|
|
#if no-windows
|
2012-04-27 13:02:16 +04:00
|
|
|
$ hg forget 'notafile*'
|
|
|
|
notafile*: No such file or directory
|
|
|
|
[1]
|
2012-06-20 03:09:49 +04:00
|
|
|
#else
|
|
|
|
$ hg forget 'notafile'
|
|
|
|
notafile: * (glob)
|
|
|
|
[1]
|
|
|
|
#endif
|
2012-06-11 03:40:51 +04:00
|
|
|
|
|
|
|
$ cd ..
|