remove vs rm vs forget (was [MERGE] remove --new)

Aaron Bentley aaron.bentley at utoronto.ca
Mon Jun 5 01:15:04 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Widhopf-Fenk wrote:
> "hg forget" will only undo a "hg add", if used on an already
> versioned file it will not unversion it.  In order to
> unversion a file you have to use "hg remove".

According to Bryan O'Sullivan and Matt Mackall, who are sitting across
from me, "hg forget" is deprecated, and will go away in the future.  'hg
revert' is recommended for that purpose.

It sounds as if in the future, you'll be able to use 'hg remove -A' to
unversion any file without deleting it.

> I like that
> bzr has no extra command for this, but "bzr revert".

I'm not sure what you mean.

> So "forget" is IMHO
> a good name for tlas "delete-id" while not being consistent
> with hg ... as Matthew said probably an option --no-delete
> will do as well.  

I'd actually be happy with requiring a flag to unversion a file without
deleting it, because I think that's a relatively uncommon need, and it's
 reasonably discoverable.

> BTW "bzr revert" (and "bzr remove") is so quiet while most
> other commands provide some messages what they are doing,
> but it does not seem to be one line change.

Showing everything they're doing would usually be extremely verbose.  So
I could see doing it if -v were supplied.

> And then since the file currently is not delete from the
> working tree one gets  the warning below which is kind of
> odd if the file was not modified.
> 
> /tmp/a > bzr remove f
> /tmp/a > bzr revert
> bzr: WARNING: Conflict adding file f.  Moved existing file to f.moved.
> /tmp/a > hg rm f
> /tmp/a > hg revert
> undeleting f
> /tmp/a > echo abcd >> f
> /tmp/a > hg rm f
> not removing f: file is modified
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEg3eI0F+nu1YWqI0RAiNfAJ0VAfj8O57IkEBoqIqV8hG8XIRTfgCdFHTT
AUbG44eByRdpUk9uWpw2Iak=
=CCDy
-----END PGP SIGNATURE-----




More information about the bazaar mailing list