/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: Vincent Ladeuil
  • Date: 2019-06-18 11:21:15 UTC
  • mfrom: (7290.1.31 work)
  • mto: This revision was merged to the branch mainline in revision 7351.
  • Revision ID: v.ladeuil+brz@free.fr-20190618112115-578pnbegj3bnc6pa
Merge 3.0 resolving conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
import errno
33
33
import os
34
 
import re
35
34
import sys
36
35
 
37
36
import breezy
68
67
    )
69
68
from .i18n import gettext
70
69
from . import mutabletree
 
70
from .symbol_versioning import deprecated_method, deprecated_in
71
71
from .trace import mutter, note
72
72
 
73
73
 
1233
1233
        """
1234
1234
        raise NotImplementedError(self.walkdirs)
1235
1235
 
 
1236
    @deprecated_method(deprecated_in((3, 0, 1)))
1236
1237
    def auto_resolve(self):
1237
1238
        """Automatically resolve text conflicts according to contents.
1238
1239
 
1246
1247
        with self.lock_tree_write():
1247
1248
            un_resolved = _mod_conflicts.ConflictList()
1248
1249
            resolved = _mod_conflicts.ConflictList()
1249
 
            conflict_re = re.compile(b'^(<{7}|={7}|>{7})')
1250
1250
            for conflict in self.conflicts():
1251
 
                path = self.id2path(conflict.file_id)
1252
 
                if (conflict.typestring != 'text conflict' or
1253
 
                        self.kind(path) != 'file'):
 
1251
                try:
 
1252
                    conflict.action_auto(self)
 
1253
                except NotImplementedError:
1254
1254
                    un_resolved.append(conflict)
1255
 
                    continue
1256
 
                with open(self.abspath(path), 'rb') as my_file:
1257
 
                    for line in my_file:
1258
 
                        if conflict_re.search(line):
1259
 
                            un_resolved.append(conflict)
1260
 
                            break
1261
 
                    else:
1262
 
                        resolved.append(conflict)
1263
 
            resolved.remove_files(self)
 
1255
                else:
 
1256
                    conflict.cleanup(self)
 
1257
                    resolved.append(conflict)
1264
1258
            self.set_conflicts(un_resolved)
1265
1259
            return un_resolved, resolved
1266
1260