Question

New to using Mercurial.

I've got a workspace in a Jenkins installation and I want to diff, commit and push only two of the changed files. the result of hg st looks like this:

M version/build_driver.sh
M version/client_version.txt
M version/server_version.txt
M version/update_client.sh
M version/update_server.sh

I only want to diff, commit, and checkin the files

M version/client_version.txt
M version/server_version.txt

to my mercurial source code repository. Can anyone help me with this?

Was it helpful?

Solution

For hg diff, either give the -I option multiple times:

hg diff -I version/client_version.txt -I version/server_version.txt

or use shell glob syntax:

hg diff -I 'version/{server,client}_version.txt'

For hg commit, either use the same syntax or just list the files on the command line without a -I:

hg commit version/{server,client}_version.txt

And hg push doesn't need a filename argument.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top