I'm using Mercurial to read and debug a complex project, and my modify of the project can be divided into different group of files clearly. For example, if I modified four files
src1.cc src1.hh src2.cc src2.hh
It's apparent that I can divide them into two file groups such as group src1 includes src1.cc src1.hh
and group src2 includes src2.cc src2.hh
.
I'm wondering if I can revert a group of files by a simple command like 'hg revert group-name-alias' instead of listing all the filename of the group, which is a awful idea if I have modified many files?
Any help really appreciated!
From what I can understand of your use-case, you can:
Use patterns in the hg revert
command. This means that you can
run hg revert src1*
to revert all the first group.
Most probably, though, your stuff is in sub-folders and thankfully
you can specify a parent folder to the revert
command.
So say your files are really like: foo/src1.cc
, foo/src1.hh
,
bar/src2.cc
, bar/src2.hh
. In that case, you can revert all the
second group with hg revert bar
, assuming you're in the top folder.
If you're already in the bar
folder, you can run hg revert .
.
You can specify several patterns.
Use Mercurial queues if each one of your "file groups" is also a different unit of work (a different bug fix or feature). This is not so desirable if all files belong to the same unit of work, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With