~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Robert Collins
  • Date: 2005-10-18 23:47:12 UTC
  • mfrom: (0.2.1)
  • Revision ID: robertc@robertcollins.net-20051018234712-45a83974f691c860
Bugfix the new pull --clobber to not generate spurious conflicts.

When --clobber clobbered the history, a bad merge base was used.

Supporting this:
* merge.merge_inner now has tempdir as an optional parameter. (Robert Collins)

* Tree.kind is not recorded at the top level of the hierarchy, as it was
  missing on EmptyTree, leading to a bug with merge on EmptyTrees.
  (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
from bzrlib.errors import BzrCheckError, DivergedBranches, NotVersionedError
53
53
from bzrlib.trace import mutter
54
54
 
 
55
 
55
56
class TreeEntry(object):
56
57
    """An entry that implements the minium interface used by commands.
57
58
 
332
333
 
333
334
    @needs_write_lock
334
335
    def pull(self, source, remember=False, clobber=False):
335
 
        from bzrlib.merge import merge
 
336
        from bzrlib.merge import merge_inner
336
337
        source.lock_read()
337
338
        try:
338
 
            old_revno = self.branch.revno()
339
339
            old_revision_history = self.branch.revision_history()
340
340
            try:
341
341
                self.branch.update_revisions(source)
345
345
                self.branch.set_revision_history(source.revision_history())
346
346
            new_revision_history = self.branch.revision_history()
347
347
            if new_revision_history != old_revision_history:
348
 
                merge((self.basedir, -1), (self.basedir, old_revno), check_clean=False)
 
348
                if len(old_revision_history):
 
349
                    other_revision = old_revision_history[-1]
 
350
                else:
 
351
                    other_revision = None
 
352
                merge_inner(self.branch,
 
353
                            self.branch.basis_tree(), 
 
354
                            self.branch.revision_tree(other_revision))
349
355
            if self.branch.get_parent() is None or remember:
350
356
                self.branch.set_parent(source.base)
351
357
        finally: