0
votes

I read the following tricks in mercurial site,

https://www.mercurial-scm.org/wiki/TipsAndTricks#Undo_an_.27.60hg_add.60.27 https://www.mercurial-scm.org/wiki/TipsAndTricks#Remove_files_that_are_matched_by_.hgignore_but_were_added_in_error

I have lot of local changes like file that are not tracked, files that are modified, files that are added.

I want to commit only the files that are modified.

Although i can test the following command directly on the command prompt, i want to make sure if it is a good practice and not risky to do,

hg st -mn0 | xargs -0 hg ci -l ~/commit.txt

Please let me know your suggestions.

2

2 Answers

1
votes

An alternative to piping in the pathnames is to use the "fileset" feature of Mercurial:

hg -v commit -l ~/commit.txt 'set:modified()'

This should be faster since it involves only one invocation of Mercurial. In any case, it's worth knowing about filesets: for further details, just run hg help filesets

-1
votes
hg st -mn0 | xargs -0 hg ci -l ~/commit.txt 

i could not able to wait for any longer so i just tried the above the command and is working fine