Mercurial: can I ignore the file for push / pull, but still commit? (.hgsub)

I have a repo with two subrepositions configured as follows:

project/ |-- folder1 |-- folder2 |-- www [subrepo] |-- dev [subrepo] 

On machine A, I checked the project, www and dev, and modified .hgsub as such. I have to fix this so that www and dev subtexts are recognized by hg (commit -S etc.).

However, machine B uses only the WWW project project, so it looks like this:

 project/ |-- folder1 |-- folder2 |-- www [subrepo] 

Again, the .hgsub in Machine B only has an entry for www, and I have to commit this to hg in order to recognize it as a subrepo.

What I would like to do is push and pull towards my central repo, but DO NOT push / pull .hgsub. Otherwise, if I commit and click .hgsub from Machine A and then pull it out from Machine B, I automatically get subrepo dev, as well as www support, which I don't want.

So, I am modifying .hgsub again on machine B to only have www and commit it for it to take effect. I am doing some work at www subrepo on Machine B and want to go back to the central repo, but it will also push the change to .hgsub. Now, when I pull out machine A, my β€œdev” backup is gone, and I have to add it back to .hgsub again, and I go back and forth so long as I don't pull my hair out of frustration.

Is there a way around this? .Hgsub needs to be locally locked on each machine for the subposts to work, but I don't want them to be clicked or pulled out. Is there a .hgignore for push / pull?

greetings.

+4
source share
1 answer

Push / pull does not work with files; it works with change sets.

So there is no way to push / pull a partial set of changes, either you push, or pull it, or not.

If you do not want the repository to always contain this file / subrepository, you should not organize your projects. Instead, you may want to study setting up a secondary project with only the subrepositories that are needed for this other site.

In other words, you can look at the presence of two projects, one with all sub-repositories, the other with several.

+6
source

Source: https://habr.com/ru/post/1369079/


All Articles