Comment 1 for bug 177809

Revision history for this message
Alexander Belchenko (bialix) wrote :

I agree that bzr should report about already moved things until it encounters error. But I don't think bzr should continue to work if some error encountered. So I'd like to fix reporting problem rather than made all moves independent.

To fix problem with reporting I think we should extent arguments of tree.move() method with one optional argument `report`. This argument could be a list object to accumulate finished moves info. So if error will be raised command mv still will be able to get report and show it in finally block. Something like this:

# move into existing directory
report = []
try:
     tree.move(rel_names[:-1], rel_names[-1], after=after, report=report)
finally:
    for pair in report:
        self.outf.write("%s => %s\n" % pair)

IMO it will be simplier to implementing and testing. But will require additional tests in bzrlib/tests/workingtree_implementations/

Spencer, do you want to rework your patch in this way? If not I'll do it.