~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/foreign.py

  • Committer: Patch Queue Manager
  • Date: 2015-12-17 18:39:00 UTC
  • mfrom: (6606.1.2 fix-float)
  • Revision ID: pqm@pqm.ubuntu.com-20151217183900-0719du2uv1kwu3lc
(vila) Inline testtools private method to fix an issue in xenial (the
 private implementation has changed in an backward incompatible way).
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008-2011 Canonical Ltd
 
1
# Copyright (C) 2008-2012 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
 
18
17
"""Foreign branch utilities."""
19
18
 
 
19
from __future__ import absolute_import
 
20
 
20
21
 
21
22
from bzrlib.branch import (
22
23
    Branch,
264
265
    branch unless the --no-rebase option is used, in which case 
265
266
    the two branches will be out of sync after the push. 
266
267
    """
267
 
    hidden = True
268
268
    takes_args = ['location?']
269
269
    takes_options = [
270
270
        'remember',
283
283
    def run(self, location=None, remember=False, directory=None,
284
284
            no_rebase=False, strict=None):
285
285
        from bzrlib import urlutils
286
 
        from bzrlib.bzrdir import BzrDir
 
286
        from bzrlib.controldir import ControlDir
287
287
        from bzrlib.errors import BzrCommandError, NoWorkingTree
288
288
        from bzrlib.workingtree import WorkingTree
289
289
 
311
311
                       gettext("Using saved location: %s\n") % display_url)
312
312
                location = stored_loc
313
313
 
314
 
        bzrdir = BzrDir.open(location)
315
 
        target_branch = bzrdir.open_branch()
 
314
        controldir = ControlDir.open(location)
 
315
        target_branch = controldir.open_branch()
316
316
        target_branch.lock_write()
317
317
        try:
318
318
            try:
323
323
                    source_branch, target_branch))
324
324
            # We successfully created the target, remember it
325
325
            if source_branch.get_push_location() is None or remember:
 
326
                # FIXME: Should be done only if we succeed ? -- vila 2012-01-18
326
327
                source_branch.set_push_location(target_branch.base)
327
328
            if not no_rebase:
328
329
                old_last_revid = source_branch.last_revision()