Let "hg add" do nothing

Boris Samorodov bsam at ipt.ru
Tue Aug 21 10:52:30 CDT 2007


On Tue, 21 Aug 2007 03:54:44 -0700 Stuart W. Marks wrote:

> The issue is more nuanced than this. With no args, "hg add" doesn't recursively 
> add files within the current directory; it adds all files anywhere within the 
> current repository. Another respondent (Oberhumer) also mentioned "hg add ." as 
> being equivalent to the current behavior of "hg add", which it is not. [I guess 
> the equivalent should be something like "hg add $(hg root)".]

> I was surprised by this behavior, and I recall having been bitten by it. I too 
> thought that "hg add" would add files only within the current directory, but 
> instead of just adding files "here", it also unexpectedly added files "over 
> there". I hesitate to call this behavior "thermonuclear" or even destructive. 
> It is, however, somewhere between irritating and tedious to recover from 
> mistakes like this.

I'm also concerned about current behaviour. What about:
$ hg add
<add nothing, display a message>
$ hg add .
<add new files recursevly starting from the current directory>
$ hg add --all
<add all files at the hg repository>


WBR
-- 
bsam


More information about the Mercurial mailing list