~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to shelf.py

  • Committer: Aaron Bentley
  • Date: 2008-10-13 16:46:00 UTC
  • mto: (0.15.25 unshelve)
  • mto: This revision was merged to the branch mainline in revision 3820.
  • Revision ID: aaron@aaronbentley.com-20081013164600-zln9mqci0o02orpi
Allow shelving kind change

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
                if names[0] != names[1] or parents[0] != parents[1]:
54
54
                    self.renames[file_id] = (names, parents)
55
55
                    yield ('rename', file_id) + paths
56
 
                if changed:
 
56
 
 
57
                if kind[0] != kind [1]:
 
58
                    yield ('change kind', file_id, kind[0], kind[1], paths[0])
 
59
                elif changed:
57
60
                    yield ('modify text', file_id)
58
61
 
59
62
    def shelve_rename(self, file_id):
76
79
        inverse_lines = self._inverse_lines(new_lines, file_id)
77
80
        self.shelf_transform.create_file(inverse_lines, s_trans_id)
78
81
 
 
82
    @staticmethod
 
83
    def _content_from_tree(tt, tree, file_id):
 
84
        trans_id = tt.trans_id_file_id(file_id)
 
85
        tt.delete_contents(trans_id)
 
86
        transform.create_from_tree(tt, trans_id, tree, file_id)
 
87
 
 
88
    def shelve_content_change(self, file_id):
 
89
        self._content_from_tree(self.work_transform, self.target_tree, file_id)
 
90
        self._content_from_tree(self.shelf_transform, self.work_tree, file_id)
 
91
 
79
92
    def shelve_creation(self, file_id):
80
93
        kind, name, parent, versioned = self.creation[file_id]
81
94
        version = not versioned[0]