简体   繁体   中英

ignore certain files on HG pull

Thanks for reading my situation..

My situation is this: RepoA (7GB) - I have read access RepoB (7GB - Forked from RepoA) - I have read/write access, but no admin access, and cannot fork.

I did not set up any of these, but am now the admin of the source code.

Currently a company is doing work in RepoA and we are pulling local and pushing into RepoB where we are also doing work.. This works great, but the repositories are so large it is very annoying.

RepoA has some stuff, RepoB as everything

I created RepoC, which is a clone of B minus all of the gigs of assets. RepoC - cloned from RepoB with hg convert --filemap map.txt RepoB small_clone/RepoC

I now have a very nice manageable 300 MB repository in RepoC (Good). Now RepoB is useless to me.

However when someone makes a change in RepoA, I want that change in RepoC. In the past I have had RepoA in my hgrc, and simply done a hg pull RepoA. But when I do that now from the small repo (RepoC), it brings in all the assets I specified I did not want in RepoC.

Is there a way I can continue to take updates from RepoA that ignore certain directories? Or is there a way after I hg pull from RepoA, that I can prune out any new files I do not want prior to pushing to RepoC. I have not done an HG update, but the gigs of files are showing up in .hg/store/data. I am wondering if I can somehow yank them out of there, then hg update, then commit, then push

Any advice?

Thank you!

There is no direct way - mercurial requires to know the complete history, and that includes all the big assets (there's no shallow clone (yet)).

However you might consider to use some of the extensions which make it easier to deal with huge files or many sub projects:

If these changes to the workflow don't see the right approach (they all have their rough edges - check them carefully), you can only export the patches and import them into the other repository, either manually or even scripted; within repoC something like hg export -rXXX -R path/to/repoB | patch hg export -rXXX -R path/to/repoB | patch might do the trick - but for each revision.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM