简体   繁体   中英

Commit a lot of files (on windows) using hg command line?

I have a repository with a lot of files. There are about 5000+ files in there. Usually I commit only changes to about 20-30 of them at once. But every now and then we merge in an rather large update and the number of changed files can go up very fast.

I can do this very easily on TortoiseHg. I select the files I want to commit and do so.

The problem is, that I need to do this from within a C# program. Currently I am using System.Diagnostics.Process to do so, running hg.exe and passing all the files to be committed as arguments.

But if there are lots of files and the commit message is long, I exceed the windows limit of 32k bytes of command line.

Is there any workaround I can use? Somehow give hg.exe a file with the commands or something similar?

I also tried to read the source code of TortoiseHg to check how they are managing it, but it's quite a project so I could not (yet) track down the point where the actual hg-command is launched.

Use listfile: to specify a file that contains a list of files. See File Name Patterns for details.

You can also specify that the commit message come from a file using --logfile <FILE>

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