/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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-08-23 01:15:41 UTC
  • mfrom: (7520.1.4 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200823011541-nv0oh7nzaganx2qy
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/merge-3.1/+merge/389690

Show diffs side-by-side

added added

removed removed

Lines of Context:
185
185
 
186
186
        :return: True if a change is found. False otherwise
187
187
        """
188
 
        with self.lock_read():
189
 
            # Check pending merges
190
 
            if len(self.get_parent_ids()) > 1:
191
 
                return True
192
 
            if _from_tree is None:
193
 
                _from_tree = self.basis_tree()
194
 
            changes = self.iter_changes(_from_tree)
195
 
            if self.supports_symlinks():
196
 
                # Fast path for has_changes.
197
 
                try:
198
 
                    change = next(changes)
199
 
                    # Exclude root (talk about black magic... --vila 20090629)
200
 
                    if change.parent_id == (None, None):
201
 
                        change = next(changes)
202
 
                    return True
203
 
                except StopIteration:
204
 
                    # No changes
205
 
                    return False
206
 
            else:
207
 
                # Slow path for has_changes.
208
 
                # Handle platforms that do not support symlinks in the
209
 
                # conditional below. This is slower than the try/except
210
 
                # approach below that but we don't have a choice as we
211
 
                # need to be sure that all symlinks are removed from the
212
 
                # entire changeset. This is because in platforms that
213
 
                # do not support symlinks, they show up as None in the
214
 
                # working copy as compared to the repository.
215
 
                # Also, exclude root as mention in the above fast path.
216
 
                changes = filter(
217
 
                    lambda c: c[6][0] != 'symlink' and c[4] != (None, None),
218
 
                    changes)
219
 
                try:
220
 
                    next(iter(changes))
221
 
                except StopIteration:
222
 
                    return False
223
 
                return True
 
188
        raise NotImplementedError(self.has_changes)
224
189
 
225
190
    def check_changed_or_out_of_date(self, strict, opt_name,
226
191
                                     more_error, more_warning):
243
208
                strict = self.branch.get_config_stack().get(opt_name)
244
209
            if strict is not False:
245
210
                err_class = None
246
 
                if (self.has_changes()):
 
211
                if self.has_changes():
247
212
                    err_class = errors.UncommittedChanges
248
213
                elif self.last_revision() != self.branch.last_revision():
249
214
                    # The tree has lost sync with its branch, there is little