~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

Move Branch.unknowns() to WorkingTree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
from binascii import hexlify
73
73
from cStringIO import StringIO
74
74
 
 
75
from bzrlib.atomicfile import AtomicFile
75
76
from bzrlib.osutils import (local_time_offset,
76
77
                            rand_bytes, compact_date,
77
78
                            kind_marker, is_inside_any, quotefn,
91
92
from bzrlib.inventory import Inventory, ROOT_ID
92
93
from bzrlib.weave import Weave
93
94
from bzrlib.weavefile import read_weave, write_weave_v5
94
 
from bzrlib.atomicfile import AtomicFile
 
95
from bzrlib.workingtree import WorkingTree
95
96
 
96
97
 
97
98
def commit(*args, **kwargs):
123
124
    def missing(self, path):
124
125
        pass
125
126
 
 
127
 
126
128
class ReportCommitToLog(NullCommitReporter):
127
129
 
128
130
    def snapshot_change(self, change, path):
140
142
    def missing(self, path):
141
143
        note('missing %s', path)
142
144
 
 
145
 
143
146
class Commit(object):
144
147
    """Task of committing a new revision.
145
148
 
204
207
        self.specific_files = specific_files
205
208
        self.allow_pointless = allow_pointless
206
209
        self.revprops = revprops
 
210
        self.work_tree = WorkingTree(branch.base, branch)
207
211
 
208
212
        if strict:
209
213
            # raise an exception as soon as we find a single unknown.
210
 
            for unknown in branch.unknowns():
 
214
            for unknown in self.work_tree.unknowns():
211
215
                raise StrictCommitFailed()
212
216
 
213
217
        if timestamp is None:
240
244
 
241
245
        self.branch.lock_write()
242
246
        try:
243
 
            self.work_tree = self.branch.working_tree()
244
247
            self.work_inv = self.work_tree.inventory
245
248
            self.basis_tree = self.branch.basis_tree()
246
249
            self.basis_inv = self.basis_tree.inventory