~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/foreign.py

  • Committer: Martin Pool
  • Date: 2010-02-25 06:17:27 UTC
  • mfrom: (5055 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5057.
  • Revision ID: mbp@sourcefrog.net-20100225061727-4sd9lt0qmdc6087t
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008-2011 Canonical Ltd
 
1
# Copyright (C) 2008, 2009, 2010 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
29
29
lazy_import(globals(), """
30
30
from bzrlib import (
31
31
    errors,
 
32
    osutils,
32
33
    registry,
33
34
    transform,
34
35
    )
258
259
 
259
260
 
260
261
class cmd_dpush(Command):
261
 
    __doc__ = """Push into a different VCS without any custom bzr metadata.
 
262
    """Push into a different VCS without any custom bzr metadata.
262
263
 
263
264
    This will afterwards rebase the local branch on the remote
264
265
    branch unless the --no-rebase option is used, in which case 
295
296
        except NoWorkingTree:
296
297
            source_branch = Branch.open(directory)
297
298
            source_wt = None
298
 
        if source_wt is not None:
299
 
            source_wt.check_changed_or_out_of_date(
300
 
                strict, 'dpush_strict',
301
 
                more_error='Use --no-strict to force the push.',
302
 
                more_warning='Uncommitted changes will not be pushed.')
 
299
        if strict is None:
 
300
            strict = source_branch.get_config(
 
301
                ).get_user_option_as_bool('dpush_strict')
 
302
        if strict is None: strict = True # default value
 
303
        if strict and source_wt is not None:
 
304
            if (source_wt.has_changes()):
 
305
                raise errors.UncommittedChanges(
 
306
                    source_wt, more='Use --no-strict to force the push.')
 
307
            if source_wt.last_revision() != source_wt.branch.last_revision():
 
308
                # The tree has lost sync with its branch, there is little
 
309
                # chance that the user is aware of it but he can still force
 
310
                # the push with --no-strict
 
311
                raise errors.OutOfDateTree(
 
312
                    source_wt, more='Use --no-strict to force the push.')
303
313
        stored_loc = source_branch.get_push_location()
304
314
        if location is None:
305
315
            if stored_loc is None: