~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Robert Collins
  • Date: 2006-03-04 22:35:19 UTC
  • mto: This revision was merged to the branch mainline in revision 1590.
  • Revision ID: robertc@robertcollins.net-20060304223519-51db134273f7a5a1
Local commits on unbound branches fail.

Show diffs side-by-side

added added

removed removed

Lines of Context:
180
180
               strict=False,
181
181
               verbose=False,
182
182
               revprops=None,
183
 
               working_tree=None):
 
183
               working_tree=None,
 
184
               local=False):
184
185
        """Commit working copy as a new revision.
185
186
 
186
187
        branch -- the deprecated branch to commit to. New callers should pass in 
206
207
            contains unknown files.
207
208
 
208
209
        revprops -- Properties for new revision
 
210
        :param local: Perform a local only commit.
209
211
        """
210
212
        mutter('preparing to commit')
211
213
 
238
240
            # setup the bound branch variables as needed.
239
241
            self._check_bound_branch()
240
242
 
 
243
            if not self.bound_branch and local:
 
244
                raise errors.LocalRequiresBoundBranch()
 
245
 
241
246
            # check for out of date working trees
242
247
            # if we are bound, then self.branch is the master branch and this
243
248
            # test is thus all we need.
244
 
            if self.work_tree.last_revision() != self.branch.last_revision():
 
249
            if self.work_tree.last_revision() != self.master_branch.last_revision():
245
250
                raise errors.OutOfDateTree(self.work_tree)
246
251
    
247
252
            if strict:
355
360
        #       master branch
356
361
        self.master_branch = self.branch.get_master_branch()
357
362
        if not self.master_branch:
 
363
            # make this branch the reference branch for out of date checks.
 
364
            self.master_branch = self.branch
358
365
            return
359
366
 
360
367
        # If the master branch is bound, we must fail