Mercurial Digest, Vol 28, Issue 41

Brendan Cully brendan at kublai.com
Sat Aug 25 18:25:57 CDT 2007


On Saturday, 25 August 2007 at 19:15, Maxim Khitrov wrote:
> On 8/25/07, Brian Baker <brian_e_baker at yahoo.com> wrote:
> > > Second, I'm actually not sure what it
> > > is that you want hg add to do... I started using mercurial about 3
> > > months ago and have never been surprised by any functionality,
> > > including hg add. Everything worked exactly as I expected it to. If
> > > you read the documentation you should have no surprises.
> > > Third, what do you mean by default behavior? Using hg add with no
> > > parameters? Yes, I use that constantly. I don't think I've ever had
> > to
> > > specify a parameter when doing hg add. Run hg status to see what is
> > > about to happen then run hg add or hg addremove to get your files in
> > > and/or out of the repository. If you don't want something added,
> > > create hgignore rules.
> >
> > Due to working practices beyond my control I want to be able to use
> > mercurial in a 'lightweight' way. I've got a big source tree with lots
> > of files, and I want to version control just the ones that I edit.
> > These files are spread fairly sparsely through the large tree, I add
> > each file that I edit.
> >
> > hg add with no arguments adds everything
> > there isn't an unadd command
> > One typo and its a headache to tidy up.
> >
> > I appreciate that this isn't the 'normal' way of using Mercurial.
> > However, the fact that the add command default behaviour can cause wide
> > ranging changes that can't be readily undone says to me that perhaps
> > the interface should be reconsidered.
> >
> > With CVS at least you can manually edit the files used to manage the
> > repository to unadd files before a commit.
> >
> > Brian
> 
> hg revert is more than happy to unadd files. If you run hg add in a
> brand new repository, simply run hg revert --all. Your repository is
> now back in the original state. Here's a way to revert files even if
> there are others with changed status:
> 
> hg status | grep '^A' | sed 's/A //' | xargs hg revert
> 
> Might be an easier way to do this, but you get the idea. Nothing

hg st -na0 | xargs -0 hg revert

But I personally can see the appeal of requiring an argument to hg
add.


More information about the Mercurial mailing list