/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/mutabletree.py

merge Parth's work into Breezy

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
            if _from_tree is None:
198
198
                _from_tree = self.basis_tree()
199
199
            changes = self.iter_changes(_from_tree)
200
 
            try:
201
 
                change = next(changes)
202
 
                # Exclude root (talk about black magic... --vila 20090629)
203
 
                if change[4] == (None, None):
 
200
            if osutils.has_symlinks():
 
201
                # Fast path for has_changes.
 
202
                try:
204
203
                    change = next(changes)
205
 
                return True
206
 
            except StopIteration:
207
 
                # No changes
 
204
                    # Exclude root (talk about black magic... --vila 20090629)
 
205
                    if change[4] == (None, None):
 
206
                        change = next(changes)
 
207
                    return True
 
208
                except StopIteration:
 
209
                    # No changes
 
210
                    return False
 
211
            else:
 
212
                # Slow path for has_changes.
 
213
                # Handle platforms that do not support symlinks in the
 
214
                # conditional below. This is slower than the try/except
 
215
                # approach below that but we don't have a choice as we
 
216
                # need to be sure that all symlinks are removed from the
 
217
                # entire changeset. This is because in plantforms that
 
218
                # do not support symlinks, they show up as None in the
 
219
                # working copy as compared to the repository.
 
220
                # Also, exclude root as mention in the above fast path.
 
221
                changes = filter(
 
222
                    lambda c: c[6][0] != 'symlink' and c[4] != (None, None),
 
223
                    changes)
 
224
                if len(changes) > 0:
 
225
                    return True
208
226
                return False
209
227
 
210
228
    def check_changed_or_out_of_date(self, strict, opt_name,