Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include more than one file pattern in Mercurial command

Tags:

mercurial

Mercurial 1.7.5 on Windows.

I have a few files I have modified, and want to split them into two commits. To do so, I'm playing with the -I (or --include) option. Docs state:

-I --include PATTERN [+]     include names matching the given patterns

I haven't been able to figure out how to include more than one pattern yet. I've tried:

hg status -I C:\folderToSolution\Project1\**.cs C:\folderToSolution\Project3\**.cs
hg status -I C:\folderToSolution\Project1\**.cs +C:\folderToSolution\Project3\**.cs

(Using status to test my pattern before committing.)

What's the syntax for getting more than one pattern in the option?

like image 933
Remi Despres-Smyth Avatar asked Mar 09 '11 20:03

Remi Despres-Smyth


People also ask

How do I create a Mercurial repository?

Create a local Mercurial repository Open the project you want to store in a repository. From the main menu, choose Hg | Create Mercurial Repository. Specify the location of the new repository.

How do you Uncommit in Heartgold?

A simple way to 'uncommit' your last commit is to use hg strip -r -1 -k. In case the link breaks, the documentation mentioned by @phb states: hg rollback Roll back the last transaction (DANGEROUS) (DEPRECATED) Please use 'hg commit --amend' instead of rollback to correct mistakes in the last commit.

How do I remove untracked files from Mercurial?

To remove all untracked files, you can use the purge extension and run hg purge .


1 Answers

Specify -I before each pattern

hg status -I C:\folderToSolution\Project1\**.cs -I C:\folderToSolution\Project3\**.cs

The [+] in the documentation means that the option can be specified more than once.

like image 147
Tobias Furuholm Avatar answered Sep 21 '22 17:09

Tobias Furuholm