warning message when adding large files

Cathy Riemer cathy+hglist at bx.psu.edu
Fri Apr 1 10:45:32 CDT 2011


On Fri, Apr 01, 2011 at 12:37:54PM +0200, Martin Geisler wrote:
> timeless <timeless at gmail.com> writes:
> 
> > On Thu, Mar 31, 2011 at 9:08 PM, Matt Mackall <mpm at selenic.com> wrote:
> >>> I don't understand why it suggests using "revert".  Shouldn't that
> >>> be "forget"?
> >>
> >> They'll both give the same result, moving the file from added to
> >> unknown.
> >
> > Offhand, I think i'd like to see us use 'forget' in this message.
> 
> I like revert since it might remind people that 'hg revert' is how you
> remove lines from the output of 'hg status':
> 
>   $ hg status
>   M a
>   ! b
>   R c
>   $ hg revert a b c
>   $ hg status
> 
> That is not true for 'hg forget' which wont restore deleted files or
> revert modified files.

But I was adding *new* files (and I imagine that is the usual
case when this message is encountered).  I think at least part
of the problem lies in the documentation.

"hg help revert" notes that "This command is most likely not
what you are looking for", and says that it "modifies the working
directory" and will "revert the named files or directories to
the contents they had in the parent of the working directory".
Since I was adding new files, this could mean that my working
copies would get deleted to match the parent.  I did not want to
modify the working directory, just unschedule the pending adds.

In contrast, "hg help add" suggests using forget to undo it,
and "hg help forget" sounds like just what I wanted.  But when
I looked online, I found people saying that forget was deprecated
and "didn't work well" (no specifics), so I didn't know what to
do.  I wondered why the help pages didn't mention that forget was
deprecated.  More digging turned up a post saying that forget was
"reintroduced" so I went ahead and used it, and it seemed to
work just fine.

As a new user, this inconsistency was quite offputting.  Eventually
I found an example for revert at
http://hgbook.red-bean.com/read/finding-and-fixing-mistakes.html
saying "Don't worry; Mercurial will not modify the file in any way.
It will just 'unmark' the file."  So I guess I wasn't the only one
to think that it would, and I'd like to humbly suggest that if this
reassurance is necessary, then the UI is less intuitive than it
could be, and/or needs to be explained better in the help pages.
I am still a little afraid of revert, because I don't really
understand what it will or won't do in a given situation.



More information about the Mercurial-devel mailing list