~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/shelf.py

  • Committer: John Arbash Meinel
  • Date: 2010-08-13 19:08:57 UTC
  • mto: (5050.17.7 2.2)
  • mto: This revision was merged to the branch mainline in revision 5379.
  • Revision ID: john@arbash-meinel.com-20100813190857-mvzwnimrxvm0zimp
Lots of documentation updates.

We had a lot of http links pointing to the old domain. They should
all now be properly updated to the new domain. (only bazaar-vcs.org
entry left is for pqm, which seems to still reside at the old url.)

Also removed one 'TODO' doc entry about switching to binary xdelta, since
we basically did just that with groupcompress.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    errors,
24
24
    merge,
25
25
    merge3,
26
 
    osutils,
27
26
    pack,
28
27
    transform,
29
 
    ui,
30
 
    workingtree,
31
28
)
32
29
 
33
30
 
37
34
    def __init__(self, work_tree, target_tree, file_list=None):
38
35
        """Constructor.
39
36
 
40
 
        :param work_tree: The working tree to apply changes to
 
37
        :param work_tree: The working tree to apply changes to. This is not
 
38
            required to be locked - a tree_write lock will be taken out.
41
39
        :param target_tree: The tree to make the working tree more similar to.
 
40
            This is not required to be locked - a read_lock will be taken out.
42
41
        :param file_list: The files to make more similar to the target.
43
42
        """
44
43
        self.work_tree = work_tree
73
72
        """
74
73
        for (file_id, paths, changed, versioned, parents, names, kind,
75
74
             executable) in self.iter_changes:
 
75
            # don't shelve add of tree root.  Working tree should never
 
76
            # lack roots, and bzr misbehaves when they do.
 
77
            # FIXME ADHB (2009-08-09): should still shelve adds of tree roots
 
78
            # when a tree root was deleted / renamed.
 
79
            if kind[0] is None and names[1] == '':
 
80
                continue
76
81
            if kind[0] is None or versioned[0] == False:
77
82
                self.creation[file_id] = (kind[1], names[1], parents[1],
78
83
                                          versioned)
104
109
            self.shelve_deletion(change[1])
105
110
        elif change[0] == 'add file':
106
111
            self.shelve_creation(change[1])
107
 
        elif change[0] == 'change kind':
 
112
        elif change[0] in ('change kind', 'modify text'):
108
113
            self.shelve_content_change(change[1])
109
114
        elif change[0] == 'modify target':
110
115
            self.shelve_modify_target(change[1])
111
116
        else:
112
117
            raise ValueError('Unknown change kind: "%s"' % change[0])
113
118
 
 
119
    def shelve_all(self):
 
120
        """Shelve all changes."""
 
121
        for change in self.iter_shelvable():
 
122
            self.shelve_change(change)
 
123
 
114
124
    def shelve_rename(self, file_id):
115
125
        """Shelve a file rename.
116
126