/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/workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2020-08-10 15:00:17 UTC
  • mfrom: (7490.40.99 work)
  • mto: This revision was merged to the branch mainline in revision 7521.
  • Revision ID: jelmer@jelmer.uk-20200810150017-vs7xnrd1vat4iktg
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
WorkingTree.open(dir).
28
28
"""
29
29
 
30
 
from __future__ import absolute_import
31
 
 
 
30
import contextlib
32
31
import errno
33
32
import os
34
33
import sys
41
40
import stat
42
41
 
43
42
from breezy import (
44
 
    cleanup,
45
43
    conflicts as _mod_conflicts,
46
44
    filters as _mod_filters,
47
45
    merge,
1002
1000
    def revert(self, filenames=None, old_tree=None, backups=True,
1003
1001
               pb=None, report_changes=False):
1004
1002
        from .conflicts import resolve
1005
 
        with cleanup.ExitStack() as exit_stack:
 
1003
        with contextlib.ExitStack() as exit_stack:
1006
1004
            exit_stack.enter_context(self.lock_tree_write())
1007
1005
            if old_tree is None:
1008
1006
                basis_tree = self.basis_tree()
1221
1219
        """Walk the directories of this tree.
1222
1220
 
1223
1221
        returns a generator which yields items in the form:
1224
 
                ((curren_directory_path, fileid),
1225
 
                 [(file1_path, file1_name, file1_kind, (lstat), file1_id,
 
1222
                (current_directory_path,
 
1223
                 [(file1_path, file1_name, file1_kind, (lstat),
1226
1224
                   file1_kind), ... ])
1227
1225
 
1228
1226
        This API returns a generator, which is only valid during the current
1242
1240
        into files that have text conflicts.  The corresponding .THIS .BASE and
1243
1241
        .OTHER files are deleted, as per 'resolve'.
1244
1242
 
1245
 
        :return: a tuple of ConflictLists: (un_resolved, resolved).
 
1243
        :return: a tuple of lists: (un_resolved, resolved).
1246
1244
        """
1247
1245
        with self.lock_tree_write():
1248
 
            un_resolved = _mod_conflicts.ConflictList()
1249
 
            resolved = _mod_conflicts.ConflictList()
 
1246
            un_resolved = []
 
1247
            resolved = []
1250
1248
            for conflict in self.conflicts():
1251
1249
                try:
1252
1250
                    conflict.action_auto(self)