~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/delta.py

  • Committer: Olaf Conradi
  • Date: 2006-03-28 23:30:02 UTC
  • mto: (1661.1.1 bzr.mbp.remember)
  • mto: This revision was merged to the branch mainline in revision 1663.
  • Revision ID: olaf@conradi.org-20060328233002-f6262df0e19c1963
Added testcases for using pull with --remember. Moved remember code to
beginning of cmd_pull. This remembers the location in case of a failure
during pull.

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
            print >>to_file, 'added:'
115
115
            show_list(self.added)
116
116
 
 
117
        extra_modified = []
 
118
 
117
119
        if self.renamed:
118
120
            print >>to_file, 'renamed:'
119
121
            for (oldpath, newpath, fid, kind,
120
122
                 text_modified, meta_modified) in self.renamed:
 
123
                if text_modified or meta_modified:
 
124
                    extra_modified.append((newpath, fid, kind,
 
125
                                           text_modified, meta_modified))
121
126
                if meta_modified:
122
127
                    newpath += '*'
123
128
                if show_ids:
125
130
                else:
126
131
                    print >>to_file, '  %s => %s' % (oldpath, newpath)
127
132
                    
128
 
        if self.modified:
 
133
        if self.modified or extra_modified:
129
134
            print >>to_file, 'modified:'
130
135
            show_list(self.modified)
 
136
            show_list(extra_modified)
131
137
            
132
138
        if show_unchanged and self.unchanged:
133
139
            print >>to_file, 'unchanged:'
154
160
        files within them.
155
161
    """
156
162
 
 
163
    old_tree.lock_read()
 
164
    try:
 
165
        new_tree.lock_read()
 
166
        try:
 
167
            return _compare_trees(old_tree, new_tree, want_unchanged,
 
168
                                  specific_files)
 
169
        finally:
 
170
            new_tree.unlock()
 
171
    finally:
 
172
        old_tree.unlock()
 
173
 
 
174
 
 
175
def _compare_trees(old_tree, new_tree, want_unchanged, specific_files):
 
176
 
157
177
    from osutils import is_inside_any
158
178
    
159
179
    old_inv = old_tree.inventory
219
239
 
220
240
    mutter('start looking for new files')
221
241
    for file_id in new_inv:
222
 
        if file_id in old_inv:
 
242
        if file_id in old_inv or file_id not in new_tree:
223
243
            continue
224
244
        kind = new_inv.get_file_kind(file_id)
225
245
        if kind == 'root_directory':