How can I make only changes in support?

I have a main repo that has some changes that I don’t want to make.

I have a subrepo that already has the changes.

I want to commit changes to subrepo changes in my main repo without making changes to the files in the main repo.

I can not do it. I cannot commit .hgsubstate and make a trivial change to the commit file that does not commit the subrepo changes in the master repo.

+8
mercurial subrepos
source share
1 answer

Pass the name of the file itself for commit, and Mercurial will update .hgsubstate and commit it.

 ry4an@four:~$ hg init main ry4an@four:~$ cd main ry4an@four:~/main$ hg init sub ry4an@four:~/main$ echo sub = sub > .hgsub ry4an@four:~/main$ hg add .hgsub ry4an@four:~/main$ hg commit ry4an@four:~/main$ cd sub ry4an@four:~/main/sub$ echo text > afile ry4an@four:~/main/sub$ hg commit -Am first-in-sub adding afile ry4an@four:~/main/sub$ cd .. ry4an@four:~/main$ hg status ry4an@four:~/main$ echo text > dont-commit-me ry4an@four:~/main$ hg add dont-commit-me ry4an@four:~/main$ hg status A dont-commit-me ry4an@four:~/main$ cat .hgsubstate 0000000000000000000000000000000000000000 sub ry4an@four:~/main$ hg commit -m 'subrepo only' sub ry4an@four:~/main$ hg status A dont-commit-me ry4an@four:~/main$ cat .hgsubstate dec5eaa9e22cd0a05cbba3ba02fdb0e1f243e07e sub 

Note that the file in the main dont-commit-me has never been committed, but updated .hgsubstate .

+9
source share

All Articles