warning message when adding large files

Cathy Riemer cathy+hglist at bx.psu.edu
Sun Apr 3 12:06:29 CDT 2011


On Fri, Apr 01, 2011 at 02:54:53PM -0500, Matt Mackall wrote:
> On Fri, 2011-04-01 at 21:36 +0200, Adrian Buehlmann wrote:
> > On 2011-04-01 18:50, Cathy Riemer wrote:
> > > On Fri, Apr 01, 2011 at 06:27:50PM +0200, Adrian Buehlmann wrote:
> > >> On 2011-04-01 17:45, Cathy Riemer wrote:
> > >>> 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.
> > >>
> > >> But hg help revert also says:
> > >>
> > >> "This restores the contents of the affected files to an unmodified
> > >> state and unschedules adds, removes, copies, and renames."
> > >>
> > >> Note the "unschedules adds".
> > > 
> > > Yes, I saw that, but it doesn't say what it would do about my working
> > > file.
> > 
> > Indeed. What about this tweak:
> > 
> > diff --git a/mercurial/commands.py b/mercurial/commands.py
> > --- a/mercurial/commands.py
> > +++ b/mercurial/commands.py
> > @@ -3370,8 +3370,9 @@
> >      directory, the reverted files will thus appear modified
> >      afterwards.
> > 
> > -    If a file has been deleted, it is restored. If the executable mode
> > -    of a file was changed, it is reset.
> > +    If a file has been deleted, it is restored. Files scheduled for
> > +    addition are just unscheduled and left as they are. If the
> > +    executable mode of a file was changed, it is reset.
> > 
> >      If names are given, all files matching the names are reverted.
> >      If no arguments are given, no files are reverted.
> 
> Sure. I'll also take a patch that changes the warning to mention
> 'forget'.

Both of those sound good to me -- thanks!



More information about the Mercurial-devel mailing list