~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Robert Collins
  • Date: 2005-10-29 23:48:45 UTC
  • Revision ID: robertc@robertcollins.net-20051029234845-7ae4e7d118bdd3ed
Implement a 'bzr push' command, with saved locations; update diff to return 1.

    * 'bzr diff' now returns 1 when there are changes in the working 
      tree.

    * 'bzr push' now exists and can push changes to a remote location. 
      This uses the transport infrastructure, and can store the remote
      location in the ~/.bazaar/branches.conf configuration file.

    * WorkingTree.pull has been split across Branch and WorkingTree,
      to allow Branch only pulls.

    * commands.display_command now returns the result of the decorated 
      function.

    * LocationConfig now has a set_user_option(key, value) call to save
      a setting in its matching location section (a new one is created
      if needed).

    * Branch has two new methods, get_push_location and set_push_location
      to respectively, get and set the push location.

Show diffs side-by-side

added added

removed removed

Lines of Context:
330
330
                yield stem
331
331
 
332
332
    @needs_write_lock
333
 
    def pull(self, source, remember=False, overwrite=False):
 
333
    def pull(self, source, overwrite=False):
334
334
        from bzrlib.merge import merge_inner
335
335
        source.lock_read()
336
336
        try:
337
337
            old_revision_history = self.branch.revision_history()
338
 
            try:
339
 
                self.branch.update_revisions(source)
340
 
            except DivergedBranches:
341
 
                if not overwrite:
342
 
                    raise
343
 
                self.branch.set_revision_history(source.revision_history())
 
338
            self.branch.pull(source, overwrite)
344
339
            new_revision_history = self.branch.revision_history()
345
340
            if new_revision_history != old_revision_history:
346
341
                if len(old_revision_history):
350
345
                merge_inner(self.branch,
351
346
                            self.branch.basis_tree(), 
352
347
                            self.branch.revision_tree(other_revision))
353
 
            if self.branch.get_parent() is None or remember:
354
 
                self.branch.set_parent(source.base)
355
348
        finally:
356
349
            source.unlock()
357
350