~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Patch Queue Manager
  • Date: 2011-12-21 18:20:31 UTC
  • mfrom: (6394.1.4 push-suggests-parent)
  • Revision ID: pqm@pqm.ubuntu.com-20111221182031-9gf8hr07o64jddxb
(jelmer) If no location is specified to "bzr push" or remembered,
 mention the parent alias to the user. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1251
1251
        if location is None:
1252
1252
            stored_loc = br_from.get_push_location()
1253
1253
            if stored_loc is None:
1254
 
                raise errors.BzrCommandError(gettext(
1255
 
                    "No push location known or specified."))
 
1254
                parent_loc = br_from.get_parent()
 
1255
                if parent_loc:
 
1256
                    raise errors.BzrCommandError(gettext(
 
1257
                        "No push location known or specified. To push to the "
 
1258
                        "parent branch (at %s), use 'bzr push :parent'." %
 
1259
                        urlutils.unescape_for_display(parent_loc,
 
1260
                            self.outf.encoding)))
 
1261
                else:
 
1262
                    raise errors.BzrCommandError(gettext(
 
1263
                        "No push location known or specified."))
1256
1264
            else:
1257
1265
                display_url = urlutils.unescape_for_display(stored_loc,
1258
1266
                        self.outf.encoding)