revert after add destroy my working tree
Bug #193980 reported by
Alexander Belchenko
This bug report is a duplicate of:
Bug #87548: bzr add and revert on symlink deletes symlink.
Edit
Remove
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
New
|
Undecided
|
Unassigned |
Bug Description
I have big sources tree without version control and want to put it under bzr control. I did:
$ bzr init
$ bzr add # Oops! I don't want all dirs to be under control!
Then I did
$ bzr revert
and bzr removed all empty directories and symlinks. And therefore destroyed my working tree almost entirely.
I think it's inappropriate, completely wrong, stupid and ugly behavior.
To post a comment you must log in.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Alexander Belchenko wrote:
> and bzr removed all empty directories and symlinks. And therefore
> destroyed my working tree almost entirely.
Revert can't tell whether it's reverting an add or a merge. All it
knows is whether the files it's reverting were automatically generated.
This only applies to regular files, not symlinks and directories. We
have no way of retaining only user-modified symlinks and directories.
If we retain all symlinks and directories, then bzr's ability to revert
to historical revisions and to revert merges would be compromised.
> I think it's inappropriate, completely wrong, stupid and ugly behavior.
I understand that you're upset, but when you call my work stupid and
ugly, that makes *me* upset, and then I don't want to help you.
There is a command to do what you want: "remove --new --keep".
I actually am not sure the current behavior is inappropriate. It seems
to me that the behavior you want is "undo", not "revert". Revert has
been changed to try to behave more like undo for people who expect it
to, but ultimately, it does not have enough data to do this perfectly.
We don't have a complete record of the state prior to the change being
undone, which is what we would need to implement "undo".
And of course, symlinks and empty directories are much easier to create
than files, so we've historically placed less importance on preserving them.
Aaron enigmail. mozdev. org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iD8DBQFHvY4J0F+ nu1YWqI0RAp+ FAJ0Xr2ZN5AAbP4 F375fVcH777GnEb gCgh85j igaEO+UyI=
IzTP77j1GxXz5/
=oltl
-----END PGP SIGNATURE-----