Comment 4 for bug 551758

Revision history for this message
Andrew Bennetts (spiv) wrote : Re: "bzr blame -rX" and "bzr update -rX" fail: supported?

Thanks very much for the exact instructions and data for reproducing.

The error message is certainly unhelpful, so at minimum we should improve that.

Here's something interesting:

$ bzr st -r2
removed:
  inno/trx/
  inno/trx/trx.c
added:
  inno/trx/
  inno/trx/trx.c

So inno/trx/trx.c in revision 2 is a different file to inno/trx/trx.c in the working tree. Here's confirmation:

$ bzr file-id inno/trx/trx.c
trx.c-20100328163452-arkhzrgwlj1f761f-1
$ bzr inventory -r2 --show-ids | grep trx.c
inno/trx/trx.c trx.c-20100328163754-yhpyfzy03yeeuclh-1

So I think there's a few issues with annotate here:

 1) the error doesn't make this cause clear (that you are asking for the annotation of a version of the file that never existed)
 2) there's no obvious way to annotate that deleted file (this is bug 537442, maybe?)
 3) annotate could/should notice that a file with the same path exists, and assume you meant that instead (and emit a warning about the possible confusion). I can't think of a situation where this would be less desirable than the current behaviour, but we could add a --strict or something if necessary.

Finally, as far as I can tell, 'bzr update -r' is working correctly, but there's a separate issue:
 4) annotate apparently still tries to look up the file in the branch's revision, not the working tree's revision.

Here's a workaround:

$ bzr update -r 2
$ bzr annotate inno/trx/trx.c -r2
1 vasil.d | int a;
2 vasil.d | int b;

So I'm going to refocus this bug on a single issue: 'bzr annotate PATH' after 'bzr update -rX' fails.

The 'bzr annotate -rX path' part is, I think, a dupe of bug 537442, which is that 'bzr annotate -rX path' doesn't work if the file at path in the working tree is not versioned in the rX tree. The "deleted & replaced" case isn't much different to just "deleted", although the symptoms are slightly different.