~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzrtools.py

  • Committer: Aaron Bentley
  • Date: 2007-02-15 18:06:43 UTC
  • Revision ID: abentley@panoramicfeedback.com-20070215180643-v1dxrpumwghryi9r
Fix change dectection for dirstate

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Aaron Bentley
2
 
# <aaron.bentley@utoronto.ca>
 
1
# Copyright (C) 2005, 2006, 2007 Aaron Bentley <aaron.bentley@utoronto.ca>
 
2
# Copyright (C) 2007 John Arbash Meinel
3
3
#
4
4
#    This program is free software; you can redistribute it and/or modify
5
5
#    it under the terms of the GNU General Public License as published by
61
61
    old_tree = cur_tree.basis_tree()
62
62
    new_tree = cur_tree
63
63
    non_source = []
64
 
    for path, file_class, kind, file_id, entry in new_tree.list_files():
65
 
        if file_class in ('?', 'I'):
66
 
            non_source.append(path)
67
 
    delta = new_tree.changes_from(old_tree, want_unchanged=False)
 
64
    new_tree.lock_read()
 
65
    try:
 
66
        for path, file_class, kind, file_id, entry in new_tree.list_files():
 
67
            if file_class in ('?', 'I'):
 
68
                non_source.append(path)
 
69
        delta = new_tree.changes_from(old_tree, want_unchanged=False)
 
70
    finally:
 
71
        new_tree.unlock()
68
72
    return not delta.has_changed(), non_source
69
73
 
70
74
def set_push_data(tree, location):