~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/delta.py

  • Committer: Martin Pool
  • Date: 2006-01-13 07:37:48 UTC
  • mto: (1185.50.49 bzr-jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1549.
  • Revision ID: mbp@sourcefrog.net-20060113073748-d6893fbd5454d5a4
[cherrypick] Hold locks around entire diff operations to avoid thrashing
hashcache.  (from denys)

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
        files within them.
161
161
    """
162
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
 
163
177
    from osutils import is_inside_any
164
178
    
165
179
    old_inv = old_tree.inventory