~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to reweave_inventory.py

  • Committer: Aaron Bentley
  • Date: 2005-11-08 17:24:19 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20051108172419-80f4f57367e40dab
Added CREDITS

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
import os
35
35
 
36
 
class cmd_fix(Command):
 
36
class cmd_force_reweave_inventory(Command):
37
37
    """Force-reweave the inventory in this branch.
38
38
 
39
39
    The branch URL *MUST* be on the local filesystem."""
47
47
        finally:
48
48
            branch.unlock()
49
49
 
50
 
    @staticmethod
51
 
    def _do_reweave(branch, branch_dir):
52
 
        inventory_weave = branch._get_inventory_weave()
 
50
    def _do_reweave(self, branch, branch_dir):
 
51
        inventory_weave = branch.get_inventory_weave()
53
52
 
54
53
        new_weave = bzrlib.weave.Weave()
55
54
 
75
74
                
76
75
        progress.update('Writing weave')
77
76
 
78
 
        out_file_name = os.path.join(branch_dir, ".bzr", "inventory.weave")
79
 
        f = open(out_file_name+".tmp", "w")
 
77
        f = open(os.path.join(branch_dir, ".bzr", "inventory.weave"), "w")
80
78
        w5(new_weave, f)
81
79
        f.close()
82
 
        os.rename(out_file_name+".tmp", out_file_name)
83
80
 
84
81
        progress.clear()