/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Gerard Krol
  • Date: 2010-01-31 14:27:03 UTC
  • mto: (5020.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5021.
  • Revision ID: gerard_@gna.org-20100131142703-kwgk0cmtzszrwwc6
Cleaning up

Show diffs side-by-side

added added

removed removed

Lines of Context:
2267
2267
        except IndexError:
2268
2268
            last_rev = _mod_revision.NULL_REVISION
2269
2269
        if revision is None:
 
2270
            update_dash_r = False
2270
2271
            revision = self.branch.last_revision()
2271
2272
        else:
 
2273
            update_dash_r = True
2272
2274
            if revision not in self.branch.revision_history():
2273
2275
                raise errors.NoSuchRevision(self.branch, revision)
2274
2276
        
2275
2277
        already_merged = None
2276
2278
        if (old_tip is not None and not _mod_revision.is_null(old_tip)
2277
 
            and old_tip != revision) and last_rev != _mod_revision.ensure_null(revision):
2278
 
            #trace.note("Branch out of date, rerun update")
 
2279
            and old_tip != revision):
 
2280
            # the branch we are bound to is out of date
 
2281
            # (and it may be in need of a merge)
 
2282
            # we first merge with the old tip of the branch
 
2283
            # in the next step we will merge in the commits that will cause it to be not out of date anymore
2279
2284
            graph = self.branch.repository.get_graph()
2280
2285
            base_rev_id = graph.find_unique_lca(revision, old_tip)
2281
2286
            base_tree = self.branch.repository.revision_tree(base_rev_id)
2287
2292
                                  base_tree,
2288
2293
                                  this_tree=self,
2289
2294
                                  change_reporter=change_reporter)
2290
 
            #self.set_pending_merges([old_tip])
2291
2295
            already_merged = True
2292
2296
            if result > 0:
 
2297
                self.add_parent_tree_id(old_tip)
2293
2298
                return result
2294
2299
 
2295
2300
        if last_rev != _mod_revision.ensure_null(revision):
2296
 
            # merge tree state up to specified revision.
 
2301
            # when we get here we have already merged with the new commits
 
2302
            # on the branch we are bound to (or there weren't any)
 
2303
            # we can merge up to the specified revision
2297
2304
            basis = self.basis_tree()
2298
2305
            basis.lock_read()
2299
2306
            try:
2303
2310
                    or basis.inventory.root.file_id != to_root_id):
2304
2311
                    self.set_root_id(to_root_id)
2305
2312
                    self.flush()
2306
 
                if already_merged:
 
2313
                if update_dash_r:
 
2314
                    # update -r doesn't play by the rules, and may get rid of local commits
 
2315
                    base_tree = basis
 
2316
                else:
2307
2317
                    graph = self.branch.repository.get_graph()
2308
2318
                    base_rev_id = graph.find_unique_lca(revision, last_rev)
2309
2319
                    base_tree = self.branch.repository.revision_tree(base_rev_id)
2310
 
                else:
2311
 
                    base_tree = basis
2312
2320
 
2313
2321
                result += merge.merge_inner(
2314
2322
                                      self.branch,