Fixing a damaged 'dirstate' file.

Created by Robert Collins

To fix a dirstate file:
Firstly, backup or move out of the way the .bzr/checkout directory - e.g. 'mv .bzr/checkout bzr_checkout'
Secondly, make a new checkout of the branch - e.g. 'bzr checkout --lightweight . temp-checkout'
Thirdly put the old .bzr/checkout back - e.g. 'mv bzr_checkout .bzr/checkout'
Fourth copy the clean dirstate file from temp-checkout - 'mv .temp-checkout/.bzr/checkout/dirstate .bzr/checkout/dirstate'
Lastly remove the temp checkout - e.g. 'rm -rf temp-checkout'

This will reset your dirstate file. It will forget about pending merges and renamed/added/deleted files.