Bazaar completely lost files by "revert"

John Arbash Meinel john at arbash-meinel.com
Fri Feb 24 15:47:00 UTC 2012


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

On 2/24/2012 4:24 PM, Artur Rataj wrote:
> Fortunately, revert appears to change only the local tree, so I
> have found the original files on the master tree.
> 
> I am sorry for needlessly disturbing you.
> 
> Cheers, Artur
> 

bzr only saves ~1~ style files if you cannot reconstruct the text from
the committed revision. (eg if you do "bzr revert -r -2" and can get
back the original text with "bzr revert" then we don't save backup
files, because they are just noise.) If you have local changes to a
file, *then* we save the backup.

For example:

echo a > a
echo b > b
bzr init
bzr commit -m "start"
echo aa > a
echo bb > b
bzr commit -m "add aa and bb"


echo bbb > b
bzr revert -r -2

At this point, there should be a b.~1~ but not an a.~1~ because you
had content in B that cannot be reproduced (doing bzr revert will
restore a to what it was before the revert -r -2, but cannot restore
the content of b).

It is a little more complex than that, because after 'bzr merge' you
have files which may not be exactly the same as any committed
revision. But if you 'bzr revert' we don't create backups of all of
them, because you are able to just 'bzr merge' to get the content back
again. (Unless you did merge and then locally modified it, in which
case we *do* save a backup.)

I would agree that it could be documented more clearly in 'bzr help
revert', I'm not sure how to say it succinctly, though.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9HsPQACgkQJdeBCYSNAAP+AgCeKDi5e8WeLgjJtxv4azZqYEU7
fXoAn0AI7du0j4khMtO68dfulKyE6qU/
=9W+I
-----END PGP SIGNATURE-----



More information about the bazaar mailing list