~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: John Arbash Meinel
  • Date: 2011-04-07 10:36:24 UTC
  • mfrom: (5764 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5766.
  • Revision ID: john@arbash-meinel.com-20110407103624-n76g6tjeqmznwdcd
Merge bzr.dev 5764 to resolve release-notes (aka NEWS) conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
import stat
45
45
import re
46
46
 
47
 
import bzrlib
48
47
from bzrlib import (
49
48
    branch,
50
49
    bzrdir,
58
57
    ignores,
59
58
    inventory,
60
59
    merge,
61
 
    registry,
62
60
    revision as _mod_revision,
63
61
    revisiontree,
64
 
    trace,
 
62
    rio as _mod_rio,
65
63
    transform,
66
64
    transport,
67
65
    ui,
98
96
from bzrlib.trace import mutter, note
99
97
from bzrlib.transport.local import LocalTransport
100
98
from bzrlib.revision import CURRENT_REVISION
101
 
from bzrlib.rio import RioReader, rio_file, Stanza
102
99
from bzrlib.symbol_versioning import (
103
100
    deprecated_passed,
104
101
    DEPRECATED_PARAMETER,
891
888
            if revision_id in heads and revision_id not in new_revision_ids:
892
889
                new_revision_ids.append(revision_id)
893
890
        if new_revision_ids != revision_ids:
894
 
            trace.mutter('requested to set revision_ids = %s,'
 
891
            mutter('requested to set revision_ids = %s,'
895
892
                         ' but filtered to %s', revision_ids, new_revision_ids)
896
893
        return new_revision_ids
897
894
 
963
960
    def set_merge_modified(self, modified_hashes):
964
961
        def iter_stanzas():
965
962
            for file_id, hash in modified_hashes.iteritems():
966
 
                yield Stanza(file_id=file_id.decode('utf8'), hash=hash)
 
963
                yield _mod_rio.Stanza(file_id=file_id.decode('utf8'),
 
964
                    hash=hash)
967
965
        self._put_rio('merge-hashes', iter_stanzas(), MERGE_MODIFIED_HEADER_1)
968
966
 
969
967
    def _sha_from_stat(self, path, stat_result):
978
976
 
979
977
    def _put_rio(self, filename, stanzas, header):
980
978
        self._must_be_locked()
981
 
        my_file = rio_file(stanzas, header)
 
979
        my_file = _mod_rio.rio_file(stanzas, header)
982
980
        self._transport.put_file(filename, my_file,
983
981
            mode=self.bzrdir._get_file_mode())
984
982
 
1048
1046
                    raise errors.MergeModifiedFormatError()
1049
1047
            except StopIteration:
1050
1048
                raise errors.MergeModifiedFormatError()
1051
 
            for s in RioReader(hashfile):
 
1049
            for s in _mod_rio.RioReader(hashfile):
1052
1050
                # RioReader reads in Unicode, so convert file_ids back to utf8
1053
1051
                file_id = osutils.safe_file_id(s.get("file_id"), warn=False)
1054
1052
                if file_id not in self.inventory:
2354
2352
                                             show_base=show_base)
2355
2353
            if nb_conflicts:
2356
2354
                self.add_parent_tree((old_tip, other_tree))
2357
 
                trace.note('Rerun update after fixing the conflicts.')
 
2355
                note('Rerun update after fixing the conflicts.')
2358
2356
                return nb_conflicts
2359
2357
 
2360
2358
        if last_rev != _mod_revision.ensure_null(revision):
2754
2752
                    raise errors.ConflictFormatError()
2755
2753
            except StopIteration:
2756
2754
                raise errors.ConflictFormatError()
2757
 
            return _mod_conflicts.ConflictList.from_stanzas(RioReader(confile))
 
2755
            reader = _mod_rio.RioReader(confile)
 
2756
            return _mod_conflicts.ConflictList.from_stanzas(reader)
2758
2757
        finally:
2759
2758
            confile.close()
2760
2759