Merge lp:~jelmer/brz/more-cleanups into lp:brz
- more-cleanups
- Merge into trunk
Proposed by
Jelmer Vernooij
Status: | Merged |
---|---|
Approved by: | Jelmer Vernooij |
Approved revision: | no longer in the source branch. |
Merge reported by: | The Breezy Bot |
Merged at revision: | not available |
Proposed branch: | lp:~jelmer/brz/more-cleanups |
Merge into: | lp:brz |
Diff against target: |
119584 lines (+23263/-20257) 797 files modified
breezy/__init__.py (+5/-4) breezy/_annotator_py.py (+13/-11) breezy/_known_graph_py.py (+15/-14) breezy/_patiencediff_py.py (+0/-3) breezy/_rio_py.py (+6/-4) breezy/_static_tuple_py.py (+2/-2) breezy/_termcolor.py (+0/-1) breezy/annotate.py (+23/-20) breezy/archive/__init__.py (+3/-3) breezy/archive/tar.py (+7/-7) breezy/archive/zip.py (+8/-8) breezy/bencode.py (+6/-1) breezy/bisect.py (+8/-7) breezy/bisect_multi.py (+1/-1) breezy/branch.py (+167/-137) breezy/branchbuilder.py (+21/-18) breezy/breakin.py (+3/-3) breezy/bugtracker.py (+9/-8) breezy/builtins.py (+750/-685) breezy/bundle/__init__.py (+1/-1) breezy/bundle/apply_bundle.py (+2/-2) breezy/bundle/bundle_data.py (+52/-50) breezy/bundle/commands.py (+6/-5) breezy/bundle/serializer/__init__.py (+10/-5) breezy/bundle/serializer/v08.py (+22/-20) breezy/bundle/serializer/v4.py (+28/-24) breezy/bzr/__init__.py (+79/-59) breezy/bzr/_btree_serializer_py.py (+1/-1) breezy/bzr/_chk_map_py.py (+8/-8) breezy/bzr/_dirstate_helpers_py.py (+28/-26) breezy/bzr/_groupcompress_py.py (+20/-19) breezy/bzr/_knit_load_data_py.py (+4/-4) breezy/bzr/branch.py (+72/-61) breezy/bzr/btree_index.py (+72/-63) breezy/bzr/bzrdir.py (+161/-149) breezy/bzr/check.py (+10/-12) breezy/bzr/chk_map.py (+84/-77) breezy/bzr/chk_serializer.py (+8/-9) breezy/bzr/debug_commands.py (+7/-6) breezy/bzr/dirstate.py (+364/-317) breezy/bzr/fetch.py (+21/-18) breezy/bzr/fullhistory.py (+4/-6) breezy/bzr/groupcompress.py (+76/-71) breezy/bzr/groupcompress_repo.py (+112/-90) breezy/bzr/index.py (+54/-50) breezy/bzr/inventory.py (+133/-124) breezy/bzr/inventory_delta.py (+17/-19) breezy/bzr/inventorytree.py (+38/-33) breezy/bzr/knit.py (+133/-119) breezy/bzr/knitpack_repo.py (+110/-91) breezy/bzr/knitrepo.py (+35/-25) breezy/bzr/pack.py (+8/-9) breezy/bzr/pack_repo.py (+113/-107) breezy/bzr/remote.py (+301/-258) breezy/bzr/repository.py (+14/-13) breezy/bzr/serializer.py (+2/-2) breezy/bzr/smart/branch.py (+14/-14) breezy/bzr/smart/bzrdir.py (+19/-19) breezy/bzr/smart/client.py (+19/-16) breezy/bzr/smart/medium.py (+20/-19) breezy/bzr/smart/packrepository.py (+0/-2) breezy/bzr/smart/protocol.py (+17/-14) breezy/bzr/smart/repository.py (+56/-49) breezy/bzr/smart/request.py (+9/-8) breezy/bzr/smart/server.py (+31/-24) breezy/bzr/smart/signals.py (+2/-1) breezy/bzr/smart/vfs.py (+7/-7) breezy/bzr/textinv.py (+1/-4) breezy/bzr/versionedfile.py (+94/-93) breezy/bzr/vf_repository.py (+206/-186) breezy/bzr/vf_search.py (+6/-6) breezy/bzr/weave.py (+68/-72) breezy/bzr/weavefile.py (+1/-2) breezy/bzr/workingtree.py (+165/-139) breezy/bzr/workingtree_3.py (+12/-12) breezy/bzr/workingtree_4.py (+182/-155) breezy/bzr/xml5.py (+6/-4) breezy/bzr/xml8.py (+5/-5) breezy/bzr/xml_serializer.py (+39/-36) breezy/bzr_distutils.py (+6/-8) breezy/cache_utf8.py (+3/-0) breezy/cethread.py (+7/-8) breezy/check.py (+4/-3) breezy/chunk_writer.py (+3/-3) breezy/clean_tree.py (+3/-2) breezy/cleanup.py (+5/-3) breezy/cmd_test_script.py (+2/-2) breezy/cmd_version_info.py (+13/-12) breezy/cmdline.py (+2/-2) breezy/commands.py (+68/-56) breezy/commit.py (+65/-58) breezy/commit_signature_commands.py (+33/-32) breezy/config.py (+107/-94) breezy/conflicts.py (+19/-15) breezy/controldir.py (+56/-52) breezy/counted_lock.py (+1/-1) breezy/crash.py (+22/-21) breezy/delta.py (+24/-21) breezy/diff.py (+55/-45) breezy/directory_service.py (+9/-8) breezy/doc_generate/autodoc_bash_completion.py (+5/-6) breezy/doc_generate/autodoc_man.py (+11/-12) breezy/doc_generate/autodoc_rstx.py (+10/-10) breezy/doc_generate/conf.py (+9/-9) breezy/email_message.py (+4/-4) breezy/errors.py (+42/-41) breezy/estimate_compressed_size.py (+1/-1) breezy/export.py (+5/-4) breezy/export_pot.py (+23/-22) breezy/externalcommand.py (+1/-3) breezy/fifo_cache.py (+5/-6) breezy/filter_tree.py (+1/-1) breezy/filters/__init__.py (+1/-1) breezy/filters/eol.py (+6/-3) breezy/foreign.py (+3/-3) breezy/generate_ids.py (+1/-1) breezy/git/__init__.py (+66/-56) breezy/git/annotate.py (+23/-13) breezy/git/branch.py (+145/-101) breezy/git/cache.py (+73/-52) breezy/git/commands.py (+42/-30) breezy/git/commit.py (+15/-7) breezy/git/config.py (+5/-3) breezy/git/dir.py (+82/-62) breezy/git/directory.py (+1/-0) breezy/git/errors.py (+2/-1) breezy/git/fetch.py (+86/-74) breezy/git/filegraph.py (+16/-11) breezy/git/git_remote_helper.py (+16/-15) breezy/git/hg.py (+3/-1) breezy/git/interrepo.py (+70/-44) breezy/git/mapping.py (+47/-29) breezy/git/memorytree.py (+13/-8) breezy/git/object_store.py (+75/-59) breezy/git/pristine_tar.py (+4/-3) breezy/git/push.py (+6/-4) breezy/git/refs.py (+14/-6) breezy/git/remote.py (+53/-38) breezy/git/repository.py (+35/-23) breezy/git/revspec.py (+2/-2) breezy/git/roundtrip.py (+5/-4) breezy/git/send.py (+26/-21) breezy/git/server.py (+7/-4) breezy/git/tests/__init__.py (+3/-2) breezy/git/tests/test_blackbox.py (+55/-42) breezy/git/tests/test_branch.py (+7/-6) breezy/git/tests/test_builder.py (+4/-4) breezy/git/tests/test_cache.py (+18/-16) breezy/git/tests/test_dir.py (+4/-4) breezy/git/tests/test_fetch.py (+55/-42) breezy/git/tests/test_git_remote_helper.py (+8/-5) breezy/git/tests/test_mapping.py (+29/-25) breezy/git/tests/test_memorytree.py (+1/-1) breezy/git/tests/test_object_store.py (+30/-29) breezy/git/tests/test_pristine_tar.py (+4/-4) breezy/git/tests/test_push.py (+11/-7) breezy/git/tests/test_refs.py (+10/-10) breezy/git/tests/test_remote.py (+145/-138) breezy/git/tests/test_repository.py (+29/-20) breezy/git/tests/test_revspec.py (+1/-0) breezy/git/tests/test_roundtrip.py (+6/-7) breezy/git/tests/test_server.py (+1/-2) breezy/git/tests/test_transportgit.py (+10/-13) breezy/git/tests/test_unpeel_map.py (+5/-5) breezy/git/tests/test_urls.py (+11/-11) breezy/git/tests/test_workingtree.py (+20/-17) breezy/git/transportgit.py (+43/-31) breezy/git/tree.py (+158/-115) breezy/git/unpeel_map.py (+2/-1) breezy/git/urls.py (+8/-7) breezy/git/workingtree.py (+165/-109) breezy/globbing.py (+37/-31) breezy/gpg.py (+35/-26) breezy/graph.py (+37/-34) breezy/hashcache.py (+9/-13) breezy/help.py (+5/-4) breezy/help_topics/__init__.py (+51/-39) breezy/hooks.py (+13/-13) breezy/i18n.py (+9/-8) breezy/ignores.py (+3/-3) breezy/info.py (+30/-30) breezy/intset.py (+0/-12) breezy/iterablefile.py (+3/-3) breezy/lazy_import.py (+3/-4) breezy/lazy_regex.py (+7/-8) breezy/library_state.py (+3/-3) breezy/lock.py (+38/-40) breezy/lockable_files.py (+6/-5) breezy/lockdir.py (+34/-34) breezy/log.py (+109/-91) breezy/lru_cache.py (+2/-1) breezy/lsprof.py (+8/-8) breezy/mail_client.py (+89/-65) breezy/memorytree.py (+8/-8) breezy/merge.py (+96/-110) breezy/merge3.py (+25/-24) breezy/merge_directive.py (+24/-22) breezy/mergetools.py (+6/-5) breezy/missing.py (+8/-11) breezy/msgeditor.py (+18/-15) breezy/multiparent.py (+12/-9) breezy/mutabletree.py (+30/-28) breezy/option.py (+12/-9) breezy/osutils.py (+90/-67) breezy/patches.py (+20/-15) breezy/patiencediff.py (+7/-6) breezy/plugin.py (+4/-4) breezy/plugins/bash_completion/__init__.py (+2/-2) breezy/plugins/bash_completion/bashcomp.py (+19/-17) breezy/plugins/bash_completion/tests/__init__.py (+2/-1) breezy/plugins/bash_completion/tests/test_bashcomp.py (+8/-7) breezy/plugins/changelog_merge/__init__.py (+6/-2) breezy/plugins/changelog_merge/changelog_merge.py (+2/-2) breezy/plugins/changelog_merge/tests/__init__.py (+2/-2) breezy/plugins/changelog_merge/tests/test_changelog_merge.py (+14/-14) breezy/plugins/commitfromnews/__init__.py (+1/-1) breezy/plugins/commitfromnews/committemplate.py (+2/-2) breezy/plugins/commitfromnews/tests/__init__.py (+2/-2) breezy/plugins/commitfromnews/tests/test_committemplate.py (+24/-24) breezy/plugins/cvs/__init__.py (+1/-1) breezy/plugins/darcs/__init__.py (+1/-1) breezy/plugins/email/__init__.py (+15/-14) breezy/plugins/email/emailer.py (+26/-24) breezy/plugins/email/tests/__init__.py (+1/-1) breezy/plugins/email/tests/testemail.py (+58/-57) breezy/plugins/fastimport/__init__.py (+5/-4) breezy/plugins/fastimport/branch_updater.py (+10/-8) breezy/plugins/fastimport/bzr_commit_handler.py (+53/-46) breezy/plugins/fastimport/cache_manager.py (+7/-6) breezy/plugins/fastimport/cmds.py (+87/-83) breezy/plugins/fastimport/exporter.py (+48/-38) breezy/plugins/fastimport/helpers.py (+3/-3) breezy/plugins/fastimport/marks_file.py (+3/-3) breezy/plugins/fastimport/processors/generic_processor.py (+30/-27) breezy/plugins/fastimport/revision_store.py (+56/-55) breezy/plugins/fastimport/tests/__init__.py (+0/-1) breezy/plugins/fastimport/tests/test_branch_mapper.py (+21/-21) breezy/plugins/fastimport/tests/test_commands.py (+9/-5) breezy/plugins/fastimport/tests/test_exporter.py (+34/-17) breezy/plugins/fastimport/tests/test_generic_processor.py (+438/-352) breezy/plugins/fastimport/tests/test_head_tracking.py (+6/-5) breezy/plugins/fastimport/tests/test_revision_store.py (+5/-5) breezy/plugins/fastimport/user_mapper.py (+1/-1) breezy/plugins/grep/__init__.py (+2/-2) breezy/plugins/grep/cmds.py (+16/-13) breezy/plugins/grep/grep.py (+54/-32) breezy/plugins/grep/test_grep.py (+647/-395) breezy/plugins/launchpad/__init__.py (+12/-9) breezy/plugins/launchpad/account.py (+1/-0) breezy/plugins/launchpad/cmds.py (+4/-4) breezy/plugins/launchpad/lp_api.py (+5/-5) breezy/plugins/launchpad/lp_api_lite.py (+3/-3) breezy/plugins/launchpad/lp_directory.py (+8/-8) breezy/plugins/launchpad/lp_propose.py (+7/-7) breezy/plugins/launchpad/lp_registration.py (+3/-4) breezy/plugins/launchpad/test_account.py (+4/-4) breezy/plugins/launchpad/test_lp_api_lite.py (+39/-38) breezy/plugins/launchpad/test_lp_directory.py (+45/-40) breezy/plugins/launchpad/test_lp_service.py (+1/-0) breezy/plugins/launchpad/test_register.py (+14/-13) breezy/plugins/mtn/__init__.py (+2/-2) breezy/plugins/netrc_credential_store/__init__.py (+1/-1) breezy/plugins/netrc_credential_store/tests/__init__.py (+2/-1) breezy/plugins/netrc_credential_store/tests/test_netrc.py (+1/-1) breezy/plugins/news_merge/__init__.py (+1/-1) breezy/plugins/news_merge/news_merge.py (+1/-1) breezy/plugins/news_merge/parser.py (+1/-1) breezy/plugins/news_merge/tests/__init__.py (+1/-1) breezy/plugins/po_merge/__init__.py (+2/-3) breezy/plugins/po_merge/po_merge.py (+11/-11) breezy/plugins/po_merge/tests/__init__.py (+2/-1) breezy/plugins/po_merge/tests/test_po_merge.py (+11/-10) breezy/plugins/repodebug/chk_used_by.py (+0/-1) breezy/plugins/repodebug/fetch_all_records.py (+2/-1) breezy/plugins/repodebug/missing_keys_for_stacking_fixer.py (+3/-3) breezy/plugins/repodebug/repo_keys.py (+0/-1) breezy/plugins/repodebug/tests/__init__.py (+1/-1) breezy/plugins/stats/__init__.py (+4/-3) breezy/plugins/stats/classify.py (+2/-2) breezy/plugins/stats/cmds.py (+16/-11) breezy/plugins/stats/test_stats.py (+9/-6) breezy/plugins/upload/__init__.py (+1/-1) breezy/plugins/upload/cmds.py (+16/-15) breezy/plugins/upload/tests/__init__.py (+2/-1) breezy/plugins/upload/tests/test_upload.py (+9/-10) breezy/plugins/weave_fmt/__init__.py (+14/-13) breezy/plugins/weave_fmt/branch.py (+10/-10) breezy/plugins/weave_fmt/bzrdir.py (+53/-49) breezy/plugins/weave_fmt/repository.py (+54/-49) breezy/plugins/weave_fmt/store/__init__.py (+3/-1) breezy/plugins/weave_fmt/store/text.py (+0/-1) breezy/plugins/weave_fmt/store/versioned.py (+8/-8) breezy/plugins/weave_fmt/test_bzrdir.py (+138/-132) breezy/plugins/weave_fmt/test_repository.py (+1/-3) breezy/plugins/weave_fmt/test_store.py (+12/-8) breezy/plugins/weave_fmt/workingtree.py (+16/-15) breezy/plugins/weave_fmt/xml4.py (+14/-21) breezy/progress.py (+10/-7) breezy/push.py (+28/-29) breezy/pyutils.py (+1/-1) breezy/reconcile.py (+21/-18) breezy/reconfigure.py (+12/-12) breezy/recordcounter.py (+1/-1) breezy/registry.py (+6/-6) breezy/rename_map.py (+9/-6) breezy/repository.py (+33/-29) breezy/revision.py (+4/-4) breezy/revisionspec.py (+35/-32) breezy/revisiontree.py (+2/-2) breezy/rio.py (+8/-5) breezy/rules.py (+2/-1) breezy/send.py (+14/-14) breezy/shelf.py (+5/-5) breezy/shelf_ui.py (+17/-13) breezy/shellcomplete.py (+6/-5) breezy/smtp_connection.py (+10/-11) breezy/status.py (+30/-26) breezy/strace.py (+2/-5) breezy/switch.py (+13/-9) breezy/symbol_versioning.py (+15/-16) breezy/tag.py (+11/-11) breezy/testament.py (+3/-2) breezy/tests/EncodingAdapter.py (+55/-55) breezy/tests/TestUtil.py (+4/-5) breezy/tests/__init__.py (+207/-174) breezy/tests/blackbox/__init__.py (+104/-105) breezy/tests/blackbox/test_add.py (+3/-3) breezy/tests/blackbox/test_added.py (+4/-2) breezy/tests/blackbox/test_aliases.py (+3/-4) breezy/tests/blackbox/test_ancestry.py (+2/-1) breezy/tests/blackbox/test_annotate.py (+15/-16) breezy/tests/blackbox/test_bisect.py (+8/-11) breezy/tests/blackbox/test_bound_branches.py (+9/-7) breezy/tests/blackbox/test_branch.py (+42/-37) breezy/tests/blackbox/test_break_lock.py (+5/-3) breezy/tests/blackbox/test_cat.py (+9/-8) breezy/tests/blackbox/test_cat_revision.py (+9/-8) breezy/tests/blackbox/test_check.py (+5/-5) breezy/tests/blackbox/test_checkout.py (+10/-8) breezy/tests/blackbox/test_command_encoding.py (+4/-6) breezy/tests/blackbox/test_commit.py (+47/-42) breezy/tests/blackbox/test_config.py (+7/-8) breezy/tests/blackbox/test_conflicts.py (+13/-13) breezy/tests/blackbox/test_diff.py (+12/-11) breezy/tests/blackbox/test_dump_btree.py (+6/-4) breezy/tests/blackbox/test_exceptions.py (+18/-15) breezy/tests/blackbox/test_export.py (+29/-27) breezy/tests/blackbox/test_export_pot.py (+9/-5) breezy/tests/blackbox/test_filesystem_cicp.py (+7/-7) breezy/tests/blackbox/test_filtered_view_ops.py (+6/-3) breezy/tests/blackbox/test_help.py (+8/-8) breezy/tests/blackbox/test_hooks.py (+13/-7) breezy/tests/blackbox/test_ignore.py (+10/-11) breezy/tests/blackbox/test_info.py (+134/-132) breezy/tests/blackbox/test_init.py (+9/-8) breezy/tests/blackbox/test_inventory.py (+6/-7) breezy/tests/blackbox/test_join.py (+4/-4) breezy/tests/blackbox/test_locale.py (+4/-4) breezy/tests/blackbox/test_log.py (+36/-32) breezy/tests/blackbox/test_logformats.py (+5/-6) breezy/tests/blackbox/test_lookup_revision.py (+1/-0) breezy/tests/blackbox/test_ls.py (+12/-22) breezy/tests/blackbox/test_merge.py (+24/-21) breezy/tests/blackbox/test_merge_directive.py (+10/-5) breezy/tests/blackbox/test_missing.py (+10/-10) breezy/tests/blackbox/test_modified.py (+6/-3) breezy/tests/blackbox/test_mv.py (+10/-10) breezy/tests/blackbox/test_non_ascii.py (+13/-13) breezy/tests/blackbox/test_outside_wt.py (+3/-3) breezy/tests/blackbox/test_pack.py (+2/-2) breezy/tests/blackbox/test_ping.py (+4/-4) breezy/tests/blackbox/test_pull.py (+26/-23) breezy/tests/blackbox/test_push.py (+47/-45) breezy/tests/blackbox/test_re_sign.py (+1/-1) breezy/tests/blackbox/test_reconcile.py (+1/-1) breezy/tests/blackbox/test_reconfigure.py (+15/-15) breezy/tests/blackbox/test_reference.py (+5/-4) breezy/tests/blackbox/test_remember_option.py (+11/-11) breezy/tests/blackbox/test_remerge.py (+1/-1) breezy/tests/blackbox/test_remove.py (+14/-13) breezy/tests/blackbox/test_resolve.py (+2/-2) breezy/tests/blackbox/test_revert.py (+10/-5) breezy/tests/blackbox/test_revision_info.py (+13/-13) breezy/tests/blackbox/test_revno.py (+4/-3) breezy/tests/blackbox/test_rmbranch.py (+7/-5) breezy/tests/blackbox/test_selftest.py (+17/-12) breezy/tests/blackbox/test_send.py (+19/-14) breezy/tests/blackbox/test_serve.py (+8/-5) breezy/tests/blackbox/test_shared_repository.py (+6/-4) breezy/tests/blackbox/test_shell_complete.py (+2/-1) breezy/tests/blackbox/test_shelve.py (+4/-2) breezy/tests/blackbox/test_sign_my_commits.py (+2/-2) breezy/tests/blackbox/test_split.py (+2/-2) breezy/tests/blackbox/test_status.py (+150/-144) breezy/tests/blackbox/test_switch.py (+20/-18) breezy/tests/blackbox/test_tags.py (+55/-50) breezy/tests/blackbox/test_testament.py (+2/-2) breezy/tests/blackbox/test_too_much.py (+47/-31) breezy/tests/blackbox/test_update.py (+11/-12) breezy/tests/blackbox/test_upgrade.py (+8/-6) breezy/tests/blackbox/test_verify_signatures.py (+10/-10) breezy/tests/blackbox/test_version.py (+6/-4) breezy/tests/blackbox/test_version_info.py (+10/-6) breezy/tests/blackbox/test_versioning.py (+1/-0) breezy/tests/blackbox/test_view.py (+1/-1) breezy/tests/blackbox/test_whoami.py (+4/-4) breezy/tests/commands/__init__.py (+1/-0) breezy/tests/commands/test_branch.py (+0/-1) breezy/tests/commands/test_cat.py (+0/-1) breezy/tests/commands/test_checkout.py (+0/-1) breezy/tests/commands/test_commit.py (+2/-2) breezy/tests/commands/test_init.py (+0/-1) breezy/tests/commands/test_init_repository.py (+0/-1) breezy/tests/commands/test_missing.py (+0/-1) breezy/tests/commands/test_pull.py (+0/-1) breezy/tests/commands/test_revert.py (+2/-3) breezy/tests/commands/test_update.py (+0/-1) breezy/tests/features.py (+21/-9) breezy/tests/fixtures.py (+8/-8) breezy/tests/http_server.py (+7/-5) breezy/tests/http_utils.py (+38/-36) breezy/tests/https_server.py (+2/-3) breezy/tests/lock_helpers.py (+0/-2) breezy/tests/matchers.py (+13/-9) breezy/tests/per_branch/__init__.py (+4/-4) breezy/tests/per_branch/test_branch.py (+46/-38) breezy/tests/per_branch/test_break_lock.py (+0/-1) breezy/tests/per_branch/test_check.py (+1/-1) breezy/tests/per_branch/test_commit.py (+15/-10) breezy/tests/per_branch/test_config.py (+0/-2) breezy/tests/per_branch/test_create_clone.py (+8/-8) breezy/tests/per_branch/test_dotted_revno_to_revision_id.py (+2/-1) breezy/tests/per_branch/test_get_revision_id_to_revno_map.py (+2/-2) breezy/tests/per_branch/test_hooks.py (+10/-2) breezy/tests/per_branch/test_http.py (+2/-1) breezy/tests/per_branch/test_iter_merge_sorted_revisions.py (+5/-6) breezy/tests/per_branch/test_last_revision_info.py (+2/-2) breezy/tests/per_branch/test_locking.py (+15/-16) breezy/tests/per_branch/test_parent.py (+1/-2) breezy/tests/per_branch/test_permissions.py (+1/-0) breezy/tests/per_branch/test_pull.py (+14/-8) breezy/tests/per_branch/test_push.py (+17/-11) breezy/tests/per_branch/test_reconcile.py (+3/-2) breezy/tests/per_branch/test_revision_id_to_dotted_revno.py (+8/-4) breezy/tests/per_branch/test_revision_id_to_revno.py (+4/-3) breezy/tests/per_branch/test_sprout.py (+7/-6) breezy/tests/per_branch/test_stacking.py (+27/-18) breezy/tests/per_branch/test_tags.py (+36/-33) breezy/tests/per_branch/test_uncommit.py (+2/-2) breezy/tests/per_branch/test_update.py (+3/-2) breezy/tests/per_bzrdir/test_bzrdir.py (+65/-61) breezy/tests/per_controldir/test_controldir.py (+120/-111) breezy/tests/per_controldir/test_format.py (+2/-2) breezy/tests/per_controldir/test_push.py (+3/-3) breezy/tests/per_controldir_colo/__init__.py (+2/-2) breezy/tests/per_controldir_colo/test_supported.py (+2/-1) breezy/tests/per_controldir_colo/test_unsupported.py (+8/-7) breezy/tests/per_foreign_vcs/test_branch.py (+9/-8) breezy/tests/per_foreign_vcs/test_repository.py (+5/-4) breezy/tests/per_interbranch/__init__.py (+18/-17) breezy/tests/per_interbranch/test_copy_content_into.py (+3/-2) breezy/tests/per_interbranch/test_fetch.py (+5/-3) breezy/tests/per_interbranch/test_pull.py (+12/-8) breezy/tests/per_interbranch/test_push.py (+15/-10) breezy/tests/per_interrepository/__init__.py (+11/-9) breezy/tests/per_interrepository/test_fetch.py (+15/-13) breezy/tests/per_interrepository/test_interrepository.py (+15/-12) breezy/tests/per_intertree/__init__.py (+8/-7) breezy/tests/per_intertree/test_compare.py (+123/-113) breezy/tests/per_inventory/__init__.py (+7/-7) breezy/tests/per_inventory/basics.py (+12/-10) breezy/tests/per_lock/__init__.py (+1/-1) breezy/tests/per_merger.py (+37/-27) breezy/tests/per_pack_repository.py (+99/-86) breezy/tests/per_repository/__init__.py (+6/-6) breezy/tests/per_repository/test_add_fallback_repository.py (+5/-5) breezy/tests/per_repository/test_break_lock.py (+1/-1) breezy/tests/per_repository/test_check.py (+1/-1) breezy/tests/per_repository/test_commit_builder.py (+73/-65) breezy/tests/per_repository/test_fetch.py (+43/-43) breezy/tests/per_repository/test_file_graph.py (+1/-1) breezy/tests/per_repository/test_get_parent_map.py (+4/-4) breezy/tests/per_repository/test_has_revisions.py (+2/-2) breezy/tests/per_repository/test_has_same_location.py (+2/-3) breezy/tests/per_repository/test_pack.py (+1/-1) breezy/tests/per_repository/test_repository.py (+57/-54) breezy/tests/per_repository/test_revision.py (+15/-14) breezy/tests/per_repository/test_signatures.py (+12/-11) breezy/tests/per_repository/test_statistics.py (+3/-3) breezy/tests/per_repository_chk/__init__.py (+4/-2) breezy/tests/per_repository_chk/test_supported.py (+10/-12) breezy/tests/per_repository_reference/__init__.py (+5/-5) breezy/tests/per_repository_reference/test__make_parents_provider.py (+2/-3) breezy/tests/per_repository_reference/test_add_inventory.py (+4/-2) breezy/tests/per_repository_reference/test_add_signature_text.py (+1/-1) breezy/tests/per_repository_reference/test_all_revision_ids.py (+0/-1) breezy/tests/per_repository_reference/test_break_lock.py (+1/-1) breezy/tests/per_repository_reference/test_commit_with_stacking.py (+13/-13) breezy/tests/per_repository_reference/test_default_stacking.py (+0/-1) breezy/tests/per_repository_reference/test_fetch.py (+12/-13) breezy/tests/per_repository_reference/test_get_record_stream.py (+2/-2) breezy/tests/per_repository_reference/test_get_rev_id_for_revno.py (+3/-2) breezy/tests/per_repository_reference/test_graph.py (+4/-3) breezy/tests/per_repository_vf/__init__.py (+1/-1) breezy/tests/per_repository_vf/helpers.py (+5/-6) breezy/tests/per_repository_vf/test_add_inventory_by_delta.py (+11/-8) breezy/tests/per_repository_vf/test_check.py (+1/-4) breezy/tests/per_repository_vf/test_check_reconcile.py (+34/-34) breezy/tests/per_repository_vf/test_fetch.py (+3/-3) breezy/tests/per_repository_vf/test_fileid_involved.py (+45/-43) breezy/tests/per_repository_vf/test_merge_directive.py (+0/-1) breezy/tests/per_repository_vf/test_reconcile.py (+19/-15) breezy/tests/per_repository_vf/test_refresh_data.py (+2/-4) breezy/tests/per_repository_vf/test_repository.py (+37/-34) breezy/tests/per_repository_vf/test_write_group.py (+15/-13) breezy/tests/per_transport.py (+115/-98) breezy/tests/per_tree/__init__.py (+18/-18) breezy/tests/per_tree/test_archive.py (+2/-2) breezy/tests/per_tree/test_get_file_mtime.py (+1/-1) breezy/tests/per_tree/test_get_file_with_stat.py (+0/-1) breezy/tests/per_tree/test_get_root_id.py (+0/-1) breezy/tests/per_tree/test_get_symlink_target.py (+1/-2) breezy/tests/per_tree/test_ids.py (+4/-2) breezy/tests/per_tree/test_list_files.py (+12/-12) breezy/tests/per_tree/test_path_content_summary.py (+6/-6) breezy/tests/per_tree/test_revision_tree.py (+1/-1) breezy/tests/per_tree/test_symlinks.py (+0/-1) breezy/tests/per_tree/test_test_trees.py (+19/-15) breezy/tests/per_tree/test_tree.py (+4/-3) breezy/tests/per_tree/test_walkdirs.py (+10/-9) breezy/tests/per_uifactory/__init__.py (+10/-9) breezy/tests/per_versionedfile.py (+249/-214) breezy/tests/per_workingtree/__init__.py (+1/-1) breezy/tests/per_workingtree/test_add.py (+2/-2) breezy/tests/per_workingtree/test_add_reference.py (+3/-3) breezy/tests/per_workingtree/test_annotate_iter.py (+6/-7) breezy/tests/per_workingtree/test_basis_inventory.py (+15/-12) breezy/tests/per_workingtree/test_basis_tree.py (+4/-3) breezy/tests/per_workingtree/test_break_lock.py (+1/-1) breezy/tests/per_workingtree/test_canonical_path.py (+1/-1) breezy/tests/per_workingtree/test_changes_from.py (+1/-1) breezy/tests/per_workingtree/test_check.py (+2/-2) breezy/tests/per_workingtree/test_check_state.py (+0/-1) breezy/tests/per_workingtree/test_commit.py (+36/-30) breezy/tests/per_workingtree/test_content_filters.py (+12/-10) breezy/tests/per_workingtree/test_eol_conversion.py (+83/-83) breezy/tests/per_workingtree/test_get_file_mtime.py (+0/-1) breezy/tests/per_workingtree/test_get_parent_ids.py (+4/-4) breezy/tests/per_workingtree/test_inv.py (+17/-16) breezy/tests/per_workingtree/test_is_control_filename.py (+2/-2) breezy/tests/per_workingtree/test_is_ignored.py (+15/-13) breezy/tests/per_workingtree/test_merge_from_branch.py (+15/-10) breezy/tests/per_workingtree/test_move.py (+62/-62) breezy/tests/per_workingtree/test_nested_specifics.py (+2/-2) breezy/tests/per_workingtree/test_parents.py (+114/-91) breezy/tests/per_workingtree/test_paths2ids.py (+15/-15) breezy/tests/per_workingtree/test_pull.py (+10/-9) breezy/tests/per_workingtree/test_put_file.py (+0/-1) breezy/tests/per_workingtree/test_read_working_inventory.py (+4/-3) breezy/tests/per_workingtree/test_remove.py (+8/-6) breezy/tests/per_workingtree/test_rename_one.py (+56/-56) breezy/tests/per_workingtree/test_revision_tree.py (+4/-2) breezy/tests/per_workingtree/test_shelf_manager.py (+0/-1) breezy/tests/per_workingtree/test_smart_add.py (+23/-20) breezy/tests/per_workingtree/test_symlinks.py (+6/-6) breezy/tests/per_workingtree/test_unversion.py (+26/-26) breezy/tests/per_workingtree/test_views.py (+14/-14) breezy/tests/per_workingtree/test_walkdirs.py (+66/-59) breezy/tests/per_workingtree/test_workingtree.py (+73/-53) breezy/tests/script.py (+13/-14) breezy/tests/stub_sftp.py (+9/-5) breezy/tests/test__annotator.py (+23/-21) breezy/tests/test__bencode.py (+8/-9) breezy/tests/test__btree_serializer.py (+9/-8) breezy/tests/test__chk_map.py (+22/-20) breezy/tests/test__chunks_to_lines.py (+2/-1) breezy/tests/test__dirstate_helpers.py (+44/-40) breezy/tests/test__groupcompress.py (+47/-49) breezy/tests/test__known_graph.py (+54/-54) breezy/tests/test__rio.py (+9/-9) breezy/tests/test__simple_set.py (+13/-13) breezy/tests/test__static_tuple.py (+15/-10) breezy/tests/test__walkdirs_win32.py (+9/-7) breezy/tests/test_ancestry.py (+2/-2) breezy/tests/test_annotate.py (+12/-11) breezy/tests/test_bad_files.py (+16/-16) breezy/tests/test_bisect.py (+8/-6) breezy/tests/test_bisect_multi.py (+30/-23) breezy/tests/test_branch.py (+29/-19) breezy/tests/test_branchbuilder.py (+85/-83) breezy/tests/test_btree_index.py (+129/-124) breezy/tests/test_bugtracker.py (+23/-18) breezy/tests/test_bundle.py (+115/-116) breezy/tests/test_bzrdir.py (+109/-95) breezy/tests/test_cethread.py (+3/-1) breezy/tests/test_chk_map.py (+128/-124) breezy/tests/test_chk_serializer.py (+34/-34) breezy/tests/test_chunk_writer.py (+2/-2) breezy/tests/test_clean_tree.py (+4/-5) breezy/tests/test_cleanup.py (+12/-9) breezy/tests/test_cmdline.py (+11/-10) breezy/tests/test_commands.py (+27/-16) breezy/tests/test_commit.py (+84/-57) breezy/tests/test_commit_merge.py (+4/-3) breezy/tests/test_config.py (+185/-140) breezy/tests/test_conflicts.py (+28/-25) breezy/tests/test_controldir.py (+14/-12) breezy/tests/test_counted_lock.py (+1/-1) breezy/tests/test_crash.py (+6/-6) breezy/tests/test_decorators.py (+1/-1) breezy/tests/test_delta.py (+46/-41) breezy/tests/test_diff.py (+224/-233) breezy/tests/test_directory_service.py (+6/-5) breezy/tests/test_dirstate.py (+316/-294) breezy/tests/test_email_message.py (+24/-27) breezy/tests/test_eol_filters.py (+3/-3) breezy/tests/test_errors.py (+48/-43) breezy/tests/test_estimate_compressed_size.py (+6/-6) breezy/tests/test_export.py (+6/-6) breezy/tests/test_export_pot.py (+80/-71) breezy/tests/test_extract.py (+3/-3) breezy/tests/test_features.py (+1/-0) breezy/tests/test_fetch.py (+36/-34) breezy/tests/test_fifo_cache.py (+7/-5) breezy/tests/test_filter_tree.py (+1/-0) breezy/tests/test_filters.py (+9/-3) breezy/tests/test_fixtures.py (+0/-2) breezy/tests/test_foreign.py (+25/-25) breezy/tests/test_generate_ids.py (+8/-6) breezy/tests/test_globbing.py (+14/-9) breezy/tests/test_gpg.py (+13/-9) breezy/tests/test_graph.py (+123/-109) breezy/tests/test_groupcompress.py (+96/-91) breezy/tests/test_hashcache.py (+2/-1) breezy/tests/test_help.py (+14/-12) breezy/tests/test_hooks.py (+34/-31) breezy/tests/test_http.py (+51/-42) breezy/tests/test_http_response.py (+35/-36) breezy/tests/test_i18n.py (+3/-2) breezy/tests/test_identitymap.py (+1/-2) breezy/tests/test_ignores.py (+22/-22) breezy/tests/test_import_tariff.py (+49/-49) breezy/tests/test_index.py (+175/-159) breezy/tests/test_info.py (+44/-43) breezy/tests/test_inv.py (+100/-75) breezy/tests/test_inventory_delta.py (+53/-52) breezy/tests/test_knit.py (+292/-259) breezy/tests/test_lazy_import.py (+80/-77) breezy/tests/test_lazy_regex.py (+10/-9) breezy/tests/test_lock.py (+0/-1) breezy/tests/test_lockdir.py (+17/-17) breezy/tests/test_log.py (+124/-118) breezy/tests/test_lru_cache.py (+35/-36) breezy/tests/test_lsprof.py (+3/-0) breezy/tests/test_mail_client.py (+23/-22) breezy/tests/test_matchers.py (+10/-9) breezy/tests/test_memorytree.py (+1/-1) breezy/tests/test_merge.py (+701/-674) breezy/tests/test_merge3.py (+71/-69) breezy/tests/test_merge_core.py (+62/-41) breezy/tests/test_merge_directive.py (+92/-89) breezy/tests/test_mergetools.py (+3/-2) breezy/tests/test_missing.py (+58/-42) breezy/tests/test_msgeditor.py (+34/-31) breezy/tests/test_multiparent.py (+29/-23) breezy/tests/test_nonascii.py (+10/-8) breezy/tests/test_options.py (+47/-39) breezy/tests/test_osutils.py (+214/-194) breezy/tests/test_osutils_encodings.py (+4/-4) breezy/tests/test_pack.py (+6/-4) breezy/tests/test_patch.py (+6/-3) breezy/tests/test_patches.py (+4/-3) breezy/tests/test_permissions.py (+26/-14) breezy/tests/test_plugins.py (+34/-32) breezy/tests/test_progress.py (+14/-21) breezy/tests/test_pyutils.py (+0/-2) breezy/tests/test_read_bundle.py (+3/-4) breezy/tests/test_reconfigure.py (+28/-18) breezy/tests/test_registry.py (+17/-12) breezy/tests/test_remote.py (+293/-221) breezy/tests/test_rename_map.py (+6/-6) breezy/tests/test_repository.py (+114/-89) breezy/tests/test_revert.py (+4/-2) breezy/tests/test_revision.py (+11/-9) breezy/tests/test_revisionspec.py (+22/-21) breezy/tests/test_revisiontree.py (+7/-7) breezy/tests/test_rio.py (+34/-32) breezy/tests/test_rules.py (+15/-15) breezy/tests/test_sampler.py (+0/-5) breezy/tests/test_scenarios.py (+4/-4) breezy/tests/test_script.py (+27/-25) breezy/tests/test_selftest.py (+374/-260) breezy/tests/test_server.py (+13/-12) breezy/tests/test_setup.py (+1/-0) breezy/tests/test_sftp_transport.py (+18/-16) breezy/tests/test_shelf.py (+34/-31) breezy/tests/test_shelf_ui.py (+11/-11) breezy/tests/test_smart.py (+328/-300) breezy/tests/test_smart_add.py (+3/-4) breezy/tests/test_smart_request.py (+10/-9) breezy/tests/test_smart_signals.py (+14/-5) breezy/tests/test_smart_transport.py (+263/-236) breezy/tests/test_smtp_connection.py (+8/-7) breezy/tests/test_source.py (+12/-12) breezy/tests/test_ssh_transport.py (+4/-4) breezy/tests/test_status.py (+24/-25) breezy/tests/test_strace.py (+5/-4) breezy/tests/test_subsume.py (+1/-2) breezy/tests/test_switch.py (+11/-13) breezy/tests/test_symbol_versioning.py (+22/-19) breezy/tests/test_tag.py (+7/-10) breezy/tests/test_test_server.py (+11/-9) breezy/tests/test_testament.py (+37/-37) breezy/tests/test_textfile.py (+4/-2) breezy/tests/test_textmerge.py (+4/-2) breezy/tests/test_timestamp.py (+56/-40) breezy/tests/test_trace.py (+37/-30) breezy/tests/test_transactions.py (+5/-5) breezy/tests/test_transform.py (+224/-171) breezy/tests/test_transport.py (+60/-56) breezy/tests/test_transport_log.py (+1/-1) breezy/tests/test_tree.py (+56/-48) breezy/tests/test_treebuilder.py (+2/-3) breezy/tests/test_treeshape.py (+1/-1) breezy/tests/test_tsort.py (+54/-54) breezy/tests/test_tuned_gzip.py (+4/-5) breezy/tests/test_ui.py (+71/-61) breezy/tests/test_uncommit.py (+4/-2) breezy/tests/test_upgrade.py (+11/-10) breezy/tests/test_upgrade_stacked.py (+9/-9) breezy/tests/test_upstream_import.py (+7/-9) breezy/tests/test_url_policy_open.py (+11/-10) breezy/tests/test_urlutils.py (+245/-200) breezy/tests/test_utextwrap.py (+25/-27) breezy/tests/test_version.py (+3/-2) breezy/tests/test_version_info.py (+26/-18) breezy/tests/test_versionedfile.py (+1/-1) breezy/tests/test_vf_search.py (+21/-14) breezy/tests/test_views.py (+1/-1) breezy/tests/test_weave.py (+162/-143) breezy/tests/test_whitebox.py (+2/-1) breezy/tests/test_win32utils.py (+21/-19) breezy/tests/test_workingtree.py (+35/-25) breezy/tests/test_workingtree_4.py (+67/-54) breezy/tests/test_wsgi.py (+2/-1) breezy/tests/test_xml.py (+27/-16) breezy/tests/testui.py (+1/-1) breezy/tests/transport_util.py (+2/-3) breezy/tests/treeshape.py (+1/-0) breezy/textmerge.py (+2/-1) breezy/timestamp.py (+13/-12) breezy/trace.py (+23/-17) breezy/transactions.py (+2/-2) breezy/transform.py (+112/-103) breezy/transport/__init__.py (+60/-52) breezy/transport/brokenrename.py (+3/-3) breezy/transport/decorator.py (+1/-1) breezy/transport/fakenfs.py (+1/-1) breezy/transport/fakevfat.py (+1/-1) breezy/transport/gio_transport.py (+43/-42) breezy/transport/http/__init__.py (+19/-20) breezy/transport/http/_urllib2_wrappers.py (+56/-48) breezy/transport/http/response.py (+8/-7) breezy/transport/http/wsgi.py (+2/-2) breezy/transport/local.py (+6/-6) breezy/transport/log.py (+19/-18) breezy/transport/memory.py (+10/-9) breezy/transport/nosmart.py (+0/-1) breezy/transport/pathfilter.py (+1/-1) breezy/transport/remote.py (+32/-30) breezy/transport/sftp.py (+34/-31) breezy/transport/ssh.py (+18/-9) breezy/transport/trace.py (+6/-6) breezy/transport/unlistable.py (+1/-1) breezy/tree.py (+59/-53) breezy/tsort.py (+17/-17) breezy/tuned_gzip.py (+4/-4) breezy/ui/__init__.py (+20/-19) breezy/ui/text.py (+20/-19) breezy/uncommit.py (+1/-1) breezy/upgrade.py (+21/-17) breezy/upstream_import.py (+3/-2) breezy/url_policy_open.py (+5/-5) breezy/urlutils.py (+81/-71) breezy/utextwrap.py (+10/-8) breezy/util/_bencode_py.py (+19/-14) breezy/util/simplemapi.py (+81/-72) breezy/version.py (+7/-4) breezy/version_info_formats/__init__.py (+12/-9) breezy/version_info_formats/format_custom.py (+5/-5) breezy/version_info_formats/format_python.py (+1/-4) breezy/version_info_formats/format_rio.py (+3/-3) breezy/views.py (+6/-6) breezy/win32utils.py (+51/-44) breezy/workingtree.py (+31/-29) setup.cfg (+0/-11) tools/rst2pdf.py (+22/-22) |
To merge this branch: | bzr merge lp:~jelmer/brz/more-cleanups |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Packman | Approve | ||
Review via email: mp+358611@code.launchpad.net |
Commit message
Sprinkle some PEP8iness.
Description of the change
Sprinkle some PEP8iness.
To post a comment you must log in.
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : | # |
Merging failed
https:/
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : | # |
Running landing tests failed
https:/
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : | # |
Running landing tests failed
https:/
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : | # |
Merging failed
https:/
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : | # |
Running landing tests failed
https:/
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'breezy/__init__.py' |
2 | --- breezy/__init__.py 2018-09-16 09:45:55 +0000 |
3 | +++ breezy/__init__.py 2018-11-16 18:34:24 +0000 |
4 | @@ -53,6 +53,7 @@ |
5 | |
6 | version_info = (3, 0, 0, 'alpha', 1) |
7 | |
8 | + |
9 | def _format_version_tuple(version_info): |
10 | """Turn a version number 2, 3 or 5-tuple into a short string. |
11 | |
12 | @@ -129,7 +130,7 @@ |
13 | |
14 | def _patch_filesystem_default_encoding(new_enc): |
15 | """Change the Python process global encoding for filesystem names |
16 | - |
17 | + |
18 | The effect is to change how open() and other builtin functions handle |
19 | unicode filenames on posix systems. This should only be done near startup. |
20 | |
21 | @@ -142,15 +143,15 @@ |
22 | try: |
23 | import ctypes |
24 | old_ptr = ctypes.c_void_p.in_dll(ctypes.pythonapi, |
25 | - "Py_FileSystemDefaultEncoding") |
26 | + "Py_FileSystemDefaultEncoding") |
27 | if is_py3: |
28 | has_enc = ctypes.c_int.in_dll(ctypes.pythonapi, |
29 | - "Py_HasFileSystemDefaultEncoding") |
30 | + "Py_HasFileSystemDefaultEncoding") |
31 | as_utf8 = ctypes.PYFUNCTYPE( |
32 | ctypes.POINTER(ctypes.c_char), ctypes.py_object)( |
33 | ("PyUnicode_AsUTF8", ctypes.pythonapi)) |
34 | except (ImportError, ValueError): |
35 | - return # No ctypes or not CPython implementation, do nothing |
36 | + return # No ctypes or not CPython implementation, do nothing |
37 | if is_py3: |
38 | new_enc = sys.intern(new_enc) |
39 | enc_ptr = as_utf8(new_enc) |
40 | |
41 | === modified file 'breezy/_annotator_py.py' |
42 | --- breezy/_annotator_py.py 2018-02-24 15:50:23 +0000 |
43 | +++ breezy/_annotator_py.py 2018-11-16 18:34:24 +0000 |
44 | @@ -94,15 +94,15 @@ |
45 | needed_keys = set() |
46 | next_parent_map.update(self._vf.get_parent_map(parent_lookup)) |
47 | for key, parent_keys in viewitems(next_parent_map): |
48 | - if parent_keys is None: # No graph versionedfile |
49 | + if parent_keys is None: # No graph versionedfile |
50 | parent_keys = () |
51 | next_parent_map[key] = () |
52 | self._update_needed_children(key, parent_keys) |
53 | needed_keys.update([key for key in parent_keys |
54 | - if key not in parent_map]) |
55 | + if key not in parent_map]) |
56 | parent_map.update(next_parent_map) |
57 | - # _heads_provider does some graph caching, so it is only valid while |
58 | - # self._parent_map hasn't changed |
59 | + # _heads_provider does some graph caching, so it is only valid |
60 | + # while self._parent_map hasn't changed |
61 | self._heads_provider = None |
62 | return vf_keys_needed, ann_keys_needed |
63 | |
64 | @@ -118,7 +118,7 @@ |
65 | keys, ann_keys = self._get_needed_keys(key) |
66 | if pb is not None: |
67 | pb.update('getting stream', 0, len(keys)) |
68 | - stream = self._vf.get_record_stream(keys, 'topological', True) |
69 | + stream = self._vf.get_record_stream(keys, 'topological', True) |
70 | for idx, record in enumerate(stream): |
71 | if pb is not None: |
72 | pb.update('extracting', 0, len(keys)) |
73 | @@ -148,8 +148,8 @@ |
74 | parent_lines = self._text_cache[parent_key] |
75 | parent_annotations = self._annotations_cache[parent_key] |
76 | # PatienceSequenceMatcher should probably be part of Policy |
77 | - matcher = patiencediff.PatienceSequenceMatcher(None, |
78 | - parent_lines, text) |
79 | + matcher = patiencediff.PatienceSequenceMatcher( |
80 | + None, parent_lines, text) |
81 | matching_blocks = matcher.get_matching_blocks() |
82 | return parent_annotations, matching_blocks |
83 | |
84 | @@ -157,7 +157,7 @@ |
85 | """Reannotate this text relative to its first parent.""" |
86 | (parent_annotations, |
87 | matching_blocks) = self._get_parent_annotations_and_matches( |
88 | - key, lines, parent_key) |
89 | + key, lines, parent_key) |
90 | |
91 | for parent_idx, lines_idx, match_len in matching_blocks: |
92 | # For all matching regions we copy across the parent annotations |
93 | @@ -169,7 +169,7 @@ |
94 | """Reannotate this text relative to a second (or more) parent.""" |
95 | (parent_annotations, |
96 | matching_blocks) = self._get_parent_annotations_and_matches( |
97 | - key, lines, parent_key) |
98 | + key, lines, parent_key) |
99 | |
100 | last_ann = None |
101 | last_parent = None |
102 | @@ -262,7 +262,8 @@ |
103 | lines the text of "key" as a list of lines |
104 | """ |
105 | with ui.ui_factory.nested_progress_bar() as pb: |
106 | - for text_key, text, num_lines in self._get_needed_texts(key, pb=pb): |
107 | + for text_key, text, num_lines in self._get_needed_texts( |
108 | + key, pb=pb): |
109 | self._annotate_one(text_key, text, num_lines) |
110 | try: |
111 | annotations = self._annotations_cache[key] |
112 | @@ -306,7 +307,8 @@ |
113 | else: |
114 | the_heads = heads(annotation) |
115 | if len(the_heads) == 1: |
116 | - for head in the_heads: break # get the item out of the set |
117 | + for head in the_heads: |
118 | + break # get the item out of the set |
119 | else: |
120 | head = self._resolve_annotation_tie(the_heads, line, |
121 | custom_tiebreaker) |
122 | |
123 | === modified file 'breezy/_known_graph_py.py' |
124 | --- breezy/_known_graph_py.py 2017-10-28 12:46:54 +0000 |
125 | +++ breezy/_known_graph_py.py 2018-11-16 18:34:24 +0000 |
126 | @@ -106,7 +106,7 @@ |
127 | |
128 | def _find_tips(self): |
129 | return [node for node in viewvalues(self._nodes) |
130 | - if not node.child_keys] |
131 | + if not node.child_keys] |
132 | |
133 | def _find_gdfo(self): |
134 | nodes = self._nodes |
135 | @@ -144,7 +144,7 @@ |
136 | |
137 | If this fills in a ghost, then the gdfos of all children will be |
138 | updated accordingly. |
139 | - |
140 | + |
141 | :param key: The node being added. If this is a duplicate, this is a |
142 | no-op. |
143 | :param parent_keys: The parents of the given node. |
144 | @@ -163,9 +163,10 @@ |
145 | parent_keys = list(parent_keys) |
146 | existing_parent_keys = list(node.parent_keys) |
147 | if parent_keys == existing_parent_keys: |
148 | - return # Identical content |
149 | + return # Identical content |
150 | else: |
151 | - raise ValueError('Parent key mismatch, existing node %s' |
152 | + raise ValueError( |
153 | + 'Parent key mismatch, existing node %s' |
154 | ' has parents of %s not %s' |
155 | % (key, existing_parent_keys, parent_keys)) |
156 | else: |
157 | @@ -319,7 +320,7 @@ |
158 | |
159 | result = [] |
160 | for prefix in sorted(prefix_tips): |
161 | - pending = sorted(prefix_tips[prefix], key=lambda n:n.key, |
162 | + pending = sorted(prefix_tips[prefix], key=lambda n: n.key, |
163 | reverse=True) |
164 | while pending: |
165 | node = pending.pop() |
166 | @@ -344,23 +345,23 @@ |
167 | from breezy import tsort |
168 | as_parent_map = dict((node.key, node.parent_keys) |
169 | for node in viewvalues(self._nodes) |
170 | - if node.parent_keys is not None) |
171 | + if node.parent_keys is not None) |
172 | # We intentionally always generate revnos and never force the |
173 | # mainline_revisions |
174 | # Strip the sequence_number that merge_sort generates |
175 | return [_MergeSortNode(key, merge_depth, revno, end_of_merge) |
176 | for _, key, merge_depth, revno, end_of_merge |
177 | - in tsort.merge_sort(as_parent_map, tip_key, |
178 | - mainline_revisions=None, |
179 | - generate_revno=True)] |
180 | - |
181 | + in tsort.merge_sort(as_parent_map, tip_key, |
182 | + mainline_revisions=None, |
183 | + generate_revno=True)] |
184 | + |
185 | def get_parent_keys(self, key): |
186 | """Get the parents for a key |
187 | - |
188 | + |
189 | Returns a list containg the parents keys. If the key is a ghost, |
190 | None is returned. A KeyError will be raised if the key is not in |
191 | the graph. |
192 | - |
193 | + |
194 | :param keys: Key to check (eg revision_id) |
195 | :return: A list of parents |
196 | """ |
197 | @@ -368,10 +369,10 @@ |
198 | |
199 | def get_child_keys(self, key): |
200 | """Get the children for a key |
201 | - |
202 | + |
203 | Returns a list containg the children keys. A KeyError will be raised |
204 | if the key is not in the graph. |
205 | - |
206 | + |
207 | :param keys: Key to check (eg revision_id) |
208 | :return: A list of children |
209 | """ |
210 | |
211 | === modified file 'breezy/_patiencediff_py.py' |
212 | --- breezy/_patiencediff_py.py 2017-06-04 18:09:30 +0000 |
213 | +++ breezy/_patiencediff_py.py 2018-11-16 18:34:24 +0000 |
214 | @@ -23,9 +23,6 @@ |
215 | from .trace import mutter |
216 | |
217 | |
218 | -__all__ = ['PatienceSequenceMatcher', 'unified_diff', 'unified_diff_files'] |
219 | - |
220 | - |
221 | def unique_lcs_py(a, b): |
222 | """Find the longest common subset for unique lines. |
223 | |
224 | |
225 | === modified file 'breezy/_rio_py.py' |
226 | --- breezy/_rio_py.py 2017-06-10 01:57:00 +0000 |
227 | +++ breezy/_rio_py.py 2018-11-16 18:34:24 +0000 |
228 | @@ -25,6 +25,8 @@ |
229 | ) |
230 | |
231 | _tag_re = re.compile(r'^[-a-zA-Z0-9_]+$') |
232 | + |
233 | + |
234 | def _valid_tag(tag): |
235 | if not isinstance(tag, str): |
236 | raise TypeError(tag) |
237 | @@ -55,11 +57,11 @@ |
238 | if line == u'\n': |
239 | break # end of stanza |
240 | real_l = line |
241 | - if line[0] == u'\t': # continues previous value |
242 | + if line[0] == u'\t': # continues previous value |
243 | if tag is None: |
244 | raise ValueError('invalid continuation line %r' % real_l) |
245 | accum_value.append(u'\n' + line[1:-1]) |
246 | - else: # new tag:value line |
247 | + else: # new tag:value line |
248 | if tag is not None: |
249 | stanza.add(tag, u''.join(accum_value)) |
250 | try: |
251 | @@ -70,9 +72,9 @@ |
252 | tag = str(line[:colon_index]) |
253 | if not _valid_tag(tag): |
254 | raise ValueError("invalid rio tag %r" % (tag,)) |
255 | - accum_value = [line[colon_index+2:-1]] |
256 | + accum_value = [line[colon_index + 2:-1]] |
257 | |
258 | - if tag is not None: # add last tag-value |
259 | + if tag is not None: # add last tag-value |
260 | stanza.add(tag, u''.join(accum_value)) |
261 | return stanza |
262 | else: # didn't see any content |
263 | |
264 | === modified file 'breezy/_static_tuple_py.py' |
265 | --- breezy/_static_tuple_py.py 2017-11-12 13:53:51 +0000 |
266 | +++ breezy/_static_tuple_py.py 2018-11-16 18:34:24 +0000 |
267 | @@ -44,8 +44,8 @@ |
268 | for bit in args: |
269 | if type(bit) not in _valid_types: |
270 | raise TypeError('StaticTuple can only point to' |
271 | - ' StaticTuple, str, unicode, int, float, bool, or' |
272 | - ' None not %s' % (type(bit),)) |
273 | + ' StaticTuple, str, unicode, int, float, bool, or' |
274 | + ' None not %s' % (type(bit),)) |
275 | # We don't need to pass args to tuple.__init__, because that was |
276 | # already handled in __new__. |
277 | tuple.__init__(self) |
278 | |
279 | === modified file 'breezy/_termcolor.py' |
280 | --- breezy/_termcolor.py 2012-08-23 15:04:34 +0000 |
281 | +++ breezy/_termcolor.py 2018-11-16 18:34:24 +0000 |
282 | @@ -75,4 +75,3 @@ |
283 | return curses.tigetnum('colors') > 2 |
284 | except curses.error: |
285 | return False |
286 | - |
287 | |
288 | === modified file 'breezy/annotate.py' |
289 | --- breezy/annotate.py 2018-11-16 12:35:23 +0000 |
290 | +++ breezy/annotate.py 2018-11-16 18:34:24 +0000 |
291 | @@ -93,8 +93,8 @@ |
292 | current_rev.timezone = osutils.local_time_offset() |
293 | else: |
294 | current_rev = None |
295 | - annotation = list(_expand_annotations(annotations, branch, |
296 | - current_rev)) |
297 | + annotation = list(_expand_annotations( |
298 | + annotations, branch, current_rev)) |
299 | _print_annotations(annotation, verbose, to_file, full, encoding) |
300 | |
301 | |
302 | @@ -144,8 +144,8 @@ |
303 | this = origin |
304 | else: |
305 | this = b'' |
306 | - to_file.write('%*s | %s' % (max_origin_len, this.decode('utf-8'), |
307 | - text.decode(encoding))) |
308 | + to_file.write('%*s | %s' % ( |
309 | + max_origin_len, this.decode('utf-8'), text.decode(encoding))) |
310 | last_rev_id = origin |
311 | return |
312 | |
313 | @@ -172,8 +172,9 @@ |
314 | # Once KnownGraph gets an 'add_node()' function, we can use |
315 | # VF.get_known_graph_ancestry(). |
316 | graph = repository.get_graph() |
317 | - revision_graph = dict(((key, value) for key, value in |
318 | - graph.iter_ancestry(current_rev.parent_ids) if value is not None)) |
319 | + revision_graph = { |
320 | + key: value for key, value in |
321 | + graph.iter_ancestry(current_rev.parent_ids) if value is not None} |
322 | revision_graph = _strip_NULL_ghosts(revision_graph) |
323 | revision_graph[last_revision] = current_rev.parent_ids |
324 | merge_sorted_revisions = tsort.merge_sort( |
325 | @@ -181,9 +182,10 @@ |
326 | last_revision, |
327 | None, |
328 | generate_revno=True) |
329 | - revision_id_to_revno = dict((rev_id, revno) |
330 | + revision_id_to_revno = { |
331 | + rev_id: revno |
332 | for seq_num, rev_id, depth, revno, end_of_merge in |
333 | - merge_sorted_revisions) |
334 | + merge_sorted_revisions} |
335 | else: |
336 | # TODO(jelmer): Only look up the revision ids that we need (i.e. those |
337 | # in revision_ids). Possibly add a HPSS call that can look those up |
338 | @@ -196,9 +198,9 @@ |
339 | "%d?" % (branch.revno() + 1),) |
340 | revisions[CURRENT_REVISION] = current_rev |
341 | revisions.update( |
342 | - entry for entry in |
343 | - repository.iter_revisions(revision_ids) |
344 | - if entry[1] is not None) |
345 | + entry for entry in |
346 | + repository.iter_revisions(revision_ids) |
347 | + if entry[1] is not None) |
348 | for origin, text in annotations: |
349 | text = text.rstrip(b'\r\n') |
350 | if origin == last_origin: |
351 | @@ -208,8 +210,8 @@ |
352 | if origin not in revisions: |
353 | (revno_str, author, date_str) = ('?', '?', '?') |
354 | else: |
355 | - revno_str = '.'.join(str(i) for i in |
356 | - revision_id_to_revno[origin]) |
357 | + revno_str = '.'.join( |
358 | + str(i) for i in revision_id_to_revno[origin]) |
359 | rev = revisions[origin] |
360 | tz = rev.timezone or 0 |
361 | date_str = time.strftime('%Y%m%d', |
362 | @@ -280,8 +282,8 @@ |
363 | new_cur = 0 |
364 | if matching_blocks is None: |
365 | plain_parent_lines = [l for r, l in parent_lines] |
366 | - matcher = patiencediff.PatienceSequenceMatcher(None, |
367 | - plain_parent_lines, new_lines) |
368 | + matcher = patiencediff.PatienceSequenceMatcher( |
369 | + None, plain_parent_lines, new_lines) |
370 | matching_blocks = matcher.get_matching_blocks() |
371 | lines = [] |
372 | for i, j, n in matching_blocks: |
373 | @@ -356,11 +358,11 @@ |
374 | for right_idx, child_idx, match_len in match_blocks: |
375 | # All the lines that don't match are just passed along |
376 | if child_idx > last_child_idx: |
377 | - output_extend(child_lines[start_child + last_child_idx |
378 | - :start_child + child_idx]) |
379 | + output_extend(child_lines[start_child + last_child_idx: |
380 | + start_child + child_idx]) |
381 | for offset in range(match_len): |
382 | - left = child_lines[start_child+child_idx+offset] |
383 | - right = right_lines[start_right+right_idx+offset] |
384 | + left = child_lines[start_child + child_idx + offset] |
385 | + right = right_lines[start_right + right_idx + offset] |
386 | if left[0] == right[0]: |
387 | # The annotations match, just return the left one |
388 | output_append(left) |
389 | @@ -410,7 +412,8 @@ |
390 | # be the bulk of the lines, and they will need no further processing. |
391 | lines = [] |
392 | lines_extend = lines.extend |
393 | - last_right_idx = 0 # The line just after the last match from the right side |
394 | + # The line just after the last match from the right side |
395 | + last_right_idx = 0 |
396 | last_left_idx = 0 |
397 | matching_left_and_right = _get_matching_blocks(right_parent_lines, |
398 | annotated_lines) |
399 | |
400 | === modified file 'breezy/archive/__init__.py' |
401 | --- breezy/archive/__init__.py 2018-05-20 12:21:54 +0000 |
402 | +++ breezy/archive/__init__.py 2018-11-16 18:34:24 +0000 |
403 | @@ -52,13 +52,13 @@ |
404 | """Register an archive format. |
405 | """ |
406 | registry.Registry.register(self, key, factory, help, |
407 | - ArchiveFormatInfo(extensions)) |
408 | + ArchiveFormatInfo(extensions)) |
409 | self._register_extensions(key, extensions) |
410 | |
411 | def register_lazy(self, key, module_name, member_name, extensions, |
412 | help=None): |
413 | registry.Registry.register_lazy(self, key, module_name, member_name, |
414 | - help, ArchiveFormatInfo(extensions)) |
415 | + help, ArchiveFormatInfo(extensions)) |
416 | self._register_extensions(key, extensions) |
417 | |
418 | def _register_extensions(self, name, extensions): |
419 | @@ -94,7 +94,7 @@ |
420 | format_registry.register_lazy('tgz', 'breezy.archive.tar', |
421 | 'tgz_generator', ['.tar.gz', '.tgz']) |
422 | format_registry.register_lazy('tbz2', 'breezy.archive.tar', |
423 | - 'tbz_generator', ['.tar.bz2', '.tbz2']) |
424 | + 'tbz_generator', ['.tar.bz2', '.tbz2']) |
425 | format_registry.register_lazy('tlzma', 'breezy.archive.tar', |
426 | 'tar_lzma_generator', ['.tar.lzma']) |
427 | format_registry.register_lazy('txz', 'breezy.archive.tar', |
428 | |
429 | === modified file 'breezy/archive/tar.py' |
430 | --- breezy/archive/tar.py 2018-10-29 11:27:33 +0000 |
431 | +++ breezy/archive/tar.py 2018-11-16 18:34:24 +0000 |
432 | @@ -138,7 +138,7 @@ |
433 | zipstream = gzip.GzipFile(basename, 'w', fileobj=buf, |
434 | mtime=root_mtime) |
435 | for chunk in tarball_generator( |
436 | - tree, root, subdir, force_mtime): |
437 | + tree, root, subdir, force_mtime): |
438 | zipstream.write(chunk) |
439 | # Yield the data that was written so far, rinse, repeat. |
440 | yield buf.getvalue() |
441 | @@ -160,7 +160,7 @@ |
442 | |
443 | |
444 | def plain_tar_generator(tree, dest, root, subdir, |
445 | - force_mtime=None): |
446 | + force_mtime=None): |
447 | """Export this tree to a new tar file. |
448 | |
449 | `dest` will be created holding the contents of this tree; if it |
450 | @@ -188,13 +188,13 @@ |
451 | |
452 | if sys.version_info[0] == 2: |
453 | compressor = lzma.LZMACompressor( |
454 | - options={"format": compression_format}) |
455 | + options={"format": compression_format}) |
456 | else: |
457 | compressor = lzma.LZMACompressor( |
458 | - format={ |
459 | - 'xz': lzma.FORMAT_XZ, |
460 | - 'raw': lzma.FORMAT_RAW, |
461 | - 'alone': lzma.FORMAT_ALONE, |
462 | + format={ |
463 | + 'xz': lzma.FORMAT_XZ, |
464 | + 'raw': lzma.FORMAT_RAW, |
465 | + 'alone': lzma.FORMAT_ALONE, |
466 | }[compression_format]) |
467 | |
468 | for chunk in tarball_generator( |
469 | |
470 | === modified file 'breezy/archive/zip.py' |
471 | --- breezy/archive/zip.py 2018-10-29 11:27:33 +0000 |
472 | +++ breezy/archive/zip.py 2018-11-16 18:34:24 +0000 |
473 | @@ -45,7 +45,7 @@ |
474 | |
475 | |
476 | def zip_archive_generator(tree, dest, root, subdir=None, |
477 | - force_mtime=None): |
478 | + force_mtime=None): |
479 | """ Export this tree to a new zip file. |
480 | |
481 | `dest` will be created holding the contents of this tree; if it |
482 | @@ -54,7 +54,7 @@ |
483 | compression = zipfile.ZIP_DEFLATED |
484 | with tempfile.SpooledTemporaryFile() as buf: |
485 | with closing(zipfile.ZipFile(buf, "w", compression)) as zipf, \ |
486 | - tree.lock_read(): |
487 | + tree.lock_read(): |
488 | for dp, tp, ie in _export_iter_entries(tree, subdir): |
489 | mutter(" export {%s} kind %s to %s", tp, ie.kind, dest) |
490 | |
491 | @@ -68,8 +68,8 @@ |
492 | filename = osutils.pathjoin(root, dp) |
493 | if ie.kind == "file": |
494 | zinfo = zipfile.ZipInfo( |
495 | - filename=filename, |
496 | - date_time=date_time) |
497 | + filename=filename, |
498 | + date_time=date_time) |
499 | zinfo.compress_type = compression |
500 | zinfo.external_attr = _FILE_ATTR |
501 | content = tree.get_file_text(tp) |
502 | @@ -79,15 +79,15 @@ |
503 | # to the zip routine that they are really directories and |
504 | # not just empty files. |
505 | zinfo = zipfile.ZipInfo( |
506 | - filename=filename + '/', |
507 | - date_time=date_time) |
508 | + filename=filename + '/', |
509 | + date_time=date_time) |
510 | zinfo.compress_type = compression |
511 | zinfo.external_attr = _DIR_ATTR |
512 | zipf.writestr(zinfo, '') |
513 | elif ie.kind == "symlink": |
514 | zinfo = zipfile.ZipInfo( |
515 | - filename=(filename + '.lnk'), |
516 | - date_time=date_time) |
517 | + filename=(filename + '.lnk'), |
518 | + date_time=date_time) |
519 | zinfo.compress_type = compression |
520 | zinfo.external_attr = _FILE_ATTR |
521 | zipf.writestr(zinfo, tree.get_symlink_target(tp)) |
522 | |
523 | === modified file 'breezy/bencode.py' |
524 | --- breezy/bencode.py 2018-11-10 17:52:47 +0000 |
525 | +++ breezy/bencode.py 2018-11-16 18:34:24 +0000 |
526 | @@ -24,4 +24,9 @@ |
527 | from ._bencode_pyx import bdecode, bdecode_as_tuple, bencode, Bencached |
528 | except ImportError as e: |
529 | osutils.failed_to_load_extension(e) |
530 | - from .util._bencode_py import bdecode, bdecode_as_tuple, bencode, Bencached # noqa: F401 |
531 | + from .util._bencode_py import ( # noqa: F401 |
532 | + bdecode, |
533 | + bdecode_as_tuple, |
534 | + bencode, |
535 | + Bencached, |
536 | + ) |
537 | |
538 | === modified file 'breezy/bisect.py' |
539 | --- breezy/bisect.py 2018-11-10 17:52:47 +0000 |
540 | +++ breezy/bisect.py 2018-11-16 18:34:24 +0000 |
541 | @@ -138,8 +138,8 @@ |
542 | repo = self._branch.repository |
543 | with repo.lock_read(): |
544 | graph = repo.get_graph() |
545 | - rev_sequence = graph.iter_lefthand_ancestry(last_revid, |
546 | - (_mod_revision.NULL_REVISION,)) |
547 | + rev_sequence = graph.iter_lefthand_ancestry( |
548 | + last_revid, (_mod_revision.NULL_REVISION,)) |
549 | high_revid = None |
550 | low_revid = None |
551 | between_revs = [] |
552 | @@ -247,9 +247,9 @@ |
553 | self._find_range_and_middle() |
554 | # If we've found the "final" revision, check for a |
555 | # merge point. |
556 | - while ((self._middle_revid == self._high_revid |
557 | - or self._middle_revid == self._low_revid) |
558 | - and self.is_merge_point(self._middle_revid)): |
559 | + while ((self._middle_revid == self._high_revid or |
560 | + self._middle_revid == self._low_revid) and |
561 | + self.is_merge_point(self._middle_revid)): |
562 | for parent in self.get_parent_revids(self._middle_revid): |
563 | if parent == self._low_revid: |
564 | continue |
565 | @@ -340,7 +340,8 @@ |
566 | bisect_log.save() |
567 | return False |
568 | |
569 | - def run(self, subcommand, args_list, directory='.', revision=None, output=None): |
570 | + def run(self, subcommand, args_list, directory='.', revision=None, |
571 | + output=None): |
572 | """Handle the bisect command.""" |
573 | |
574 | log_fn = None |
575 | @@ -401,7 +402,7 @@ |
576 | self._set_state(controldir, revspec, "yes") |
577 | |
578 | def no(self, controldir, revspec): |
579 | - """Mark that a given revision does not have the state we're looking for.""" |
580 | + """Mark a given revision as wrong.""" |
581 | self._set_state(controldir, revspec, "no") |
582 | |
583 | def move(self, controldir, revspec): |
584 | |
585 | === modified file 'breezy/bisect_multi.py' |
586 | --- breezy/bisect_multi.py 2011-12-19 13:23:58 +0000 |
587 | +++ breezy/bisect_multi.py 2018-11-16 18:34:24 +0000 |
588 | @@ -58,7 +58,7 @@ |
589 | search_keys.append((location - delta, key)) |
590 | elif status == 1: |
591 | search_keys.append((location + delta, key)) |
592 | - elif status == False: |
593 | + elif status is False: |
594 | # not present, stop searching |
595 | continue |
596 | else: |
597 | |
598 | === modified file 'breezy/branch.py' |
599 | --- breezy/branch.py 2018-11-16 12:35:23 +0000 |
600 | +++ breezy/branch.py 2018-11-16 18:34:24 +0000 |
601 | @@ -56,7 +56,7 @@ |
602 | class UnstackableBranchFormat(errors.BzrError): |
603 | |
604 | _fmt = ("The branch '%(url)s'(%(format)s) is not a stackable format. " |
605 | - "You will need to upgrade the branch to permit branch stacking.") |
606 | + "You will need to upgrade the branch to permit branch stacking.") |
607 | |
608 | def __init__(self, format, url): |
609 | errors.BzrError.__init__(self) |
610 | @@ -154,7 +154,8 @@ |
611 | repository._iter_for_revno( |
612 | self.repository, self._partial_revision_history_cache, |
613 | stop_index=stop_index, stop_revision=stop_revision) |
614 | - if self._partial_revision_history_cache[-1] == _mod_revision.NULL_REVISION: |
615 | + if self._partial_revision_history_cache[-1] == \ |
616 | + _mod_revision.NULL_REVISION: |
617 | self._partial_revision_history_cache.pop() |
618 | |
619 | def _get_check_refs(self): |
620 | @@ -172,17 +173,21 @@ |
621 | For instance, if the branch is at URL/.bzr/branch, |
622 | Branch.open(URL) -> a Branch instance. |
623 | """ |
624 | - control = controldir.ControlDir.open(base, |
625 | - possible_transports=possible_transports, _unsupported=_unsupported) |
626 | - return control.open_branch(unsupported=_unsupported, |
627 | + control = controldir.ControlDir.open( |
628 | + base, possible_transports=possible_transports, |
629 | + _unsupported=_unsupported) |
630 | + return control.open_branch( |
631 | + unsupported=_unsupported, |
632 | possible_transports=possible_transports) |
633 | |
634 | @staticmethod |
635 | def open_from_transport(transport, name=None, _unsupported=False, |
636 | - possible_transports=None): |
637 | + possible_transports=None): |
638 | """Open the branch rooted at transport""" |
639 | - control = controldir.ControlDir.open_from_transport(transport, _unsupported) |
640 | - return control.open_branch(name=name, unsupported=_unsupported, |
641 | + control = controldir.ControlDir.open_from_transport( |
642 | + transport, _unsupported) |
643 | + return control.open_branch( |
644 | + name=name, unsupported=_unsupported, |
645 | possible_transports=possible_transports) |
646 | |
647 | @staticmethod |
648 | @@ -193,12 +198,13 @@ |
649 | |
650 | Basically we keep looking up until we find the control directory or |
651 | run into the root. If there isn't one, raises NotBranchError. |
652 | - If there is one and it is either an unrecognised format or an unsupported |
653 | - format, UnknownFormatError or UnsupportedFormatError are raised. |
654 | - If there is one, it is returned, along with the unused portion of url. |
655 | + If there is one and it is either an unrecognised format or an |
656 | + unsupported format, UnknownFormatError or UnsupportedFormatError are |
657 | + raised. If there is one, it is returned, along with the unused portion |
658 | + of url. |
659 | """ |
660 | - control, relpath = controldir.ControlDir.open_containing(url, |
661 | - possible_transports) |
662 | + control, relpath = controldir.ControlDir.open_containing( |
663 | + url, possible_transports) |
664 | branch = control.open_branch(possible_transports=possible_transports) |
665 | return (branch, relpath) |
666 | |
667 | @@ -270,7 +276,7 @@ |
668 | # Silently fall back to local implicit nick if the master is |
669 | # unavailable |
670 | mutter("Could not connect to bound branch, " |
671 | - "falling back to local nick.\n " + str(e)) |
672 | + "falling back to local nick.\n " + str(e)) |
673 | return config.get_nickname() |
674 | |
675 | def _set_nick(self, nick): |
676 | @@ -299,8 +305,8 @@ |
677 | new_history = [] |
678 | check_not_reserved_id = _mod_revision.check_not_reserved_id |
679 | # Do not include ghosts or graph origin in revision_history |
680 | - while (current_rev_id in parents_map and |
681 | - len(parents_map[current_rev_id]) > 0): |
682 | + while (current_rev_id in parents_map |
683 | + and len(parents_map[current_rev_id]) > 0): |
684 | check_not_reserved_id(current_rev_id) |
685 | new_history.append(current_rev_id) |
686 | current_rev_id = parents_map[current_rev_id][0] |
687 | @@ -407,17 +413,18 @@ |
688 | This dictionary should not be modified by the caller. |
689 | """ |
690 | if 'evil' in debug.debug_flags: |
691 | - mutter_callsite(3, "get_revision_id_to_revno_map scales with ancestry.") |
692 | + mutter_callsite( |
693 | + 3, "get_revision_id_to_revno_map scales with ancestry.") |
694 | with self.lock_read(): |
695 | if self._revision_id_to_revno_cache is not None: |
696 | mapping = self._revision_id_to_revno_cache |
697 | else: |
698 | mapping = self._gen_revno_map() |
699 | self._cache_revision_id_to_revno(mapping) |
700 | - # TODO: jam 20070417 Since this is being cached, should we be returning |
701 | - # a copy? |
702 | - # I would rather not, and instead just declare that users should not |
703 | - # modify the return value. |
704 | + # TODO: jam 20070417 Since this is being cached, should we be |
705 | + # returning a copy? |
706 | + # I would rather not, and instead just declare that users should |
707 | + # not modify the return value. |
708 | return mapping |
709 | |
710 | def _gen_revno_map(self): |
711 | @@ -430,13 +437,14 @@ |
712 | |
713 | :return: A dictionary mapping revision_id => dotted revno. |
714 | """ |
715 | - revision_id_to_revno = dict((rev_id, revno) |
716 | - for rev_id, depth, revno, end_of_merge |
717 | - in self.iter_merge_sorted_revisions()) |
718 | + revision_id_to_revno = { |
719 | + rev_id: revno for rev_id, depth, revno, end_of_merge |
720 | + in self.iter_merge_sorted_revisions()} |
721 | return revision_id_to_revno |
722 | |
723 | def iter_merge_sorted_revisions(self, start_revision_id=None, |
724 | - stop_revision_id=None, stop_rule='exclude', direction='reverse'): |
725 | + stop_revision_id=None, |
726 | + stop_rule='exclude', direction='reverse'): |
727 | """Walk the revisions for a branch in merge sorted order. |
728 | |
729 | Merge sorted order is the output from a merge-aware, |
730 | @@ -454,7 +462,7 @@ |
731 | * 'include' - the stop revision is the last item in the result |
732 | * 'with-merges' - include the stop revision and all of its |
733 | merged revisions in the result |
734 | - * 'with-merges-without-common-ancestry' - filter out revisions |
735 | + * 'with-merges-without-common-ancestry' - filter out revisions |
736 | that are in both ancestries |
737 | :param direction: either 'reverse' or 'forward': |
738 | |
739 | @@ -503,7 +511,8 @@ |
740 | raise ValueError('invalid direction %r' % direction) |
741 | |
742 | def _filter_merge_sorted_revisions(self, merge_sorted_revisions, |
743 | - start_revision_id, stop_revision_id, stop_rule): |
744 | + start_revision_id, stop_revision_id, |
745 | + stop_rule): |
746 | """Iterate over an inclusive range of sorted revisions.""" |
747 | rev_iter = iter(merge_sorted_revisions) |
748 | if start_revision_id is not None: |
749 | @@ -564,10 +573,10 @@ |
750 | if rev_id == left_parent: |
751 | # reached the left parent after the stop_revision |
752 | return |
753 | - if (not reached_stop_revision_id or |
754 | - rev_id in revision_id_whitelist): |
755 | + if (not reached_stop_revision_id |
756 | + or rev_id in revision_id_whitelist): |
757 | yield (rev_id, node.merge_depth, node.revno, |
758 | - node.end_of_merge) |
759 | + node.end_of_merge) |
760 | if reached_stop_revision_id or rev_id == stop_revision_id: |
761 | # only do the merged revs of rev_id from now on |
762 | rev = self.repository.get_revision(rev_id) |
763 | @@ -629,7 +638,8 @@ |
764 | """Tell this branch object not to release the physical lock when this |
765 | object is unlocked. |
766 | |
767 | - If lock_write doesn't return a token, then this method is not supported. |
768 | + If lock_write doesn't return a token, then this method is not |
769 | + supported. |
770 | """ |
771 | self.control_files.leave_in_place() |
772 | |
773 | @@ -637,7 +647,8 @@ |
774 | """Tell this branch object to release the physical lock when this |
775 | object is unlocked, even if it didn't originally acquire it. |
776 | |
777 | - If lock_write doesn't return a token, then this method is not supported. |
778 | + If lock_write doesn't return a token, then this method is not |
779 | + supported. |
780 | """ |
781 | self.control_files.dont_leave_in_place() |
782 | |
783 | @@ -680,7 +691,7 @@ |
784 | """ |
785 | with self.lock_write(): |
786 | return InterBranch.get(from_branch, self).fetch( |
787 | - last_revision, limit=limit) |
788 | + last_revision, limit=limit) |
789 | |
790 | def get_bound_location(self): |
791 | """Return the URL of the branch we are bound to. |
792 | @@ -708,15 +719,15 @@ |
793 | :param revprops: Optional dictionary of revision properties. |
794 | :param revision_id: Optional revision id. |
795 | :param lossy: Whether to discard data that can not be natively |
796 | - represented, when pushing to a foreign VCS |
797 | + represented, when pushing to a foreign VCS |
798 | """ |
799 | |
800 | if config_stack is None: |
801 | config_stack = self.get_config_stack() |
802 | |
803 | - return self.repository.get_commit_builder(self, parents, config_stack, |
804 | - timestamp, timezone, committer, revprops, revision_id, |
805 | - lossy) |
806 | + return self.repository.get_commit_builder( |
807 | + self, parents, config_stack, timestamp, timezone, committer, |
808 | + revprops, revision_id, lossy) |
809 | |
810 | def get_master_branch(self, possible_transports=None): |
811 | """Return the branch we are bound to. |
812 | @@ -761,7 +772,8 @@ |
813 | if not graph.is_ancestor(last_rev, revision_id): |
814 | # our previous tip is not merged into stop_revision |
815 | raise errors.DivergedBranches(self, other_branch) |
816 | - revno = graph.find_distance_to_null(revision_id, known_revision_ids) |
817 | + revno = graph.find_distance_to_null( |
818 | + revision_id, known_revision_ids) |
819 | self.set_last_revision_info(revno, revision_id) |
820 | |
821 | def set_parent(self, url): |
822 | @@ -775,8 +787,8 @@ |
823 | try: |
824 | url.encode('ascii') |
825 | except UnicodeEncodeError: |
826 | - raise urlutils.InvalidURL(url, |
827 | - "Urls must be 7-bit ascii, " |
828 | + raise urlutils.InvalidURL( |
829 | + url, "Urls must be 7-bit ascii, " |
830 | "use breezy.urlutils.escape") |
831 | url = urlutils.relative_url(self.base, url) |
832 | with self.lock_write(): |
833 | @@ -793,20 +805,20 @@ |
834 | if not self._format.supports_stacking(): |
835 | raise UnstackableBranchFormat(self._format, self.user_url) |
836 | with self.lock_write(): |
837 | - # XXX: Changing from one fallback repository to another does not check |
838 | - # that all the data you need is present in the new fallback. |
839 | + # XXX: Changing from one fallback repository to another does not |
840 | + # check that all the data you need is present in the new fallback. |
841 | # Possibly it should. |
842 | self._check_stackable_repo() |
843 | if not url: |
844 | try: |
845 | - old_url = self.get_stacked_on_url() |
846 | + self.get_stacked_on_url() |
847 | except (errors.NotStacked, UnstackableBranchFormat, |
848 | - errors.UnstackableRepositoryFormat): |
849 | + errors.UnstackableRepositoryFormat): |
850 | return |
851 | self._unstack() |
852 | else: |
853 | - self._activate_fallback_location(url, |
854 | - possible_transports=[self.controldir.root_transport]) |
855 | + self._activate_fallback_location( |
856 | + url, possible_transports=[self.controldir.root_transport]) |
857 | # write this out after the repository is stacked to avoid setting a |
858 | # stacked config that doesn't work. |
859 | self._set_config_location('stacked_on_location', url) |
860 | @@ -820,15 +832,16 @@ |
861 | pb.update(gettext("Unstacking")) |
862 | # The basic approach here is to fetch the tip of the branch, |
863 | # including all available ghosts, from the existing stacked |
864 | - # repository into a new repository object without the fallbacks. |
865 | + # repository into a new repository object without the fallbacks. |
866 | # |
867 | # XXX: See <https://launchpad.net/bugs/397286> - this may not be |
868 | # correct for CHKMap repostiories |
869 | old_repository = self.repository |
870 | if len(old_repository._fallback_repositories) != 1: |
871 | - raise AssertionError("can't cope with fallback repositories " |
872 | - "of %r (fallbacks: %r)" % (old_repository, |
873 | - old_repository._fallback_repositories)) |
874 | + raise AssertionError( |
875 | + "can't cope with fallback repositories " |
876 | + "of %r (fallbacks: %r)" % ( |
877 | + old_repository, old_repository._fallback_repositories)) |
878 | # Open the new repository object. |
879 | # Repositories don't offer an interface to remove fallback |
880 | # repositories today; take the conceptually simpler option and just |
881 | @@ -841,8 +854,8 @@ |
882 | self.controldir.root_transport.base) |
883 | new_repository = new_bzrdir.find_repository() |
884 | if new_repository._fallback_repositories: |
885 | - raise AssertionError("didn't expect %r to have " |
886 | - "fallback_repositories" |
887 | + raise AssertionError( |
888 | + "didn't expect %r to have fallback_repositories" |
889 | % (self.repository,)) |
890 | # Replace self.repository with the new repository. |
891 | # Do our best to transfer the lock state (i.e. lock-tokens and |
892 | @@ -875,7 +888,7 @@ |
893 | if old_lock_count == 0: |
894 | raise AssertionError( |
895 | 'old_repository should have been locked at least once.') |
896 | - for i in range(old_lock_count-1): |
897 | + for i in range(old_lock_count - 1): |
898 | self.repository.lock_write() |
899 | # Fetch from the old repository into the new. |
900 | with old_repository.lock_read(): |
901 | @@ -886,8 +899,9 @@ |
902 | tags_to_fetch = set(self.tags.get_reverse_tag_dict()) |
903 | except errors.TagsNotSupported: |
904 | tags_to_fetch = set() |
905 | - fetch_spec = vf_search.NotInOtherForRevs(self.repository, |
906 | - old_repository, required_ids=[self.last_revision()], |
907 | + fetch_spec = vf_search.NotInOtherForRevs( |
908 | + self.repository, old_repository, |
909 | + required_ids=[self.last_revision()], |
910 | if_present_ids=tags_to_fetch, find_ghosts=True).execute() |
911 | self.repository.fetch(old_repository, fetch_spec=fetch_spec) |
912 | |
913 | @@ -975,7 +989,8 @@ |
914 | """ |
915 | with self.lock_read(): |
916 | if self._last_revision_info_cache is None: |
917 | - self._last_revision_info_cache = self._read_last_revision_info() |
918 | + self._last_revision_info_cache = ( |
919 | + self._read_last_revision_info()) |
920 | return self._last_revision_info_cache |
921 | |
922 | def _read_last_revision_info(self): |
923 | @@ -1035,18 +1050,18 @@ |
924 | |
925 | :returns: PullResult instance |
926 | """ |
927 | - return InterBranch.get(source, self).pull(overwrite=overwrite, |
928 | - stop_revision=stop_revision, |
929 | + return InterBranch.get(source, self).pull( |
930 | + overwrite=overwrite, stop_revision=stop_revision, |
931 | possible_transports=possible_transports, *args, **kwargs) |
932 | |
933 | def push(self, target, overwrite=False, stop_revision=None, lossy=False, |
934 | - *args, **kwargs): |
935 | + *args, **kwargs): |
936 | """Mirror this branch into target. |
937 | |
938 | This branch is considered to be 'local', having low latency. |
939 | """ |
940 | - return InterBranch.get(self, target).push(overwrite, stop_revision, |
941 | - lossy, *args, **kwargs) |
942 | + return InterBranch.get(self, target).push( |
943 | + overwrite, stop_revision, lossy, *args, **kwargs) |
944 | |
945 | def basis_tree(self): |
946 | """Return `Tree` object for last revision.""" |
947 | @@ -1068,7 +1083,7 @@ |
948 | parent = urlutils.local_path_to_url(parent) |
949 | try: |
950 | return urlutils.join(self.base[:-1], parent) |
951 | - except urlutils.InvalidURLJoin as e: |
952 | + except urlutils.InvalidURLJoin: |
953 | raise errors.InaccessibleParent(parent, self.user_url) |
954 | |
955 | def _get_parent_location(self): |
956 | @@ -1200,7 +1215,7 @@ |
957 | return result |
958 | |
959 | def sprout(self, to_controldir, revision_id=None, repository_policy=None, |
960 | - repository=None, lossy=False): |
961 | + repository=None, lossy=False): |
962 | """Create a new line of development from the branch, into to_controldir. |
963 | |
964 | to_controldir controls the branch format. |
965 | @@ -1208,8 +1223,8 @@ |
966 | revision_id: if not None, the revision history in the new branch will |
967 | be truncated to end with revision_id. |
968 | """ |
969 | - if (repository_policy is not None and |
970 | - repository_policy.requires_stacking()): |
971 | + if (repository_policy is not None |
972 | + and repository_policy.requires_stacking()): |
973 | to_controldir._format.require_stacking(_skip_repo=True) |
974 | result = to_controldir.create_branch(repository=repository) |
975 | if lossy: |
976 | @@ -1243,8 +1258,8 @@ |
977 | else: |
978 | graph = self.repository.get_graph() |
979 | try: |
980 | - revno = graph.find_distance_to_null(revision_id, |
981 | - [(source_revision_id, source_revno)]) |
982 | + revno = graph.find_distance_to_null( |
983 | + revision_id, [(source_revision_id, source_revno)]) |
984 | except errors.GhostRevisionsHaveNoRevno: |
985 | # Default to 1, if we can't find anything else |
986 | revno = 1 |
987 | @@ -1295,12 +1310,12 @@ |
988 | if actual_revno != last_revno: |
989 | result.errors.append(errors.BzrCheckError( |
990 | 'revno does not match len(mainline) %s != %s' % ( |
991 | - last_revno, actual_revno))) |
992 | + last_revno, actual_revno))) |
993 | # TODO: We should probably also check that self.revision_history |
994 | # matches the repository for older branch formats. |
995 | - # If looking for the code that cross-checks repository parents against |
996 | - # the Graph.iter_lefthand_ancestry output, that is now a repository |
997 | - # specific check. |
998 | + # If looking for the code that cross-checks repository parents |
999 | + # against the Graph.iter_lefthand_ancestry output, that is now a |
1000 | + # repository specific check. |
1001 | return result |
1002 | |
1003 | def _get_checkout_format(self, lightweight=False): |
1004 | @@ -1312,8 +1327,8 @@ |
1005 | return format |
1006 | |
1007 | def create_clone_on_transport(self, to_transport, revision_id=None, |
1008 | - stacked_on=None, create_prefix=False, use_existing_dir=False, |
1009 | - no_tree=None): |
1010 | + stacked_on=None, create_prefix=False, |
1011 | + use_existing_dir=False, no_tree=None): |
1012 | """Create a clone of this branch and its bzrdir. |
1013 | |
1014 | :param to_transport: The transport to clone onto. |
1015 | @@ -1326,12 +1341,12 @@ |
1016 | """ |
1017 | # XXX: Fix the bzrdir API to allow getting the branch back from the |
1018 | # clone call. Or something. 20090224 RBC/spiv. |
1019 | - # XXX: Should this perhaps clone colocated branches as well, |
1020 | + # XXX: Should this perhaps clone colocated branches as well, |
1021 | # rather than just the default branch? 20100319 JRV |
1022 | if revision_id is None: |
1023 | revision_id = self.last_revision() |
1024 | - dir_to = self.controldir.clone_on_transport(to_transport, |
1025 | - revision_id=revision_id, stacked_on=stacked_on, |
1026 | + dir_to = self.controldir.clone_on_transport( |
1027 | + to_transport, revision_id=revision_id, stacked_on=stacked_on, |
1028 | create_prefix=create_prefix, use_existing_dir=use_existing_dir, |
1029 | no_tree=no_tree) |
1030 | return dir_to.open_branch() |
1031 | @@ -1368,7 +1383,8 @@ |
1032 | pass |
1033 | else: |
1034 | raise errors.AlreadyControlDirError(t.base) |
1035 | - if checkout.control_transport.base == self.controldir.control_transport.base: |
1036 | + if (checkout.control_transport.base |
1037 | + == self.controldir.control_transport.base): |
1038 | # When checking out to the same control directory, |
1039 | # always create a lightweight checkout |
1040 | lightweight = True |
1041 | @@ -1377,7 +1393,7 @@ |
1042 | from_branch = checkout.set_branch_reference(target_branch=self) |
1043 | else: |
1044 | policy = checkout.determine_repository_policy() |
1045 | - repo = policy.acquire_repository()[0] |
1046 | + policy.acquire_repository() |
1047 | checkout_branch = checkout.create_branch() |
1048 | checkout_branch.bind(self) |
1049 | # pull up to the specified revision_id to set the initial |
1050 | @@ -1601,7 +1617,7 @@ |
1051 | raise NotImplementedError(self.network_name) |
1052 | |
1053 | def open(self, controldir, name=None, _found=False, ignore_fallbacks=False, |
1054 | - found_repository=None, possible_transports=None): |
1055 | + found_repository=None, possible_transports=None): |
1056 | """Return the branch object for controldir. |
1057 | |
1058 | :param controldir: A ControlDir that contains a branch. |
1059 | @@ -1623,7 +1639,7 @@ |
1060 | |
1061 | def supports_leaving_lock(self): |
1062 | """True if this format supports leaving locks in place.""" |
1063 | - return False # by default |
1064 | + return False # by default |
1065 | |
1066 | def __str__(self): |
1067 | return self.get_format_description().rstrip() |
1068 | @@ -1659,18 +1675,22 @@ |
1069 | notified. |
1070 | """ |
1071 | Hooks.__init__(self, "breezy.branch", "Branch.hooks") |
1072 | - self.add_hook('open', |
1073 | + self.add_hook( |
1074 | + 'open', |
1075 | "Called with the Branch object that has been opened after a " |
1076 | "branch is opened.", (1, 8)) |
1077 | - self.add_hook('post_push', |
1078 | + self.add_hook( |
1079 | + 'post_push', |
1080 | "Called after a push operation completes. post_push is called " |
1081 | - "with a breezy.branch.BranchPushResult object and only runs in the " |
1082 | - "bzr client.", (0, 15)) |
1083 | - self.add_hook('post_pull', |
1084 | + "with a breezy.branch.BranchPushResult object and only runs in " |
1085 | + "the bzr client.", (0, 15)) |
1086 | + self.add_hook( |
1087 | + 'post_pull', |
1088 | "Called after a pull operation completes. post_pull is called " |
1089 | "with a breezy.branch.PullResult object and only runs in the " |
1090 | "bzr client.", (0, 15)) |
1091 | - self.add_hook('pre_commit', |
1092 | + self.add_hook( |
1093 | + 'pre_commit', |
1094 | "Called after a commit is calculated but before it is " |
1095 | "completed. pre_commit is called with (local, master, old_revno, " |
1096 | "old_revid, future_revno, future_revid, tree_delta, future_tree" |
1097 | @@ -1680,28 +1700,33 @@ |
1098 | " future_tree is an in-memory tree obtained from " |
1099 | "CommitBuilder.revision_tree() and hooks MUST NOT modify this " |
1100 | "tree.", (0, 91)) |
1101 | - self.add_hook('post_commit', |
1102 | + self.add_hook( |
1103 | + 'post_commit', |
1104 | "Called in the bzr client after a commit has completed. " |
1105 | "post_commit is called with (local, master, old_revno, old_revid, " |
1106 | "new_revno, new_revid). old_revid is NULL_REVISION for the first " |
1107 | "commit to a branch.", (0, 15)) |
1108 | - self.add_hook('post_uncommit', |
1109 | + self.add_hook( |
1110 | + 'post_uncommit', |
1111 | "Called in the bzr client after an uncommit completes. " |
1112 | "post_uncommit is called with (local, master, old_revno, " |
1113 | "old_revid, new_revno, new_revid) where local is the local branch " |
1114 | "or None, master is the target branch, and an empty branch " |
1115 | "receives new_revno of 0, new_revid of None.", (0, 15)) |
1116 | - self.add_hook('pre_change_branch_tip', |
1117 | + self.add_hook( |
1118 | + 'pre_change_branch_tip', |
1119 | "Called in bzr client and server before a change to the tip of a " |
1120 | "branch is made. pre_change_branch_tip is called with a " |
1121 | "breezy.branch.ChangeBranchTipParams. Note that push, pull, " |
1122 | "commit, uncommit will all trigger this hook.", (1, 6)) |
1123 | - self.add_hook('post_change_branch_tip', |
1124 | + self.add_hook( |
1125 | + 'post_change_branch_tip', |
1126 | "Called in bzr client and server after a change to the tip of a " |
1127 | "branch is made. post_change_branch_tip is called with a " |
1128 | "breezy.branch.ChangeBranchTipParams. Note that push, pull, " |
1129 | "commit, uncommit will all trigger this hook.", (1, 4)) |
1130 | - self.add_hook('transform_fallback_location', |
1131 | + self.add_hook( |
1132 | + 'transform_fallback_location', |
1133 | "Called when a stacked branch is activating its fallback " |
1134 | "locations. transform_fallback_location is called with (branch, " |
1135 | "url), and should return a new url. Returning the same url " |
1136 | @@ -1713,25 +1738,27 @@ |
1137 | "multiple hooks installed for transform_fallback_location, " |
1138 | "all are called with the url returned from the previous hook." |
1139 | "The order is however undefined.", (1, 9)) |
1140 | - self.add_hook('automatic_tag_name', |
1141 | + self.add_hook( |
1142 | + 'automatic_tag_name', |
1143 | "Called to determine an automatic tag name for a revision. " |
1144 | "automatic_tag_name is called with (branch, revision_id) and " |
1145 | "should return a tag name or None if no tag name could be " |
1146 | "determined. The first non-None tag name returned will be used.", |
1147 | (2, 2)) |
1148 | - self.add_hook('post_branch_init', |
1149 | + self.add_hook( |
1150 | + 'post_branch_init', |
1151 | "Called after new branch initialization completes. " |
1152 | "post_branch_init is called with a " |
1153 | "breezy.branch.BranchInitHookParams. " |
1154 | "Note that init, branch and checkout (both heavyweight and " |
1155 | "lightweight) will all trigger this hook.", (2, 2)) |
1156 | - self.add_hook('post_switch', |
1157 | + self.add_hook( |
1158 | + 'post_switch', |
1159 | "Called after a checkout switches branch. " |
1160 | "post_switch is called with a " |
1161 | "breezy.branch.SwitchHookParams.", (2, 2)) |
1162 | |
1163 | |
1164 | - |
1165 | # install the default hooks into the Branch class. |
1166 | Branch.hooks = BranchHooks() |
1167 | |
1168 | @@ -1842,8 +1869,8 @@ |
1169 | return self.__dict__ == other.__dict__ |
1170 | |
1171 | def __repr__(self): |
1172 | - return "<%s for %s to (%s, %s)>" % (self.__class__.__name__, |
1173 | - self.control_dir, self.to_branch, |
1174 | + return "<%s for %s to (%s, %s)>" % ( |
1175 | + self.__class__.__name__, self.control_dir, self.to_branch, |
1176 | self.revision_id) |
1177 | |
1178 | |
1179 | @@ -1857,8 +1884,8 @@ |
1180 | |
1181 | def get_default(self): |
1182 | """Return the current default format.""" |
1183 | - if (self._default_format_key is not None and |
1184 | - self._default_format is None): |
1185 | + if (self._default_format_key is not None |
1186 | + and self._default_format is None): |
1187 | self._default_format = self.get(self._default_format_key) |
1188 | return self._default_format |
1189 | |
1190 | @@ -1993,7 +2020,8 @@ |
1191 | if self.old_revid != self.new_revid: |
1192 | note(gettext('Pushed up to revision %d.') % self.new_revno) |
1193 | if tag_updates: |
1194 | - note(ngettext('%d tag updated.', '%d tags updated.', len(tag_updates)) % len(tag_updates)) |
1195 | + note(ngettext('%d tag updated.', '%d tags updated.', |
1196 | + len(tag_updates)) % len(tag_updates)) |
1197 | if self.old_revid == self.new_revid and not tag_updates: |
1198 | if not tag_conflicts: |
1199 | note(gettext('No new revisions or tags to push.')) |
1200 | @@ -2019,7 +2047,7 @@ |
1201 | if any. |
1202 | """ |
1203 | note(gettext('checked branch {0} format {1}').format( |
1204 | - self.branch.user_url, self.branch._format)) |
1205 | + self.branch.user_url, self.branch._format)) |
1206 | for error in self.errors: |
1207 | note(gettext('found error:%s'), error) |
1208 | |
1209 | @@ -2038,7 +2066,7 @@ |
1210 | @classmethod |
1211 | def _get_branch_formats_to_test(klass): |
1212 | """Return an iterable of format tuples for testing. |
1213 | - |
1214 | + |
1215 | :return: An iterable of (from_format, to_format) to use when testing |
1216 | this InterBranch class. Each InterBranch class should define this |
1217 | method itself. |
1218 | @@ -2136,18 +2164,19 @@ |
1219 | fetch_spec_factory.source_branch_stop_revision_id = stop_revision |
1220 | fetch_spec_factory.source_repo = self.source.repository |
1221 | fetch_spec_factory.target_repo = self.target.repository |
1222 | - fetch_spec_factory.target_repo_kind = fetch.TargetRepoKinds.PREEXISTING |
1223 | + fetch_spec_factory.target_repo_kind = ( |
1224 | + fetch.TargetRepoKinds.PREEXISTING) |
1225 | fetch_spec_factory.limit = limit |
1226 | fetch_spec = fetch_spec_factory.make_fetch_spec() |
1227 | return self.target.repository.fetch( |
1228 | - self.source.repository, |
1229 | - fetch_spec=fetch_spec) |
1230 | + self.source.repository, |
1231 | + fetch_spec=fetch_spec) |
1232 | |
1233 | def _update_revisions(self, stop_revision=None, overwrite=False, |
1234 | - graph=None): |
1235 | + graph=None): |
1236 | with self.source.lock_read(), self.target.lock_write(): |
1237 | other_revno, other_last_revision = self.source.last_revision_info() |
1238 | - stop_revno = None # unknown |
1239 | + stop_revno = None # unknown |
1240 | if stop_revision is None: |
1241 | stop_revision = other_last_revision |
1242 | if _mod_revision.is_null(stop_revision): |
1243 | @@ -2176,10 +2205,10 @@ |
1244 | if graph is None: |
1245 | graph = self.target.repository.get_graph() |
1246 | this_revno, this_last_revision = \ |
1247 | - self.target.last_revision_info() |
1248 | - stop_revno = graph.find_distance_to_null(stop_revision, |
1249 | - [(other_last_revision, other_revno), |
1250 | - (this_last_revision, this_revno)]) |
1251 | + self.target.last_revision_info() |
1252 | + stop_revno = graph.find_distance_to_null( |
1253 | + stop_revision, [(other_last_revision, other_revno), |
1254 | + (this_last_revision, this_revno)]) |
1255 | self.target.set_last_revision_info(stop_revno, stop_revision) |
1256 | |
1257 | def pull(self, overwrite=False, stop_revision=None, |
1258 | @@ -2208,15 +2237,16 @@ |
1259 | source_is_master = False |
1260 | if not local and bound_location and not source_is_master: |
1261 | # not pulling from master, so we need to update master. |
1262 | - master_branch = self.target.get_master_branch(possible_transports) |
1263 | + master_branch = self.target.get_master_branch( |
1264 | + possible_transports) |
1265 | master_branch.lock_write() |
1266 | try: |
1267 | if master_branch: |
1268 | # pull from source into master. |
1269 | - master_branch.pull(self.source, overwrite, stop_revision, |
1270 | - run_hooks=False) |
1271 | - return self._pull(overwrite, |
1272 | - stop_revision, _hook_master=master_branch, |
1273 | + master_branch.pull( |
1274 | + self.source, overwrite, stop_revision, run_hooks=False) |
1275 | + return self._pull( |
1276 | + overwrite, stop_revision, _hook_master=master_branch, |
1277 | run_hooks=run_hooks, |
1278 | _override_hook_target=_override_hook_target, |
1279 | merge_tags_to_master=not source_is_master) |
1280 | @@ -2239,6 +2269,7 @@ |
1281 | raise errors.LossyPushToSameVCS(self.source, self.target) |
1282 | # TODO: Public option to disable running hooks - should be trivial but |
1283 | # needs tests. |
1284 | + |
1285 | def _run_hooks(): |
1286 | if _override_hook_source_branch: |
1287 | result.source_branch = _override_hook_source_branch |
1288 | @@ -2250,16 +2281,16 @@ |
1289 | if bound_location and self.target.base != bound_location: |
1290 | # there is a master branch. |
1291 | # |
1292 | - # XXX: Why the second check? Is it even supported for a branch to |
1293 | - # be bound to itself? -- mbp 20070507 |
1294 | + # XXX: Why the second check? Is it even supported for a branch |
1295 | + # to be bound to itself? -- mbp 20070507 |
1296 | master_branch = self.target.get_master_branch() |
1297 | with master_branch.lock_write(): |
1298 | # push into the master from the source branch. |
1299 | master_inter = InterBranch.get(self.source, master_branch) |
1300 | master_inter._basic_push(overwrite, stop_revision) |
1301 | - # and push into the target branch from the source. Note that |
1302 | - # we push from the source branch again, because it's considered |
1303 | - # the highest bandwidth repository. |
1304 | + # and push into the target branch from the source. Note |
1305 | + # that we push from the source branch again, because it's |
1306 | + # considered the highest bandwidth repository. |
1307 | result = self._basic_push(overwrite, stop_revision) |
1308 | result.master_branch = master_branch |
1309 | result.local_branch = self.target |
1310 | @@ -2291,20 +2322,19 @@ |
1311 | # We assume that during 'push' this repository is closer than |
1312 | # the target. |
1313 | graph = self.source.repository.get_graph(self.target.repository) |
1314 | - self._update_revisions(stop_revision, |
1315 | - overwrite=("history" in overwrite), |
1316 | - graph=graph) |
1317 | + self._update_revisions( |
1318 | + stop_revision, overwrite=("history" in overwrite), graph=graph) |
1319 | if self.source._push_should_merge_tags(): |
1320 | result.tag_updates, result.tag_conflicts = ( |
1321 | self.source.tags.merge_to( |
1322 | - self.target.tags, "tags" in overwrite)) |
1323 | + self.target.tags, "tags" in overwrite)) |
1324 | result.new_revno, result.new_revid = self.target.last_revision_info() |
1325 | return result |
1326 | |
1327 | def _pull(self, overwrite=False, stop_revision=None, |
1328 | - possible_transports=None, _hook_master=None, run_hooks=True, |
1329 | - _override_hook_target=None, local=False, |
1330 | - merge_tags_to_master=True): |
1331 | + possible_transports=None, _hook_master=None, run_hooks=True, |
1332 | + _override_hook_target=None, local=False, |
1333 | + merge_tags_to_master=True): |
1334 | """See Branch.pull. |
1335 | |
1336 | This function is the core worker, used by GenericInterBranch.pull to |
1337 | @@ -2335,23 +2365,23 @@ |
1338 | # the source one. |
1339 | self.source.update_references(self.target) |
1340 | graph = self.target.repository.get_graph(self.source.repository) |
1341 | - # TODO: Branch formats should have a flag that indicates |
1342 | + # TODO: Branch formats should have a flag that indicates |
1343 | # that revno's are expensive, and pull() should honor that flag. |
1344 | # -- JRV20090506 |
1345 | result.old_revno, result.old_revid = \ |
1346 | self.target.last_revision_info() |
1347 | overwrite = _fix_overwrite_type(overwrite) |
1348 | - self._update_revisions(stop_revision, |
1349 | - overwrite=("history" in overwrite), |
1350 | - graph=graph) |
1351 | - # TODO: The old revid should be specified when merging tags, |
1352 | - # so a tags implementation that versions tags can only |
1353 | + self._update_revisions( |
1354 | + stop_revision, overwrite=("history" in overwrite), graph=graph) |
1355 | + # TODO: The old revid should be specified when merging tags, |
1356 | + # so a tags implementation that versions tags can only |
1357 | # pull in the most recent changes. -- JRV20090506 |
1358 | result.tag_updates, result.tag_conflicts = ( |
1359 | - self.source.tags.merge_to(self.target.tags, |
1360 | - "tags" in overwrite, |
1361 | + self.source.tags.merge_to( |
1362 | + self.target.tags, "tags" in overwrite, |
1363 | ignore_master=not merge_tags_to_master)) |
1364 | - result.new_revno, result.new_revid = self.target.last_revision_info() |
1365 | + result.new_revno, result.new_revid = ( |
1366 | + self.target.last_revision_info()) |
1367 | if _hook_master: |
1368 | result.master_branch = _hook_master |
1369 | result.local_branch = result.target_branch |
1370 | |
1371 | === modified file 'breezy/branchbuilder.py' |
1372 | --- breezy/branchbuilder.py 2018-11-16 10:50:21 +0000 |
1373 | +++ breezy/branchbuilder.py 2018-11-16 18:34:24 +0000 |
1374 | @@ -109,12 +109,13 @@ |
1375 | else: |
1376 | base_id = parent_ids[0] |
1377 | if base_id != self._branch.last_revision(): |
1378 | - self._move_branch_pointer(base_id, |
1379 | - allow_leftmost_as_ghost=allow_leftmost_as_ghost) |
1380 | + self._move_branch_pointer( |
1381 | + base_id, allow_leftmost_as_ghost=allow_leftmost_as_ghost) |
1382 | tree = self._branch.create_memorytree() |
1383 | with tree.lock_write(): |
1384 | if parent_ids is not None: |
1385 | - tree.set_parent_ids(parent_ids, |
1386 | + tree.set_parent_ids( |
1387 | + parent_ids, |
1388 | allow_leftmost_as_ghost=allow_leftmost_as_ghost) |
1389 | tree.add('') |
1390 | return self._do_commit(tree, **commit_kwargs) |
1391 | @@ -124,11 +125,10 @@ |
1392 | if message is None and message_callback is None: |
1393 | message = u'commit %d' % (self._branch.revno() + 1,) |
1394 | return tree.commit(message, message_callback=message_callback, |
1395 | - reporter=reporter, |
1396 | - **kwargs) |
1397 | + reporter=reporter, **kwargs) |
1398 | |
1399 | def _move_branch_pointer(self, new_revision_id, |
1400 | - allow_leftmost_as_ghost=False): |
1401 | + allow_leftmost_as_ghost=False): |
1402 | """Point self._branch to a different revision id.""" |
1403 | with self._branch.lock_write(): |
1404 | # We don't seem to have a simple set_last_revision(), so we |
1405 | @@ -136,8 +136,8 @@ |
1406 | cur_revno, cur_revision_id = self._branch.last_revision_info() |
1407 | try: |
1408 | g = self._branch.repository.get_graph() |
1409 | - new_revno = g.find_distance_to_null(new_revision_id, |
1410 | - [(cur_revision_id, cur_revno)]) |
1411 | + new_revno = g.find_distance_to_null( |
1412 | + new_revision_id, [(cur_revision_id, cur_revno)]) |
1413 | self._branch.set_last_revision_info(new_revno, new_revision_id) |
1414 | except errors.GhostRevisionsHaveNoRevno: |
1415 | if not allow_leftmost_as_ghost: |
1416 | @@ -174,8 +174,8 @@ |
1417 | self._tree = None |
1418 | |
1419 | def build_snapshot(self, parent_ids, actions, message=None, timestamp=None, |
1420 | - allow_leftmost_as_ghost=False, committer=None, timezone=None, |
1421 | - message_callback=None, revision_id=None): |
1422 | + allow_leftmost_as_ghost=False, committer=None, |
1423 | + timezone=None, message_callback=None, revision_id=None): |
1424 | """Build a commit, shaped in a specific way. |
1425 | |
1426 | Most of the actions are self-explanatory. 'flush' is special action to |
1427 | @@ -210,8 +210,8 @@ |
1428 | else: |
1429 | base_id = parent_ids[0] |
1430 | if base_id != self._branch.last_revision(): |
1431 | - self._move_branch_pointer(base_id, |
1432 | - allow_leftmost_as_ghost=allow_leftmost_as_ghost) |
1433 | + self._move_branch_pointer( |
1434 | + base_id, allow_leftmost_as_ghost=allow_leftmost_as_ghost) |
1435 | |
1436 | if self._tree is not None: |
1437 | tree = self._tree |
1438 | @@ -219,7 +219,8 @@ |
1439 | tree = self._branch.create_memorytree() |
1440 | with tree.lock_write(): |
1441 | if parent_ids is not None: |
1442 | - tree.set_parent_ids(parent_ids, |
1443 | + tree.set_parent_ids( |
1444 | + parent_ids, |
1445 | allow_leftmost_as_ghost=allow_leftmost_as_ghost) |
1446 | # Unfortunately, MemoryTree.add(directory) just creates an |
1447 | # inventory entry. And the only public function to create a |
1448 | @@ -251,15 +252,17 @@ |
1449 | else: |
1450 | raise ValueError('Unknown build action: "%s"' % (action,)) |
1451 | self._flush_pending(tree, pending) |
1452 | - return self._do_commit(tree, message=message, rev_id=revision_id, |
1453 | + return self._do_commit( |
1454 | + tree, message=message, rev_id=revision_id, |
1455 | timestamp=timestamp, timezone=timezone, committer=committer, |
1456 | message_callback=message_callback) |
1457 | |
1458 | def _flush_pending(self, tree, pending): |
1459 | - """Flush the pending actions in 'pending', i.e. apply them to 'tree'.""" |
1460 | + """Flush the pending actions in 'pending', i.e. apply them to tree.""" |
1461 | for path, file_id in pending.to_add_directories: |
1462 | if path == '': |
1463 | - if tree.has_filename(path) and path in pending.to_unversion_paths: |
1464 | + if tree.has_filename(path) \ |
1465 | + and path in pending.to_unversion_paths: |
1466 | # We're overwriting this path, no need to unversion |
1467 | pending.to_unversion_paths.discard(path) |
1468 | # Special case, because the path already exists |
1469 | @@ -270,7 +273,8 @@ |
1470 | tree.rename_one(from_relpath, to_relpath) |
1471 | if pending.to_unversion_paths: |
1472 | tree.unversion(pending.to_unversion_paths) |
1473 | - tree.add(pending.to_add_files, pending.to_add_file_ids, pending.to_add_kinds) |
1474 | + tree.add(pending.to_add_files, pending.to_add_file_ids, |
1475 | + pending.to_add_kinds) |
1476 | for path, content in viewitems(pending.new_contents): |
1477 | tree.put_file_bytes_non_atomic(path, content) |
1478 | |
1479 | @@ -294,4 +298,3 @@ |
1480 | self.new_contents = {} |
1481 | self.to_unversion_paths = set() |
1482 | self.to_rename = [] |
1483 | - |
1484 | |
1485 | === modified file 'breezy/breakin.py' |
1486 | --- breezy/breakin.py 2017-05-21 14:47:52 +0000 |
1487 | +++ breezy/breakin.py 2018-11-16 18:34:24 +0000 |
1488 | @@ -28,9 +28,9 @@ |
1489 | import pdb |
1490 | import sys |
1491 | sys.stderr.write("** %s received, entering debugger\n" |
1492 | - "** Type 'c' to continue or 'q' to stop the process\n" |
1493 | - "** Or %s again to quit (and possibly dump core)\n" |
1494 | - % (_breakin_signal_name, _breakin_signal_name)) |
1495 | + "** Type 'c' to continue or 'q' to stop the process\n" |
1496 | + "** Or %s again to quit (and possibly dump core)\n" |
1497 | + % (_breakin_signal_name, _breakin_signal_name)) |
1498 | # It seems that on Windows, when sys.stderr is to a PIPE, then we need to |
1499 | # flush. Not sure why it is buffered, but that seems to be the case. |
1500 | sys.stderr.flush() |
1501 | |
1502 | === modified file 'breezy/bugtracker.py' |
1503 | --- breezy/bugtracker.py 2018-09-30 18:50:06 +0000 |
1504 | +++ breezy/bugtracker.py 2018-11-16 18:34:24 +0000 |
1505 | @@ -42,8 +42,8 @@ |
1506 | """ |
1507 | |
1508 | |
1509 | -_bugs_help = \ |
1510 | -"""When making a commit, metadata about bugs fixed by that change can be |
1511 | +_bugs_help = """\ |
1512 | +When making a commit, metadata about bugs fixed by that change can be |
1513 | recorded by using the ``--fixes`` option. For each bug marked as fixed, an |
1514 | entry is included in the 'bugs' revision property stating '<url> <status>'. |
1515 | (The only ``status`` value currently supported is ``fixed.``) |
1516 | @@ -216,8 +216,8 @@ |
1517 | tracker = tracker_type.get(abbreviated_bugtracker_name, branch) |
1518 | if tracker is not None: |
1519 | return tracker |
1520 | - raise UnknownBugTrackerAbbreviation(abbreviated_bugtracker_name, |
1521 | - branch) |
1522 | + raise UnknownBugTrackerAbbreviation( |
1523 | + abbreviated_bugtracker_name, branch) |
1524 | |
1525 | def help_topic(self, topic): |
1526 | return _bugs_help |
1527 | @@ -316,7 +316,7 @@ |
1528 | if '{project}' not in self._base_url: |
1529 | raise InvalidBugTrackerURL(self._abbreviation, self._base_url) |
1530 | return self._base_url.replace( |
1531 | - '{project}', project).replace('{id}', str(bug_id)) |
1532 | + '{project}', project).replace('{id}', str(bug_id)) |
1533 | |
1534 | |
1535 | tracker_registry.register( |
1536 | @@ -327,9 +327,9 @@ |
1537 | 'debian', UniqueIntegerBugTracker('deb', 'http://bugs.debian.org/')) |
1538 | |
1539 | |
1540 | -tracker_registry.register('gnome', |
1541 | - UniqueIntegerBugTracker('gnome', |
1542 | - 'http://bugzilla.gnome.org/show_bug.cgi?id=')) |
1543 | +tracker_registry.register( |
1544 | + 'gnome', UniqueIntegerBugTracker( |
1545 | + 'gnome', 'http://bugzilla.gnome.org/show_bug.cgi?id=')) |
1546 | |
1547 | |
1548 | tracker_registry.register( |
1549 | @@ -377,6 +377,7 @@ |
1550 | 'squid' or 'apache'). |
1551 | """ |
1552 | |
1553 | + |
1554 | tracker_registry.register( |
1555 | 'trac', URLParametrizedIntegerBugTracker('trac', 'ticket/')) |
1556 | |
1557 | |
1558 | === modified file 'breezy/builtins.py' |
1559 | --- breezy/builtins.py 2018-11-16 12:35:23 +0000 |
1560 | +++ breezy/builtins.py 2018-11-16 18:34:24 +0000 |
1561 | @@ -117,12 +117,12 @@ |
1562 | and the full URL to the actual branch |
1563 | """ |
1564 | # This path is meant to be relative to the existing branch |
1565 | - this_url = _get_branch_location(control_dir, |
1566 | - possible_transports=possible_transports) |
1567 | + this_url = _get_branch_location( |
1568 | + control_dir, possible_transports=possible_transports) |
1569 | # Perhaps the target control dir supports colocated branches? |
1570 | try: |
1571 | - root = controldir.ControlDir.open(this_url, |
1572 | - possible_transports=possible_transports) |
1573 | + root = controldir.ControlDir.open( |
1574 | + this_url, possible_transports=possible_transports) |
1575 | except errors.NotBranchError: |
1576 | return (False, this_url) |
1577 | else: |
1578 | @@ -149,8 +149,8 @@ |
1579 | (colocated, this_url) = _is_colocated(control_dir, possible_transports) |
1580 | |
1581 | if colocated: |
1582 | - return urlutils.join_segment_parameters(this_url, |
1583 | - {"branch": urlutils.escape(location)}) |
1584 | + return urlutils.join_segment_parameters( |
1585 | + this_url, {"branch": urlutils.escape(location)}) |
1586 | else: |
1587 | return urlutils.join(this_url, '..', urlutils.escape(location)) |
1588 | return location |
1589 | @@ -166,8 +166,8 @@ |
1590 | """ |
1591 | try: |
1592 | # Perhaps it's a colocated branch? |
1593 | - return control_dir.open_branch(location, |
1594 | - possible_transports=possible_transports) |
1595 | + return control_dir.open_branch( |
1596 | + location, possible_transports=possible_transports) |
1597 | except (errors.NotBranchError, errors.NoColocatedBranchSupport): |
1598 | this_url = _get_branch_location(control_dir) |
1599 | return Branch.open( |
1600 | @@ -186,14 +186,14 @@ |
1601 | if location is None: |
1602 | location = "." |
1603 | try: |
1604 | - return Branch.open(location, |
1605 | - possible_transports=possible_transports) |
1606 | + return Branch.open( |
1607 | + location, possible_transports=possible_transports) |
1608 | except errors.NotBranchError: |
1609 | near = "." |
1610 | - cdir = controldir.ControlDir.open(near, |
1611 | - possible_transports=possible_transports) |
1612 | - return open_sibling_branch(cdir, location, |
1613 | - possible_transports=possible_transports) |
1614 | + cdir = controldir.ControlDir.open( |
1615 | + near, possible_transports=possible_transports) |
1616 | + return open_sibling_branch( |
1617 | + cdir, location, possible_transports=possible_transports) |
1618 | |
1619 | |
1620 | def iter_sibling_branches(control_dir, possible_transports=None): |
1621 | @@ -210,8 +210,8 @@ |
1622 | yield name, branch |
1623 | return |
1624 | if reference is not None: |
1625 | - ref_branch = Branch.open(reference, |
1626 | - possible_transports=possible_transports) |
1627 | + ref_branch = Branch.open( |
1628 | + reference, possible_transports=possible_transports) |
1629 | else: |
1630 | ref_branch = None |
1631 | if ref_branch is None or ref_branch.name: |
1632 | @@ -222,8 +222,8 @@ |
1633 | else: |
1634 | repo = ref_branch.controldir.find_repository() |
1635 | for branch in repo.find_branches(using=True): |
1636 | - name = urlutils.relative_url(repo.user_url, |
1637 | - branch.user_url).rstrip("/") |
1638 | + name = urlutils.relative_url( |
1639 | + repo.user_url, branch.user_url).rstrip("/") |
1640 | yield name, branch |
1641 | |
1642 | |
1643 | @@ -255,7 +255,8 @@ |
1644 | if view_files: |
1645 | file_list = view_files |
1646 | view_str = views.view_display_str(view_files) |
1647 | - note(gettext("Ignoring files outside view. View is %s") % view_str) |
1648 | + note(gettext("Ignoring files outside view. View is %s"), |
1649 | + view_str) |
1650 | return tree, file_list |
1651 | |
1652 | |
1653 | @@ -383,11 +384,9 @@ |
1654 | short_name='S'), |
1655 | Option('versioned', help='Only show versioned files.', |
1656 | short_name='V'), |
1657 | - Option('no-pending', help='Don\'t show pending merges.', |
1658 | - ), |
1659 | + Option('no-pending', help='Don\'t show pending merges.'), |
1660 | Option('no-classify', |
1661 | - help='Do not mark object type using indicator.', |
1662 | - ), |
1663 | + help='Do not mark object type using indicator.'), |
1664 | ] |
1665 | aliases = ['st', 'stat'] |
1666 | |
1667 | @@ -401,8 +400,9 @@ |
1668 | from .status import show_tree_status |
1669 | |
1670 | if revision and len(revision) > 2: |
1671 | - raise errors.BzrCommandError(gettext('brz status --revision takes exactly' |
1672 | - ' one or two revision specifiers')) |
1673 | + raise errors.BzrCommandError( |
1674 | + gettext('brz status --revision takes exactly' |
1675 | + ' one or two revision specifiers')) |
1676 | |
1677 | tree, relfile_list = WorkingTree.open_containing_paths(file_list) |
1678 | # Avoid asking for specific files when that is not needed. |
1679 | @@ -446,17 +446,18 @@ |
1680 | def run(self, revision_id=None, revision=None, directory=u'.'): |
1681 | if revision_id is not None and revision is not None: |
1682 | raise errors.BzrCommandError(gettext('You can only supply one of' |
1683 | - ' revision_id or --revision')) |
1684 | + ' revision_id or --revision')) |
1685 | if revision_id is None and revision is None: |
1686 | - raise errors.BzrCommandError(gettext('You must supply either' |
1687 | - ' --revision or a revision_id')) |
1688 | + raise errors.BzrCommandError( |
1689 | + gettext('You must supply either --revision or a revision_id')) |
1690 | |
1691 | b = controldir.ControlDir.open_containing_tree_or_branch(directory)[1] |
1692 | |
1693 | revisions = b.repository.revisions |
1694 | if revisions is None: |
1695 | - raise errors.BzrCommandError(gettext('Repository %r does not support ' |
1696 | - 'access to raw revision texts')) |
1697 | + raise errors.BzrCommandError( |
1698 | + gettext('Repository %r does not support ' |
1699 | + 'access to raw revision texts')) |
1700 | |
1701 | with b.repository.lock_read(): |
1702 | # TODO: jam 20060112 should cat-revision always output utf-8? |
1703 | @@ -465,8 +466,9 @@ |
1704 | try: |
1705 | self.print_revision(revisions, revision_id) |
1706 | except errors.NoSuchRevision: |
1707 | - msg = gettext("The repository {0} contains no revision {1}.").format( |
1708 | - b.repository.base, revision_id.decode('utf-8')) |
1709 | + msg = gettext( |
1710 | + "The repository {0} contains no revision {1}.").format( |
1711 | + b.repository.base, revision_id.decode('utf-8')) |
1712 | raise errors.BzrCommandError(msg) |
1713 | elif revision is not None: |
1714 | for rev in revision: |
1715 | @@ -503,10 +505,12 @@ |
1716 | try: |
1717 | working = d.open_workingtree() |
1718 | except errors.NoWorkingTree: |
1719 | - raise errors.BzrCommandError(gettext("No working tree to remove")) |
1720 | + raise errors.BzrCommandError( |
1721 | + gettext("No working tree to remove")) |
1722 | except errors.NotLocalUrl: |
1723 | - raise errors.BzrCommandError(gettext("You cannot remove the working tree" |
1724 | - " of a remote path")) |
1725 | + raise errors.BzrCommandError( |
1726 | + gettext("You cannot remove the working tree" |
1727 | + " of a remote path")) |
1728 | if not force: |
1729 | if (working.has_changes()): |
1730 | raise errors.UncommittedChanges(working) |
1731 | @@ -514,8 +518,9 @@ |
1732 | raise errors.ShelvedChanges(working) |
1733 | |
1734 | if working.user_url != working.branch.user_url: |
1735 | - raise errors.BzrCommandError(gettext("You cannot remove the working tree" |
1736 | - " from a lightweight checkout")) |
1737 | + raise errors.BzrCommandError( |
1738 | + gettext("You cannot remove the working tree" |
1739 | + " from a lightweight checkout")) |
1740 | |
1741 | d.destroy_workingtree() |
1742 | |
1743 | @@ -536,7 +541,8 @@ |
1744 | that, you can supply --revision to force the state of the tree. |
1745 | """ |
1746 | |
1747 | - takes_options = ['revision', 'directory', |
1748 | + takes_options = [ |
1749 | + 'revision', 'directory', |
1750 | Option('force', |
1751 | help='Reset the tree even if it doesn\'t appear to be' |
1752 | ' corrupted.'), |
1753 | @@ -565,11 +571,12 @@ |
1754 | tree.reset_state(revision_ids) |
1755 | except errors.BzrError: |
1756 | if revision_ids is None: |
1757 | - extra = (gettext(', the header appears corrupt, try passing -r -1' |
1758 | - ' to set the state to the last commit')) |
1759 | + extra = gettext(', the header appears corrupt, try passing ' |
1760 | + '-r -1 to set the state to the last commit') |
1761 | else: |
1762 | extra = '' |
1763 | - raise errors.BzrCommandError(gettext('failed to reset the tree state{0}').format(extra)) |
1764 | + raise errors.BzrCommandError( |
1765 | + gettext('failed to reset the tree state{0}').format(extra)) |
1766 | |
1767 | |
1768 | class cmd_revno(Command): |
1769 | @@ -588,8 +595,8 @@ |
1770 | @display_command |
1771 | def run(self, tree=False, location=u'.', revision=None): |
1772 | if revision is not None and tree: |
1773 | - raise errors.BzrCommandError(gettext("--tree and --revision can " |
1774 | - "not be used together")) |
1775 | + raise errors.BzrCommandError( |
1776 | + gettext("--tree and --revision can not be used together")) |
1777 | |
1778 | if tree: |
1779 | try: |
1780 | @@ -626,9 +633,8 @@ |
1781 | takes_args = ['revision_info*'] |
1782 | takes_options = [ |
1783 | 'revision', |
1784 | - custom_help('directory', |
1785 | - help='Branch to examine, ' |
1786 | - 'rather than the one containing the working directory.'), |
1787 | + custom_help('directory', help='Branch to examine, ' |
1788 | + 'rather than the one containing the working directory.'), |
1789 | Option('tree', help='Show revno of working tree.'), |
1790 | ] |
1791 | |
1792 | @@ -673,7 +679,8 @@ |
1793 | |
1794 | self.cleanup_now() |
1795 | for revno, revid in revinfos: |
1796 | - self.outf.write('%*s %s\n' % (maxlen, revno, revid.decode('utf-8'))) |
1797 | + self.outf.write( |
1798 | + '%*s %s\n' % (maxlen, revno, revid.decode('utf-8'))) |
1799 | |
1800 | |
1801 | class cmd_add(Command): |
1802 | @@ -716,7 +723,7 @@ |
1803 | Any files matching patterns in the ignore list will not be added |
1804 | unless they are explicitly mentioned. |
1805 | |
1806 | - In recursive mode, files larger than the configuration option |
1807 | + In recursive mode, files larger than the configuration option |
1808 | add.maximum_file_size will be skipped. Named items are never skipped due |
1809 | to file size. |
1810 | """ |
1811 | @@ -726,7 +733,8 @@ |
1812 | help="Don't recursively add the contents of directories.", |
1813 | short_name='N'), |
1814 | Option('dry-run', |
1815 | - help="Show what would be done, but don't actually do anything."), |
1816 | + help="Show what would be done, but don't actually do " |
1817 | + "anything."), |
1818 | 'verbose', |
1819 | Option('file-ids-from', |
1820 | type=text_type, |
1821 | @@ -743,31 +751,32 @@ |
1822 | if file_ids_from is not None: |
1823 | try: |
1824 | base_tree, base_path = WorkingTree.open_containing( |
1825 | - file_ids_from) |
1826 | + file_ids_from) |
1827 | except errors.NoWorkingTree: |
1828 | base_branch, base_path = Branch.open_containing( |
1829 | - file_ids_from) |
1830 | + file_ids_from) |
1831 | base_tree = base_branch.basis_tree() |
1832 | |
1833 | - action = breezy.add.AddFromBaseAction(base_tree, base_path, |
1834 | - to_file=self.outf, should_print=(not is_quiet())) |
1835 | - else: |
1836 | - action = breezy.add.AddWithSkipLargeAction(to_file=self.outf, |
1837 | + action = breezy.add.AddFromBaseAction( |
1838 | + base_tree, base_path, to_file=self.outf, |
1839 | should_print=(not is_quiet())) |
1840 | + else: |
1841 | + action = breezy.add.AddWithSkipLargeAction( |
1842 | + to_file=self.outf, should_print=(not is_quiet())) |
1843 | |
1844 | if base_tree: |
1845 | self.add_cleanup(base_tree.lock_read().unlock) |
1846 | tree, file_list = tree_files_for_add(file_list) |
1847 | - added, ignored = tree.smart_add(file_list, not |
1848 | - no_recurse, action=action, save=not dry_run) |
1849 | + added, ignored = tree.smart_add( |
1850 | + file_list, not no_recurse, action=action, save=not dry_run) |
1851 | self.cleanup_now() |
1852 | if len(ignored) > 0: |
1853 | if verbose: |
1854 | for glob in sorted(ignored): |
1855 | for path in ignored[glob]: |
1856 | self.outf.write( |
1857 | - gettext("ignored {0} matching \"{1}\"\n").format( |
1858 | - path, glob)) |
1859 | + gettext("ignored {0} matching \"{1}\"\n").format( |
1860 | + path, glob)) |
1861 | |
1862 | |
1863 | class cmd_mkdir(Command): |
1864 | @@ -848,7 +857,8 @@ |
1865 | 'revision', |
1866 | 'show-ids', |
1867 | Option('kind', |
1868 | - help='List entries of a particular kind: file, directory, symlink.', |
1869 | + help='List entries of a particular kind: file, directory, ' |
1870 | + 'symlink.', |
1871 | type=text_type), |
1872 | ] |
1873 | takes_args = ['file*'] |
1874 | @@ -856,7 +866,8 @@ |
1875 | @display_command |
1876 | def run(self, revision=None, show_ids=False, kind=None, file_list=None): |
1877 | if kind and kind not in ['file', 'directory', 'symlink']: |
1878 | - raise errors.BzrCommandError(gettext('invalid kind %r specified') % (kind,)) |
1879 | + raise errors.BzrCommandError( |
1880 | + gettext('invalid kind %r specified') % (kind,)) |
1881 | |
1882 | revision = _get_one_revision('inventory', revision) |
1883 | work_tree, file_list = WorkingTree.open_containing_paths(file_list) |
1884 | @@ -873,7 +884,7 @@ |
1885 | self.add_cleanup(tree.lock_read().unlock) |
1886 | if file_list is not None: |
1887 | paths = tree.find_related_paths_across_trees( |
1888 | - file_list, extra_trees, require_versioned=True) |
1889 | + file_list, extra_trees, require_versioned=True) |
1890 | # find_ids_across_trees may include some paths that don't |
1891 | # exist in 'tree'. |
1892 | entries = tree.iter_entries_by_dir(specific_files=paths) |
1893 | @@ -886,7 +897,8 @@ |
1894 | if path == "": |
1895 | continue |
1896 | if show_ids: |
1897 | - self.outf.write('%-50s %s\n' % (path, entry.file_id.decode('utf-8'))) |
1898 | + self.outf.write('%-50s %s\n' % ( |
1899 | + path, entry.file_id.decode('utf-8'))) |
1900 | else: |
1901 | self.outf.write(path) |
1902 | self.outf.write('\n') |
1903 | @@ -918,51 +930,55 @@ |
1904 | names_list = [] |
1905 | if len(names_list) < 2: |
1906 | raise errors.BzrCommandError(gettext("missing file argument")) |
1907 | - tree, rel_names = WorkingTree.open_containing_paths(names_list, canonicalize=False) |
1908 | + tree, rel_names = WorkingTree.open_containing_paths( |
1909 | + names_list, canonicalize=False) |
1910 | for file_name in rel_names[0:-1]: |
1911 | if file_name == '': |
1912 | - raise errors.BzrCommandError(gettext("can not copy root of branch")) |
1913 | + raise errors.BzrCommandError( |
1914 | + gettext("can not copy root of branch")) |
1915 | self.add_cleanup(tree.lock_tree_write().unlock) |
1916 | into_existing = osutils.isdir(names_list[-1]) |
1917 | if not into_existing: |
1918 | try: |
1919 | (src, dst) = rel_names |
1920 | except IndexError: |
1921 | - raise errors.BzrCommandError(gettext('to copy multiple files the' |
1922 | - ' destination must be a versioned' |
1923 | - ' directory')) |
1924 | + raise errors.BzrCommandError( |
1925 | + gettext('to copy multiple files the' |
1926 | + ' destination must be a versioned' |
1927 | + ' directory')) |
1928 | pairs = [(src, dst)] |
1929 | else: |
1930 | - pairs = [(n, osutils.joinpath([rel_names[-1], osutils.basename(n)])) |
1931 | - for n in rel_names[:-1]] |
1932 | + pairs = [ |
1933 | + (n, osutils.joinpath([rel_names[-1], osutils.basename(n)])) |
1934 | + for n in rel_names[:-1]] |
1935 | |
1936 | for src, dst in pairs: |
1937 | try: |
1938 | src_kind = tree.stored_kind(src) |
1939 | except errors.NoSuchFile: |
1940 | raise errors.BzrCommandError( |
1941 | - gettext('Could not copy %s => %s: %s is not versioned.') |
1942 | - % (src, dst, src)) |
1943 | + gettext('Could not copy %s => %s: %s is not versioned.') |
1944 | + % (src, dst, src)) |
1945 | if src_kind is None: |
1946 | raise errors.BzrCommandError( |
1947 | gettext('Could not copy %s => %s . %s is not versioned\\.' |
1948 | - % (src, dst, src))) |
1949 | + % (src, dst, src))) |
1950 | if src_kind == 'directory': |
1951 | raise errors.BzrCommandError( |
1952 | gettext('Could not copy %s => %s . %s is a directory.' |
1953 | - % (src, dst, src))) |
1954 | + % (src, dst, src))) |
1955 | dst_parent = osutils.split(dst)[0] |
1956 | if dst_parent != '': |
1957 | try: |
1958 | dst_parent_kind = tree.stored_kind(dst_parent) |
1959 | except errors.NoSuchFile: |
1960 | raise errors.BzrCommandError( |
1961 | - gettext('Could not copy %s => %s: %s is not versioned.') |
1962 | - % (src, dst, dst_parent)) |
1963 | + gettext('Could not copy %s => %s: %s is not versioned.') |
1964 | + % (src, dst, dst_parent)) |
1965 | if dst_parent_kind != 'directory': |
1966 | raise errors.BzrCommandError( |
1967 | - gettext('Could not copy to %s: %s is not a directory.') |
1968 | - % (dst_parent, dst_parent)) |
1969 | + gettext('Could not copy to %s: %s is not a directory.') |
1970 | + % (dst_parent, dst_parent)) |
1971 | |
1972 | tree.copy_one(src, dst) |
1973 | |
1974 | @@ -990,10 +1006,11 @@ |
1975 | |
1976 | takes_args = ['names*'] |
1977 | takes_options = [Option("after", help="Move only the brz identifier" |
1978 | - " of the file, because the file has already been moved."), |
1979 | - Option('auto', help='Automatically guess renames.'), |
1980 | - Option('dry-run', help='Avoid making changes when guessing renames.'), |
1981 | - ] |
1982 | + " of the file, because the file has already been moved."), |
1983 | + Option('auto', help='Automatically guess renames.'), |
1984 | + Option( |
1985 | + 'dry-run', help='Avoid making changes when guessing renames.'), |
1986 | + ] |
1987 | aliases = ['move', 'rename'] |
1988 | encoding_type = 'replace' |
1989 | |
1990 | @@ -1006,25 +1023,27 @@ |
1991 | names_list = [] |
1992 | if len(names_list) < 2: |
1993 | raise errors.BzrCommandError(gettext("missing file argument")) |
1994 | - tree, rel_names = WorkingTree.open_containing_paths(names_list, canonicalize=False) |
1995 | + tree, rel_names = WorkingTree.open_containing_paths( |
1996 | + names_list, canonicalize=False) |
1997 | for file_name in rel_names[0:-1]: |
1998 | if file_name == '': |
1999 | - raise errors.BzrCommandError(gettext("can not move root of branch")) |
2000 | + raise errors.BzrCommandError( |
2001 | + gettext("can not move root of branch")) |
2002 | self.add_cleanup(tree.lock_tree_write().unlock) |
2003 | self._run(tree, names_list, rel_names, after) |
2004 | |
2005 | def run_auto(self, names_list, after, dry_run): |
2006 | if names_list is not None and len(names_list) > 1: |
2007 | - raise errors.BzrCommandError(gettext('Only one path may be specified to' |
2008 | - ' --auto.')) |
2009 | + raise errors.BzrCommandError( |
2010 | + gettext('Only one path may be specified to --auto.')) |
2011 | if after: |
2012 | - raise errors.BzrCommandError(gettext('--after cannot be specified with' |
2013 | - ' --auto.')) |
2014 | + raise errors.BzrCommandError( |
2015 | + gettext('--after cannot be specified with --auto.')) |
2016 | work_tree, file_list = WorkingTree.open_containing_paths( |
2017 | names_list, default_directory='.') |
2018 | self.add_cleanup(work_tree.lock_tree_write().unlock) |
2019 | rename_map.RenameMap.guess_renames( |
2020 | - work_tree.basis_tree(), work_tree, dry_run) |
2021 | + work_tree.basis_tree(), work_tree, dry_run) |
2022 | |
2023 | def _run(self, tree, names_list, rel_names, after): |
2024 | into_existing = osutils.isdir(names_list[-1]) |
2025 | @@ -1035,14 +1054,14 @@ |
2026 | # a directory, but now doesn't exist in the working tree |
2027 | # and the target is an existing directory, just rename it) |
2028 | if (not tree.case_sensitive |
2029 | - and rel_names[0].lower() == rel_names[1].lower()): |
2030 | + and rel_names[0].lower() == rel_names[1].lower()): |
2031 | into_existing = False |
2032 | else: |
2033 | # 'fix' the case of a potential 'from' |
2034 | from_path = tree.get_canonical_path(rel_names[0]) |
2035 | if (not osutils.lexists(names_list[0]) and |
2036 | tree.is_versioned(from_path) and |
2037 | - tree.stored_kind(from_path) == "directory"): |
2038 | + tree.stored_kind(from_path) == "directory"): |
2039 | into_existing = False |
2040 | # move/rename |
2041 | if into_existing: |
2042 | @@ -1056,8 +1075,8 @@ |
2043 | else: |
2044 | if len(names_list) != 2: |
2045 | raise errors.BzrCommandError(gettext('to mv multiple files the' |
2046 | - ' destination must be a versioned' |
2047 | - ' directory')) |
2048 | + ' destination must be a versioned' |
2049 | + ' directory')) |
2050 | |
2051 | # for cicp file-systems: the src references an existing inventory |
2052 | # item: |
2053 | @@ -1084,15 +1103,16 @@ |
2054 | if after: |
2055 | # If 'after' is specified, the tail must refer to a file on disk. |
2056 | if dest_parent: |
2057 | - dest_parent_fq = osutils.pathjoin(tree.basedir, dest_parent) |
2058 | + dest_parent_fq = osutils.pathjoin( |
2059 | + tree.basedir, dest_parent) |
2060 | else: |
2061 | # pathjoin with an empty tail adds a slash, which breaks |
2062 | # relpath :( |
2063 | dest_parent_fq = tree.basedir |
2064 | |
2065 | dest_tail = osutils.canonical_relpath( |
2066 | - dest_parent_fq, |
2067 | - osutils.pathjoin(dest_parent_fq, spec_tail)) |
2068 | + dest_parent_fq, |
2069 | + osutils.pathjoin(dest_parent_fq, spec_tail)) |
2070 | else: |
2071 | # not 'after', so case as specified is used |
2072 | dest_tail = spec_tail |
2073 | @@ -1110,8 +1130,8 @@ |
2074 | __doc__ = """Turn this branch into a mirror of another branch. |
2075 | |
2076 | By default, this command only works on branches that have not diverged. |
2077 | - Branches are considered diverged if the destination branch's most recent |
2078 | - commit is one that has not been merged (directly or indirectly) into the |
2079 | + Branches are considered diverged if the destination branch's most recent |
2080 | + commit is one that has not been merged (directly or indirectly) into the |
2081 | parent. |
2082 | |
2083 | If branches have diverged, you can use 'brz merge' to integrate the changes |
2084 | @@ -1138,21 +1158,21 @@ |
2085 | |
2086 | _see_also = ['push', 'update', 'status-flags', 'send'] |
2087 | takes_options = ['remember', 'overwrite', 'revision', |
2088 | - custom_help('verbose', |
2089 | - help='Show logs of pulled revisions.'), |
2090 | - custom_help('directory', |
2091 | - help='Branch to pull into, ' |
2092 | - 'rather than the one containing the working directory.'), |
2093 | - Option('local', |
2094 | - help="Perform a local pull in a bound " |
2095 | - "branch. Local pulls are not applied to " |
2096 | - "the master branch." |
2097 | - ), |
2098 | - Option('show-base', |
2099 | - help="Show base revision text in conflicts."), |
2100 | - Option('overwrite-tags', |
2101 | - help="Overwrite tags only."), |
2102 | - ] |
2103 | + custom_help('verbose', |
2104 | + help='Show logs of pulled revisions.'), |
2105 | + custom_help('directory', |
2106 | + help='Branch to pull into, ' |
2107 | + 'rather than the one containing the working directory.'), |
2108 | + Option('local', |
2109 | + help="Perform a local pull in a bound " |
2110 | + "branch. Local pulls are not applied to " |
2111 | + "the master branch." |
2112 | + ), |
2113 | + Option('show-base', |
2114 | + help="Show base revision text in conflicts."), |
2115 | + Option('overwrite-tags', |
2116 | + help="Overwrite tags only."), |
2117 | + ] |
2118 | takes_args = ['location?'] |
2119 | encoding_type = 'replace' |
2120 | |
2121 | @@ -1190,7 +1210,7 @@ |
2122 | if location is not None: |
2123 | try: |
2124 | mergeable = bundle.read_mergeable_from_url(location, |
2125 | - possible_transports=possible_transports) |
2126 | + possible_transports=possible_transports) |
2127 | except errors.NotABundle: |
2128 | mergeable = None |
2129 | |
2130 | @@ -1198,12 +1218,13 @@ |
2131 | if location is None: |
2132 | if stored_loc is None: |
2133 | raise errors.BzrCommandError(gettext("No pull location known or" |
2134 | - " specified.")) |
2135 | + " specified.")) |
2136 | else: |
2137 | display_url = urlutils.unescape_for_display(stored_loc, |
2138 | - self.outf.encoding) |
2139 | + self.outf.encoding) |
2140 | if not is_quiet(): |
2141 | - self.outf.write(gettext("Using saved parent location: %s\n") % display_url) |
2142 | + self.outf.write( |
2143 | + gettext("Using saved parent location: %s\n") % display_url) |
2144 | location = stored_loc |
2145 | |
2146 | revision = _get_one_revision('pull', revision) |
2147 | @@ -1217,11 +1238,11 @@ |
2148 | branch_from = branch_to |
2149 | else: |
2150 | branch_from = Branch.open(location, |
2151 | - possible_transports=possible_transports) |
2152 | + possible_transports=possible_transports) |
2153 | self.add_cleanup(branch_from.lock_read().unlock) |
2154 | # Remembers if asked explicitly or no previous location is set |
2155 | if (remember |
2156 | - or (remember is None and branch_to.get_parent() is None)): |
2157 | + or (remember is None and branch_to.get_parent() is None)): |
2158 | # FIXME: This shouldn't be done before the pull |
2159 | # succeeds... -- vila 2012-01-02 |
2160 | branch_to.set_parent(branch_from.base) |
2161 | @@ -1284,44 +1305,44 @@ |
2162 | |
2163 | _see_also = ['pull', 'update', 'working-trees'] |
2164 | takes_options = ['remember', 'overwrite', 'verbose', 'revision', |
2165 | - Option('create-prefix', |
2166 | - help='Create the path leading up to the branch ' |
2167 | - 'if it does not already exist.'), |
2168 | - custom_help('directory', |
2169 | - help='Branch to push from, ' |
2170 | - 'rather than the one containing the working directory.'), |
2171 | - Option('use-existing-dir', |
2172 | - help='By default push will fail if the target' |
2173 | - ' directory exists, but does not already' |
2174 | - ' have a control directory. This flag will' |
2175 | - ' allow push to proceed.'), |
2176 | - Option('stacked', |
2177 | - help='Create a stacked branch that references the public location ' |
2178 | - 'of the parent branch.'), |
2179 | - Option('stacked-on', |
2180 | - help='Create a stacked branch that refers to another branch ' |
2181 | - 'for the commit history. Only the work not present in the ' |
2182 | - 'referenced branch is included in the branch created.', |
2183 | - type=text_type), |
2184 | - Option('strict', |
2185 | - help='Refuse to push if there are uncommitted changes in' |
2186 | - ' the working tree, --no-strict disables the check.'), |
2187 | - Option('no-tree', |
2188 | - help="Don't populate the working tree, even for protocols" |
2189 | - " that support it."), |
2190 | - Option('overwrite-tags', |
2191 | - help="Overwrite tags only."), |
2192 | - Option('lossy', help="Allow lossy push, i.e. dropping metadata " |
2193 | - "that can't be represented in the target.") |
2194 | - ] |
2195 | + Option('create-prefix', |
2196 | + help='Create the path leading up to the branch ' |
2197 | + 'if it does not already exist.'), |
2198 | + custom_help('directory', |
2199 | + help='Branch to push from, ' |
2200 | + 'rather than the one containing the working directory.'), |
2201 | + Option('use-existing-dir', |
2202 | + help='By default push will fail if the target' |
2203 | + ' directory exists, but does not already' |
2204 | + ' have a control directory. This flag will' |
2205 | + ' allow push to proceed.'), |
2206 | + Option('stacked', |
2207 | + help='Create a stacked branch that references the public location ' |
2208 | + 'of the parent branch.'), |
2209 | + Option('stacked-on', |
2210 | + help='Create a stacked branch that refers to another branch ' |
2211 | + 'for the commit history. Only the work not present in the ' |
2212 | + 'referenced branch is included in the branch created.', |
2213 | + type=text_type), |
2214 | + Option('strict', |
2215 | + help='Refuse to push if there are uncommitted changes in' |
2216 | + ' the working tree, --no-strict disables the check.'), |
2217 | + Option('no-tree', |
2218 | + help="Don't populate the working tree, even for protocols" |
2219 | + " that support it."), |
2220 | + Option('overwrite-tags', |
2221 | + help="Overwrite tags only."), |
2222 | + Option('lossy', help="Allow lossy push, i.e. dropping metadata " |
2223 | + "that can't be represented in the target.") |
2224 | + ] |
2225 | takes_args = ['location?'] |
2226 | encoding_type = 'replace' |
2227 | |
2228 | def run(self, location=None, remember=None, overwrite=False, |
2229 | - create_prefix=False, verbose=False, revision=None, |
2230 | - use_existing_dir=False, directory=None, stacked_on=None, |
2231 | - stacked=False, strict=None, no_tree=False, |
2232 | - overwrite_tags=False, lossy=False): |
2233 | + create_prefix=False, verbose=False, revision=None, |
2234 | + use_existing_dir=False, directory=None, stacked_on=None, |
2235 | + stacked=False, strict=None, no_tree=False, |
2236 | + overwrite_tags=False, lossy=False): |
2237 | from .push import _show_push_branch |
2238 | |
2239 | if overwrite: |
2240 | @@ -1375,21 +1396,21 @@ |
2241 | "No push location known or specified. To push to the " |
2242 | "parent branch (at %s), use 'brz push :parent'." % |
2243 | urlutils.unescape_for_display(parent_loc, |
2244 | - self.outf.encoding))) |
2245 | + self.outf.encoding))) |
2246 | else: |
2247 | raise errors.BzrCommandError(gettext( |
2248 | "No push location known or specified.")) |
2249 | else: |
2250 | display_url = urlutils.unescape_for_display(stored_loc, |
2251 | - self.outf.encoding) |
2252 | + self.outf.encoding) |
2253 | note(gettext("Using saved push location: %s") % display_url) |
2254 | location = stored_loc |
2255 | |
2256 | _show_push_branch(br_from, revision_id, location, self.outf, |
2257 | - verbose=verbose, overwrite=overwrite, remember=remember, |
2258 | - stacked_on=stacked_on, create_prefix=create_prefix, |
2259 | - use_existing_dir=use_existing_dir, no_tree=no_tree, |
2260 | - lossy=lossy) |
2261 | + verbose=verbose, overwrite=overwrite, remember=remember, |
2262 | + stacked_on=stacked_on, create_prefix=create_prefix, |
2263 | + use_existing_dir=use_existing_dir, no_tree=no_tree, |
2264 | + lossy=lossy) |
2265 | |
2266 | |
2267 | class cmd_branch(Command): |
2268 | @@ -1409,28 +1430,29 @@ |
2269 | _see_also = ['checkout'] |
2270 | takes_args = ['from_location', 'to_location?'] |
2271 | takes_options = ['revision', |
2272 | - Option('hardlink', help='Hard-link working tree files where possible.'), |
2273 | - Option('files-from', type=text_type, |
2274 | - help="Get file contents from this tree."), |
2275 | - Option('no-tree', |
2276 | - help="Create a branch without a working-tree."), |
2277 | - Option('switch', |
2278 | - help="Switch the checkout in the current directory " |
2279 | - "to the new branch."), |
2280 | - Option('stacked', |
2281 | - help='Create a stacked branch referring to the source branch. ' |
2282 | - 'The new branch will depend on the availability of the source ' |
2283 | - 'branch for all operations.'), |
2284 | - Option('standalone', |
2285 | - help='Do not use a shared repository, even if available.'), |
2286 | - Option('use-existing-dir', |
2287 | - help='By default branch will fail if the target' |
2288 | - ' directory exists, but does not already' |
2289 | - ' have a control directory. This flag will' |
2290 | - ' allow branch to proceed.'), |
2291 | - Option('bind', |
2292 | - help="Bind new branch to from location."), |
2293 | - ] |
2294 | + Option( |
2295 | + 'hardlink', help='Hard-link working tree files where possible.'), |
2296 | + Option('files-from', type=text_type, |
2297 | + help="Get file contents from this tree."), |
2298 | + Option('no-tree', |
2299 | + help="Create a branch without a working-tree."), |
2300 | + Option('switch', |
2301 | + help="Switch the checkout in the current directory " |
2302 | + "to the new branch."), |
2303 | + Option('stacked', |
2304 | + help='Create a stacked branch referring to the source branch. ' |
2305 | + 'The new branch will depend on the availability of the source ' |
2306 | + 'branch for all operations.'), |
2307 | + Option('standalone', |
2308 | + help='Do not use a shared repository, even if available.'), |
2309 | + Option('use-existing-dir', |
2310 | + help='By default branch will fail if the target' |
2311 | + ' directory exists, but does not already' |
2312 | + ' have a control directory. This flag will' |
2313 | + ' allow branch to proceed.'), |
2314 | + Option('bind', |
2315 | + help="Bind new branch to from location."), |
2316 | + ] |
2317 | |
2318 | def run(self, from_location, to_location=None, revision=None, |
2319 | hardlink=False, stacked=False, standalone=False, no_tree=False, |
2320 | @@ -1467,7 +1489,7 @@ |
2321 | except errors.NotBranchError: |
2322 | if not use_existing_dir: |
2323 | raise errors.BzrCommandError(gettext('Target directory "%s" ' |
2324 | - 'already exists.') % to_location) |
2325 | + 'already exists.') % to_location) |
2326 | else: |
2327 | to_dir = None |
2328 | else: |
2329 | @@ -1513,13 +1535,14 @@ |
2330 | # We therefore need a try/except here and not just 'if stacked:' |
2331 | try: |
2332 | note(gettext('Created new stacked branch referring to %s.') % |
2333 | - branch.get_stacked_on_url()) |
2334 | + branch.get_stacked_on_url()) |
2335 | except (errors.NotStacked, _mod_branch.UnstackableBranchFormat, |
2336 | errors.UnstackableRepositoryFormat) as e: |
2337 | revno = branch.revno() |
2338 | if revno is not None: |
2339 | - note(ngettext('Branched %d revision.', 'Branched %d revisions.', |
2340 | - branch.revno()) % revno) |
2341 | + note(ngettext('Branched %d revision.', |
2342 | + 'Branched %d revisions.', |
2343 | + branch.revno()) % revno) |
2344 | else: |
2345 | note(gettext('Created new branch.')) |
2346 | if bind: |
2347 | @@ -1532,7 +1555,7 @@ |
2348 | wt, _ = WorkingTree.open_containing('.') |
2349 | _mod_switch.switch(wt.controldir, branch) |
2350 | note(gettext('Switched to branch: %s'), |
2351 | - urlutils.unescape_for_display(branch.base, 'utf-8')) |
2352 | + urlutils.unescape_for_display(branch.base, 'utf-8')) |
2353 | |
2354 | |
2355 | class cmd_branches(Command): |
2356 | @@ -1544,9 +1567,9 @@ |
2357 | |
2358 | takes_args = ['location?'] |
2359 | takes_options = [ |
2360 | - Option('recursive', short_name='R', |
2361 | - help='Recursively scan for branches rather than ' |
2362 | - 'just looking in the specified location.')] |
2363 | + Option('recursive', short_name='R', |
2364 | + help='Recursively scan for branches rather than ' |
2365 | + 'just looking in the specified location.')] |
2366 | |
2367 | def run(self, location=".", recursive=False): |
2368 | if recursive: |
2369 | @@ -1588,22 +1611,22 @@ |
2370 | class cmd_checkout(Command): |
2371 | __doc__ = """Create a new checkout of an existing branch. |
2372 | |
2373 | - If BRANCH_LOCATION is omitted, checkout will reconstitute a working tree for |
2374 | - the branch found in '.'. This is useful if you have removed the working tree |
2375 | - or if it was never created - i.e. if you pushed the branch to its current |
2376 | - location using SFTP. |
2377 | + If BRANCH_LOCATION is omitted, checkout will reconstitute a working tree |
2378 | + for the branch found in '.'. This is useful if you have removed the working |
2379 | + tree or if it was never created - i.e. if you pushed the branch to its |
2380 | + current location using SFTP. |
2381 | |
2382 | - If the TO_LOCATION is omitted, the last component of the BRANCH_LOCATION will |
2383 | - be used. In other words, "checkout ../foo/bar" will attempt to create ./bar. |
2384 | - If the BRANCH_LOCATION has no / or path separator embedded, the TO_LOCATION |
2385 | - is derived from the BRANCH_LOCATION by stripping a leading scheme or drive |
2386 | - identifier, if any. For example, "checkout lp:foo-bar" will attempt to |
2387 | - create ./foo-bar. |
2388 | + If the TO_LOCATION is omitted, the last component of the BRANCH_LOCATION |
2389 | + will be used. In other words, "checkout ../foo/bar" will attempt to create |
2390 | + ./bar. If the BRANCH_LOCATION has no / or path separator embedded, the |
2391 | + TO_LOCATION is derived from the BRANCH_LOCATION by stripping a leading |
2392 | + scheme or drive identifier, if any. For example, "checkout lp:foo-bar" will |
2393 | + attempt to create ./foo-bar. |
2394 | |
2395 | To retrieve the branch as of a particular revision, supply the --revision |
2396 | - parameter, as in "checkout foo/bar -r 5". Note that this will be immediately |
2397 | - out of date [so you cannot commit] but it may be useful (i.e. to examine old |
2398 | - code.) |
2399 | + parameter, as in "checkout foo/bar -r 5". Note that this will be |
2400 | + immediately out of date [so you cannot commit] but it may be useful (i.e. |
2401 | + to examine old code.) |
2402 | """ |
2403 | |
2404 | _see_also = ['checkouts', 'branch', 'working-trees', 'remove-tree'] |
2405 | @@ -1648,8 +1671,7 @@ |
2406 | # if the source and to_location are the same, |
2407 | # and there is no working tree, |
2408 | # then reconstitute a branch |
2409 | - if (osutils.abspath(to_location) == |
2410 | - osutils.abspath(branch_location)): |
2411 | + if osutils.abspath(to_location) == osutils.abspath(branch_location): |
2412 | try: |
2413 | source.controldir.open_workingtree() |
2414 | except errors.NoWorkingTree: |
2415 | @@ -1692,11 +1714,11 @@ |
2416 | |
2417 | This will perform a merge of the destination revision (the tip of the |
2418 | branch, or the specified revision) into the working tree, and then make |
2419 | - that revision the basis revision for the working tree. |
2420 | + that revision the basis revision for the working tree. |
2421 | |
2422 | You can use this to visit an older revision, or to update a working tree |
2423 | that is out of date from its branch. |
2424 | - |
2425 | + |
2426 | If there are any uncommitted changes in the tree, they will be carried |
2427 | across and remain as uncommitted changes after the update. To discard |
2428 | these changes, use 'brz revert'. The uncommitted changes may conflict |
2429 | @@ -1713,7 +1735,7 @@ |
2430 | out the old content of that file to a new location. |
2431 | |
2432 | The 'dir' argument, if given, must be the location of the root of a |
2433 | - working tree to update. By default, the working tree that contains the |
2434 | + working tree to update. By default, the working tree that contains the |
2435 | current working directory is used. |
2436 | """ |
2437 | |
2438 | @@ -1768,7 +1790,7 @@ |
2439 | if revision_id == _mod_revision.ensure_null(tree.last_revision()): |
2440 | revno = branch.revision_id_to_dotted_revno(revision_id) |
2441 | note(gettext("Tree is up to date at revision {0} of branch {1}" |
2442 | - ).format('.'.join(map(str, revno)), branch_location)) |
2443 | + ).format('.'.join(map(str, revno)), branch_location)) |
2444 | return 0 |
2445 | view_info = _get_view_info_for_change_reporter(tree) |
2446 | change_reporter = delta._ChangeReporter( |
2447 | @@ -1783,10 +1805,10 @@ |
2448 | show_base=show_base) |
2449 | except errors.NoSuchRevision as e: |
2450 | raise errors.BzrCommandError(gettext( |
2451 | - "branch has no revision %s\n" |
2452 | - "brz update --revision only works" |
2453 | - " for a revision in the branch history") |
2454 | - % (e.revision)) |
2455 | + "branch has no revision %s\n" |
2456 | + "brz update --revision only works" |
2457 | + " for a revision in the branch history") |
2458 | + % (e.revision)) |
2459 | revno = tree.branch.revision_id_to_dotted_revno( |
2460 | _mod_revision.ensure_null(tree.last_revision())) |
2461 | note(gettext('Updated to revision {0} of branch {1}').format( |
2462 | @@ -1794,7 +1816,7 @@ |
2463 | parent_ids = tree.get_parent_ids() |
2464 | if parent_ids[1:] and parent_ids[1:] != existing_pending_merges: |
2465 | note(gettext('Your local commits will now show as pending merges with ' |
2466 | - "'brz status', and can be committed with 'brz commit'.")) |
2467 | + "'brz status', and can be committed with 'brz commit'.")) |
2468 | if conflicts != 0: |
2469 | return 1 |
2470 | else: |
2471 | @@ -1856,19 +1878,20 @@ |
2472 | """ |
2473 | takes_args = ['file*'] |
2474 | takes_options = ['verbose', |
2475 | - Option('new', help='Only remove files that have never been committed.'), |
2476 | - RegistryOption.from_kwargs('file-deletion-strategy', |
2477 | - 'The file deletion mode to be used.', |
2478 | - title='Deletion Strategy', value_switches=True, enum_switch=False, |
2479 | - safe='Backup changed files (default).', |
2480 | - keep='Delete from brz but leave the working copy.', |
2481 | - no_backup='Don\'t backup changed files.'), |
2482 | - ] |
2483 | + Option( |
2484 | + 'new', help='Only remove files that have never been committed.'), |
2485 | + RegistryOption.from_kwargs('file-deletion-strategy', |
2486 | + 'The file deletion mode to be used.', |
2487 | + title='Deletion Strategy', value_switches=True, enum_switch=False, |
2488 | + safe='Backup changed files (default).', |
2489 | + keep='Delete from brz but leave the working copy.', |
2490 | + no_backup='Don\'t backup changed files.'), |
2491 | + ] |
2492 | aliases = ['rm', 'del'] |
2493 | encoding_type = 'replace' |
2494 | |
2495 | def run(self, file_list, verbose=False, new=False, |
2496 | - file_deletion_strategy='safe'): |
2497 | + file_deletion_strategy='safe'): |
2498 | |
2499 | tree, file_list = WorkingTree.open_containing_paths(file_list) |
2500 | |
2501 | @@ -1880,7 +1903,7 @@ |
2502 | # some such? |
2503 | if new: |
2504 | added = tree.changes_from(tree.basis_tree(), |
2505 | - specific_files=file_list).added |
2506 | + specific_files=file_list).added |
2507 | file_list = sorted([f[0] for f in added], reverse=True) |
2508 | if len(file_list) == 0: |
2509 | raise errors.BzrCommandError(gettext('No matching files.')) |
2510 | @@ -1895,8 +1918,8 @@ |
2511 | file_list = sorted(missing, reverse=True) |
2512 | file_deletion_strategy = 'keep' |
2513 | tree.remove(file_list, verbose=verbose, to_file=self.outf, |
2514 | - keep_files=file_deletion_strategy=='keep', |
2515 | - force=(file_deletion_strategy=='no-backup')) |
2516 | + keep_files=file_deletion_strategy == 'keep', |
2517 | + force=(file_deletion_strategy == 'no-backup')) |
2518 | |
2519 | |
2520 | class cmd_file_id(Command): |
2521 | @@ -1991,7 +2014,7 @@ |
2522 | self.add_cleanup(branch.lock_read().unlock) |
2523 | graph = branch.repository.get_graph() |
2524 | history = list(graph.iter_lefthand_ancestry(branch.last_revision(), |
2525 | - [_mod_revision.NULL_REVISION])) |
2526 | + [_mod_revision.NULL_REVISION])) |
2527 | for revid in reversed(history): |
2528 | self.outf.write(revid) |
2529 | self.outf.write('\n') |
2530 | @@ -2019,7 +2042,7 @@ |
2531 | self.add_cleanup(b.repository.lock_read().unlock) |
2532 | graph = b.repository.get_graph() |
2533 | revisions = [revid for revid, parents in |
2534 | - graph.iter_ancestry([last_revision])] |
2535 | + graph.iter_ancestry([last_revision])] |
2536 | for revision_id in reversed(revisions): |
2537 | if _mod_revision.is_null(revision_id): |
2538 | continue |
2539 | @@ -2055,20 +2078,22 @@ |
2540 | Option('create-prefix', |
2541 | help='Create the path leading up to the branch ' |
2542 | 'if it does not already exist.'), |
2543 | - RegistryOption('format', |
2544 | - help='Specify a format for this branch. ' |
2545 | - 'See "help formats" for a full list.', |
2546 | - lazy_registry=('breezy.controldir', 'format_registry'), |
2547 | - converter=lambda name: controldir.format_registry.make_controldir(name), |
2548 | - value_switches=True, |
2549 | - title="Branch format", |
2550 | - ), |
2551 | - Option('append-revisions-only', |
2552 | - help='Never change revnos or the existing log.' |
2553 | - ' Append revisions to it only.'), |
2554 | - Option('no-tree', |
2555 | - 'Create a branch without a working tree.') |
2556 | - ] |
2557 | + RegistryOption('format', |
2558 | + help='Specify a format for this branch. ' |
2559 | + 'See "help formats" for a full list.', |
2560 | + lazy_registry=('breezy.controldir', 'format_registry'), |
2561 | + converter=lambda name: controldir.format_registry.make_controldir( |
2562 | + name), |
2563 | + value_switches=True, |
2564 | + title="Branch format", |
2565 | + ), |
2566 | + Option('append-revisions-only', |
2567 | + help='Never change revnos or the existing log.' |
2568 | + ' Append revisions to it only.'), |
2569 | + Option('no-tree', |
2570 | + 'Create a branch without a working tree.') |
2571 | + ] |
2572 | + |
2573 | def run(self, location=None, format=None, append_revisions_only=False, |
2574 | create_prefix=False, no_tree=False): |
2575 | if format is None: |
2576 | @@ -2088,14 +2113,15 @@ |
2577 | except errors.NoSuchFile: |
2578 | if not create_prefix: |
2579 | raise errors.BzrCommandError(gettext("Parent directory of %s" |
2580 | - " does not exist." |
2581 | - "\nYou may supply --create-prefix to create all" |
2582 | - " leading parent directories.") |
2583 | - % location) |
2584 | + " does not exist." |
2585 | + "\nYou may supply --create-prefix to create all" |
2586 | + " leading parent directories.") |
2587 | + % location) |
2588 | to_transport.create_prefix() |
2589 | |
2590 | try: |
2591 | - a_controldir = controldir.ControlDir.open_from_transport(to_transport) |
2592 | + a_controldir = controldir.ControlDir.open_from_transport( |
2593 | + to_transport) |
2594 | except errors.NotBranchError: |
2595 | # really a NotBzrDir error... |
2596 | create_branch = controldir.ControlDir.create_branch_convenience |
2597 | @@ -2111,8 +2137,8 @@ |
2598 | from .transport.local import LocalTransport |
2599 | if a_controldir.has_branch(): |
2600 | if (isinstance(to_transport, LocalTransport) |
2601 | - and not a_controldir.has_workingtree()): |
2602 | - raise errors.BranchExistsWithoutWorkingTree(location) |
2603 | + and not a_controldir.has_workingtree()): |
2604 | + raise errors.BranchExistsWithoutWorkingTree(location) |
2605 | raise errors.AlreadyBranchError(location) |
2606 | branch = a_controldir.create_branch() |
2607 | if not no_tree and not a_controldir.has_workingtree(): |
2608 | @@ -2122,7 +2148,7 @@ |
2609 | branch.set_append_revisions_only(True) |
2610 | except errors.UpgradeRequired: |
2611 | raise errors.BzrCommandError(gettext('This branch format cannot be set' |
2612 | - ' to append-revisions-only. Try --default.')) |
2613 | + ' to append-revisions-only. Try --default.')) |
2614 | if not is_quiet(): |
2615 | from .info import describe_layout, describe_format |
2616 | try: |
2617 | @@ -2133,9 +2159,9 @@ |
2618 | layout = describe_layout(repository, branch, tree).lower() |
2619 | format = describe_format(a_controldir, repository, branch, tree) |
2620 | self.outf.write(gettext("Created a {0} (format: {1})\n").format( |
2621 | - layout, format)) |
2622 | + layout, format)) |
2623 | if repository.is_shared(): |
2624 | - #XXX: maybe this can be refactored into transport.path_or_url() |
2625 | + # XXX: maybe this can be refactored into transport.path_or_url() |
2626 | url = repository.controldir.root_transport.external_url() |
2627 | try: |
2628 | url = urlutils.local_path_from_url(url) |
2629 | @@ -2149,12 +2175,12 @@ |
2630 | |
2631 | New branches created under the repository directory will store their |
2632 | revisions in the repository, not in the branch directory. For branches |
2633 | - with shared history, this reduces the amount of storage needed and |
2634 | + with shared history, this reduces the amount of storage needed and |
2635 | speeds up the creation of new branches. |
2636 | |
2637 | If the --no-trees option is given then the branches in the repository |
2638 | - will not have working trees by default. They will still exist as |
2639 | - directories on disk, but they will not have separate copies of the |
2640 | + will not have working trees by default. They will still exist as |
2641 | + directories on disk, but they will not have separate copies of the |
2642 | files at a certain revision. This can be useful for repositories that |
2643 | store branches which are interacted with through checkouts or remote |
2644 | branches, such as on a server. |
2645 | @@ -2175,15 +2201,17 @@ |
2646 | _see_also = ['init', 'branch', 'checkout', 'repositories'] |
2647 | takes_args = ["location"] |
2648 | takes_options = [RegistryOption('format', |
2649 | - help='Specify a format for this repository. See' |
2650 | - ' "brz help formats" for details.', |
2651 | - lazy_registry=('breezy.controldir', 'format_registry'), |
2652 | - converter=lambda name: controldir.format_registry.make_controldir(name), |
2653 | - value_switches=True, title='Repository format'), |
2654 | + help='Specify a format for this repository. See' |
2655 | + ' "brz help formats" for details.', |
2656 | + lazy_registry=( |
2657 | + 'breezy.controldir', 'format_registry'), |
2658 | + converter=lambda name: controldir.format_registry.make_controldir( |
2659 | + name), |
2660 | + value_switches=True, title='Repository format'), |
2661 | Option('no-trees', |
2662 | - help='Branches in the repository will default to' |
2663 | - ' not having a working tree.'), |
2664 | - ] |
2665 | + help='Branches in the repository will default to' |
2666 | + ' not having a working tree.'), |
2667 | + ] |
2668 | aliases = ["init-repo"] |
2669 | |
2670 | def run(self, location, format=None, no_trees=False): |
2671 | @@ -2202,10 +2230,10 @@ |
2672 | |
2673 | (repo, newdir, require_stacking, repository_policy) = ( |
2674 | format.initialize_on_transport_ex(to_transport, |
2675 | - create_prefix=True, make_working_trees=not no_trees, |
2676 | - shared_repo=True, force_new_repo=True, |
2677 | - use_existing_dir=True, |
2678 | - repo_format_name=repo_format_name)) |
2679 | + create_prefix=True, make_working_trees=not no_trees, |
2680 | + shared_repo=True, force_new_repo=True, |
2681 | + use_existing_dir=True, |
2682 | + repo_format_name=repo_format_name)) |
2683 | if not is_quiet(): |
2684 | from .info import show_bzrdir_info |
2685 | show_bzrdir_info(newdir, verbose=0, outfile=self.outf) |
2686 | @@ -2226,8 +2254,8 @@ |
2687 | |
2688 | Note that when using the -r argument with a range of revisions, the |
2689 | differences are computed between the two specified revisions. That |
2690 | - is, the command does not show the changes introduced by the first |
2691 | - revision in the range. This differs from the interpretation of |
2692 | + is, the command does not show the changes introduced by the first |
2693 | + revision in the range. This differs from the interpretation of |
2694 | revision ranges used by "brz log" which includes the first revision |
2695 | in the range. |
2696 | |
2697 | @@ -2259,7 +2287,7 @@ |
2698 | brz diff -c2 |
2699 | |
2700 | To see the changes introduced by revision X:: |
2701 | - |
2702 | + |
2703 | brz diff -cX |
2704 | |
2705 | Note that in the case of a merge, the -c option shows the changes |
2706 | @@ -2307,28 +2335,28 @@ |
2707 | help='Set prefixes added to old and new filenames, as ' |
2708 | 'two values separated by a colon. (eg "old/:new/").'), |
2709 | Option('old', |
2710 | - help='Branch/tree to compare from.', |
2711 | - type=text_type, |
2712 | - ), |
2713 | + help='Branch/tree to compare from.', |
2714 | + type=text_type, |
2715 | + ), |
2716 | Option('new', |
2717 | - help='Branch/tree to compare to.', |
2718 | - type=text_type, |
2719 | - ), |
2720 | + help='Branch/tree to compare to.', |
2721 | + type=text_type, |
2722 | + ), |
2723 | 'revision', |
2724 | 'change', |
2725 | Option('using', |
2726 | - help='Use this command to compare files.', |
2727 | - type=text_type, |
2728 | - ), |
2729 | + help='Use this command to compare files.', |
2730 | + type=text_type, |
2731 | + ), |
2732 | RegistryOption('format', |
2733 | - short_name='F', |
2734 | - help='Diff format to use.', |
2735 | - lazy_registry=('breezy.diff', 'format_registry'), |
2736 | - title='Diff format'), |
2737 | + short_name='F', |
2738 | + help='Diff format to use.', |
2739 | + lazy_registry=('breezy.diff', 'format_registry'), |
2740 | + title='Diff format'), |
2741 | Option('context', |
2742 | - help='How many lines of context to show.', |
2743 | - type=int, |
2744 | - ), |
2745 | + help='How many lines of context to show.', |
2746 | + type=int, |
2747 | + ), |
2748 | ] |
2749 | aliases = ['di', 'dif'] |
2750 | encoding_type = 'exact' |
2751 | @@ -2338,7 +2366,7 @@ |
2752 | prefix=None, old=None, new=None, using=None, format=None, |
2753 | context=None): |
2754 | from .diff import (get_trees_and_branches_to_diff_locked, |
2755 | - show_diff_trees) |
2756 | + show_diff_trees) |
2757 | |
2758 | if prefix == u'0': |
2759 | # diff -p0 format |
2760 | @@ -2356,7 +2384,7 @@ |
2761 | |
2762 | if revision and len(revision) > 2: |
2763 | raise errors.BzrCommandError(gettext('brz diff --revision takes exactly' |
2764 | - ' one or two revision specifiers')) |
2765 | + ' one or two revision specifiers')) |
2766 | |
2767 | if using is not None and format is not None: |
2768 | raise errors.BzrCommandError(gettext( |
2769 | @@ -2609,7 +2637,7 @@ |
2770 | line tools: you may prefer qlog or viz from qbzr or bzr-gtk, the |
2771 | bzr-explorer shell, or the Loggerhead web interface. See the Bazaar |
2772 | Plugin Guide <http://doc.bazaar.canonical.com/plugins/en/> and |
2773 | - <http://wiki.bazaar.canonical.com/IDEIntegration>. |
2774 | + <http://wiki.bazaar.canonical.com/IDEIntegration>. |
2775 | |
2776 | You may find it useful to add the aliases below to ``breezy.conf``:: |
2777 | |
2778 | @@ -2643,76 +2671,77 @@ |
2779 | takes_args = ['file*'] |
2780 | _see_also = ['log-formats', 'revisionspec'] |
2781 | takes_options = [ |
2782 | - Option('forward', |
2783 | - help='Show from oldest to newest.'), |
2784 | - 'timezone', |
2785 | - custom_help('verbose', |
2786 | - help='Show files changed in each revision.'), |
2787 | - 'show-ids', |
2788 | - 'revision', |
2789 | - Option('change', |
2790 | - type=breezy.option._parse_revision_str, |
2791 | - short_name='c', |
2792 | - help='Show just the specified revision.' |
2793 | - ' See also "help revisionspec".'), |
2794 | - 'log-format', |
2795 | - RegistryOption('authors', |
2796 | - 'What names to list as authors - first, all or committer.', |
2797 | - title='Authors', |
2798 | - lazy_registry=('breezy.log', 'author_list_registry'), |
2799 | - ), |
2800 | - Option('levels', |
2801 | - short_name='n', |
2802 | - help='Number of levels to display - 0 for all, 1 for flat.', |
2803 | - argname='N', |
2804 | - type=_parse_levels), |
2805 | - Option('message', |
2806 | - help='Show revisions whose message matches this ' |
2807 | - 'regular expression.', |
2808 | - type=text_type, |
2809 | - hidden=True), |
2810 | - Option('limit', |
2811 | - short_name='l', |
2812 | - help='Limit the output to the first N revisions.', |
2813 | - argname='N', |
2814 | - type=_parse_limit), |
2815 | - Option('show-diff', |
2816 | - short_name='p', |
2817 | - help='Show changes made in each revision as a patch.'), |
2818 | - Option('include-merged', |
2819 | - help='Show merged revisions like --levels 0 does.'), |
2820 | - Option('include-merges', hidden=True, |
2821 | - help='Historical alias for --include-merged.'), |
2822 | - Option('omit-merges', |
2823 | - help='Do not report commits with more than one parent.'), |
2824 | - Option('exclude-common-ancestry', |
2825 | - help='Display only the revisions that are not part' |
2826 | - ' of both ancestries (require -rX..Y).' |
2827 | - ), |
2828 | - Option('signatures', |
2829 | - help='Show digital signature validity.'), |
2830 | - ListOption('match', |
2831 | - short_name='m', |
2832 | - help='Show revisions whose properties match this ' |
2833 | - 'expression.', |
2834 | - type=text_type), |
2835 | - ListOption('match-message', |
2836 | - help='Show revisions whose message matches this ' |
2837 | - 'expression.', |
2838 | - type=text_type), |
2839 | - ListOption('match-committer', |
2840 | + Option('forward', |
2841 | + help='Show from oldest to newest.'), |
2842 | + 'timezone', |
2843 | + custom_help('verbose', |
2844 | + help='Show files changed in each revision.'), |
2845 | + 'show-ids', |
2846 | + 'revision', |
2847 | + Option('change', |
2848 | + type=breezy.option._parse_revision_str, |
2849 | + short_name='c', |
2850 | + help='Show just the specified revision.' |
2851 | + ' See also "help revisionspec".'), |
2852 | + 'log-format', |
2853 | + RegistryOption('authors', |
2854 | + 'What names to list as authors - first, all or committer.', |
2855 | + title='Authors', |
2856 | + lazy_registry=( |
2857 | + 'breezy.log', 'author_list_registry'), |
2858 | + ), |
2859 | + Option('levels', |
2860 | + short_name='n', |
2861 | + help='Number of levels to display - 0 for all, 1 for flat.', |
2862 | + argname='N', |
2863 | + type=_parse_levels), |
2864 | + Option('message', |
2865 | + help='Show revisions whose message matches this ' |
2866 | + 'regular expression.', |
2867 | + type=text_type, |
2868 | + hidden=True), |
2869 | + Option('limit', |
2870 | + short_name='l', |
2871 | + help='Limit the output to the first N revisions.', |
2872 | + argname='N', |
2873 | + type=_parse_limit), |
2874 | + Option('show-diff', |
2875 | + short_name='p', |
2876 | + help='Show changes made in each revision as a patch.'), |
2877 | + Option('include-merged', |
2878 | + help='Show merged revisions like --levels 0 does.'), |
2879 | + Option('include-merges', hidden=True, |
2880 | + help='Historical alias for --include-merged.'), |
2881 | + Option('omit-merges', |
2882 | + help='Do not report commits with more than one parent.'), |
2883 | + Option('exclude-common-ancestry', |
2884 | + help='Display only the revisions that are not part' |
2885 | + ' of both ancestries (require -rX..Y).' |
2886 | + ), |
2887 | + Option('signatures', |
2888 | + help='Show digital signature validity.'), |
2889 | + ListOption('match', |
2890 | + short_name='m', |
2891 | + help='Show revisions whose properties match this ' |
2892 | + 'expression.', |
2893 | + type=text_type), |
2894 | + ListOption('match-message', |
2895 | + help='Show revisions whose message matches this ' |
2896 | + 'expression.', |
2897 | + type=text_type), |
2898 | + ListOption('match-committer', |
2899 | help='Show revisions whose committer matches this ' |
2900 | 'expression.', |
2901 | - type=text_type), |
2902 | - ListOption('match-author', |
2903 | + type=text_type), |
2904 | + ListOption('match-author', |
2905 | help='Show revisions whose authors match this ' |
2906 | 'expression.', |
2907 | - type=text_type), |
2908 | - ListOption('match-bugs', |
2909 | + type=text_type), |
2910 | + ListOption('match-bugs', |
2911 | help='Show revisions whose bugs match this ' |
2912 | 'expression.', |
2913 | - type=text_type) |
2914 | - ] |
2915 | + type=text_type) |
2916 | + ] |
2917 | encoding_type = 'replace' |
2918 | |
2919 | @display_command |
2920 | @@ -2747,7 +2776,7 @@ |
2921 | if include_merged is None: |
2922 | include_merged = False |
2923 | if (exclude_common_ancestry |
2924 | - and (revision is None or len(revision) != 2)): |
2925 | + and (revision is None or len(revision) != 2)): |
2926 | raise errors.BzrCommandError(gettext( |
2927 | '--exclude-common-ancestry requires -r with two revisions')) |
2928 | if include_merged: |
2929 | @@ -2824,7 +2853,8 @@ |
2930 | if log_format is None: |
2931 | log_format = log.log_formatter_registry.get_default(b) |
2932 | # Make a non-encoding output to include the diffs - bug 328007 |
2933 | - unencoded_output = ui.ui_factory.make_output_stream(encoding_type='exact') |
2934 | + unencoded_output = ui.ui_factory.make_output_stream( |
2935 | + encoding_type='exact') |
2936 | lf = log_format(show_ids=show_ids, to_file=self.outf, |
2937 | to_exact_file=unencoded_output, |
2938 | show_timezone=timezone, |
2939 | @@ -2847,7 +2877,7 @@ |
2940 | # file that isn't a directory without showing a delta" case. |
2941 | partial_history = revision and b.repository._format.supports_chks |
2942 | match_using_deltas = (len(file_ids) != 1 or filter_by_dir |
2943 | - or delta_type or partial_history) |
2944 | + or delta_type or partial_history) |
2945 | |
2946 | match_dict = {} |
2947 | if match: |
2948 | @@ -2949,7 +2979,7 @@ |
2949 | tree, relpath = WorkingTree.open_containing(filename) |
2950 | with tree.lock_read(): |
2951 | touching_revs = log.find_touching_revisions( |
2952 | - tree.branch.repository, tree.branch.last_revision(), tree, relpath) |
2953 | + tree.branch.repository, tree.branch.last_revision(), tree, relpath) |
2954 | for revno, revision_id, what in reversed(list(touching_revs)): |
2955 | self.outf.write("%6d %s\n" % (revno, what)) |
2956 | |
2957 | @@ -2961,26 +2991,27 @@ |
2958 | _see_also = ['status', 'cat'] |
2959 | takes_args = ['path?'] |
2960 | takes_options = [ |
2961 | - 'verbose', |
2962 | - 'revision', |
2963 | - Option('recursive', short_name='R', |
2964 | - help='Recurse into subdirectories.'), |
2965 | - Option('from-root', |
2966 | - help='Print paths relative to the root of the branch.'), |
2967 | - Option('unknown', short_name='u', |
2968 | - help='Print unknown files.'), |
2969 | - Option('versioned', help='Print versioned files.', |
2970 | - short_name='V'), |
2971 | - Option('ignored', short_name='i', |
2972 | - help='Print ignored files.'), |
2973 | - Option('kind', short_name='k', |
2974 | - help=('List entries of a particular kind: file, ' |
2975 | - 'directory, symlink, tree-reference.'), |
2976 | - type=text_type), |
2977 | - 'null', |
2978 | - 'show-ids', |
2979 | - 'directory', |
2980 | - ] |
2981 | + 'verbose', |
2982 | + 'revision', |
2983 | + Option('recursive', short_name='R', |
2984 | + help='Recurse into subdirectories.'), |
2985 | + Option('from-root', |
2986 | + help='Print paths relative to the root of the branch.'), |
2987 | + Option('unknown', short_name='u', |
2988 | + help='Print unknown files.'), |
2989 | + Option('versioned', help='Print versioned files.', |
2990 | + short_name='V'), |
2991 | + Option('ignored', short_name='i', |
2992 | + help='Print ignored files.'), |
2993 | + Option('kind', short_name='k', |
2994 | + help=('List entries of a particular kind: file, ' |
2995 | + 'directory, symlink, tree-reference.'), |
2996 | + type=text_type), |
2997 | + 'null', |
2998 | + 'show-ids', |
2999 | + 'directory', |
3000 | + ] |
3001 | + |
3002 | @display_command |
3003 | def run(self, revision=None, verbose=False, |
3004 | recursive=False, from_root=False, |
3005 | @@ -2991,17 +3022,18 @@ |
3006 | raise errors.BzrCommandError(gettext('invalid kind specified')) |
3007 | |
3008 | if verbose and null: |
3009 | - raise errors.BzrCommandError(gettext('Cannot set both --verbose and --null')) |
3010 | + raise errors.BzrCommandError( |
3011 | + gettext('Cannot set both --verbose and --null')) |
3012 | all = not (unknown or versioned or ignored) |
3013 | |
3014 | - selection = {'I':ignored, '?':unknown, 'V':versioned} |
3015 | + selection = {'I': ignored, '?': unknown, 'V': versioned} |
3016 | |
3017 | if path is None: |
3018 | fs_path = '.' |
3019 | else: |
3020 | if from_root: |
3021 | raise errors.BzrCommandError(gettext('cannot specify both --from-root' |
3022 | - ' and PATH')) |
3023 | + ' and PATH')) |
3024 | fs_path = path |
3025 | tree, branch, relpath = \ |
3026 | _open_directory_or_containing_tree_or_branch(fs_path, directory) |
3027 | @@ -3027,7 +3059,7 @@ |
3028 | |
3029 | self.add_cleanup(tree.lock_read().unlock) |
3030 | for fp, fc, fkind, fid, entry in tree.list_files(include_root=False, |
3031 | - from_dir=relpath, recursive=recursive): |
3032 | + from_dir=relpath, recursive=recursive): |
3033 | # Apply additional masking |
3034 | if not all and not selection[fc]: |
3035 | continue |
3036 | @@ -3093,7 +3125,7 @@ |
3037 | |
3038 | If a .bzrignore file does not exist, the ignore command |
3039 | will create one and add the specified files or patterns to the newly |
3040 | - created file. The ignore command will also automatically add the |
3041 | + created file. The ignore command will also automatically add the |
3042 | .bzrignore file to be versioned. Creating a .bzrignore file without |
3043 | the use of the ignore command will require an explicit add command. |
3044 | |
3045 | @@ -3101,7 +3133,7 @@ |
3046 | After adding, editing or deleting that file either indirectly by |
3047 | using this command or directly by using an editor, be sure to commit |
3048 | it. |
3049 | - |
3050 | + |
3051 | Bazaar also supports a global ignore file ~/.bazaar/ignore. On Windows |
3052 | the global ignore file can be found in the application data directory as |
3053 | C:\\Documents and Settings\\<user>\\Application Data\\Bazaar\\2.0\\ignore. |
3054 | @@ -3163,9 +3195,9 @@ |
3055 | _see_also = ['status', 'ignored', 'patterns'] |
3056 | takes_args = ['name_pattern*'] |
3057 | takes_options = ['directory', |
3058 | - Option('default-rules', |
3059 | - help='Display the default ignore rules that brz uses.') |
3060 | - ] |
3061 | + Option('default-rules', |
3062 | + help='Display the default ignore rules that brz uses.') |
3063 | + ] |
3064 | |
3065 | def run(self, name_pattern_list=None, default_rules=None, |
3066 | directory=u'.'): |
3067 | @@ -3177,7 +3209,7 @@ |
3068 | return |
3069 | if not name_pattern_list: |
3070 | raise errors.BzrCommandError(gettext("ignore requires at least one " |
3071 | - "NAME_PATTERN or --default-rules.")) |
3072 | + "NAME_PATTERN or --default-rules.")) |
3073 | name_pattern_list = [globbing.normalize_pattern(p) |
3074 | for p in name_pattern_list] |
3075 | bad_patterns = '' |
3076 | @@ -3187,14 +3219,14 @@ |
3077 | bad_patterns_count += 1 |
3078 | bad_patterns += ('\n %s' % p) |
3079 | if bad_patterns: |
3080 | - msg = (ngettext('Invalid ignore pattern found. %s', |
3081 | + msg = (ngettext('Invalid ignore pattern found. %s', |
3082 | 'Invalid ignore patterns found. %s', |
3083 | bad_patterns_count) % bad_patterns) |
3084 | ui.ui_factory.show_error(msg) |
3085 | raise lazy_regex.InvalidPattern('') |
3086 | for name_pattern in name_pattern_list: |
3087 | if (name_pattern[0] == '/' or |
3088 | - (len(name_pattern) > 1 and name_pattern[1] == ':')): |
3089 | + (len(name_pattern) > 1 and name_pattern[1] == ':')): |
3090 | raise errors.BzrCommandError(gettext( |
3091 | "NAME_PATTERN should not be an absolute path")) |
3092 | tree, relpath = WorkingTree.open_containing(directory) |
3093 | @@ -3210,9 +3242,9 @@ |
3094 | matches.append(filename) |
3095 | if len(matches) > 0: |
3096 | self.outf.write(gettext("Warning: the following files are version " |
3097 | - "controlled and match your ignore pattern:\n%s" |
3098 | - "\nThese files will continue to be version controlled" |
3099 | - " unless you 'brz remove' them.\n") % ("\n".join(matches),)) |
3100 | + "controlled and match your ignore pattern:\n%s" |
3101 | + "\nThese files will continue to be version controlled" |
3102 | + " unless you 'brz remove' them.\n") % ("\n".join(matches),)) |
3103 | |
3104 | |
3105 | class cmd_ignored(Command): |
3106 | @@ -3237,7 +3269,7 @@ |
3107 | for path, file_class, kind, file_id, entry in tree.list_files(): |
3108 | if file_class != 'I': |
3109 | continue |
3110 | - ## XXX: Slightly inefficient since this was already calculated |
3111 | + # XXX: Slightly inefficient since this was already calculated |
3112 | pat = tree.is_ignored(path) |
3113 | self.outf.write('%-50s %s\n' % (path, pat)) |
3114 | |
3115 | @@ -3259,7 +3291,8 @@ |
3116 | except ValueError: |
3117 | raise errors.BzrCommandError(gettext("not a valid revision-number: %r") |
3118 | % revno) |
3119 | - revid = WorkingTree.open_containing(directory)[0].branch.get_rev_id(revno) |
3120 | + revid = WorkingTree.open_containing( |
3121 | + directory)[0].branch.get_rev_id(revno) |
3122 | self.outf.write("%s\n" % revid.decode('utf-8')) |
3123 | |
3124 | |
3125 | @@ -3295,26 +3328,26 @@ |
3126 | encoding_type = 'exact' |
3127 | takes_args = ['dest', 'branch_or_subdir?'] |
3128 | takes_options = ['directory', |
3129 | - Option('format', |
3130 | - help="Type of file to export to.", |
3131 | - type=text_type), |
3132 | - 'revision', |
3133 | - Option('filters', help='Apply content filters to export the ' |
3134 | - 'convenient form.'), |
3135 | - Option('root', |
3136 | - type=text_type, |
3137 | - help="Name of the root directory inside the exported file."), |
3138 | - Option('per-file-timestamps', |
3139 | - help='Set modification time of files to that of the last ' |
3140 | - 'revision in which it was changed.'), |
3141 | - Option('uncommitted', |
3142 | - help='Export the working tree contents rather than that of the ' |
3143 | - 'last revision.'), |
3144 | - ] |
3145 | + Option('format', |
3146 | + help="Type of file to export to.", |
3147 | + type=text_type), |
3148 | + 'revision', |
3149 | + Option('filters', help='Apply content filters to export the ' |
3150 | + 'convenient form.'), |
3151 | + Option('root', |
3152 | + type=text_type, |
3153 | + help="Name of the root directory inside the exported file."), |
3154 | + Option('per-file-timestamps', |
3155 | + help='Set modification time of files to that of the last ' |
3156 | + 'revision in which it was changed.'), |
3157 | + Option('uncommitted', |
3158 | + help='Export the working tree contents rather than that of the ' |
3159 | + 'last revision.'), |
3160 | + ] |
3161 | |
3162 | def run(self, dest, branch_or_subdir=None, revision=None, format=None, |
3163 | - root=None, filters=False, per_file_timestamps=False, uncommitted=False, |
3164 | - directory=u'.'): |
3165 | + root=None, filters=False, per_file_timestamps=False, uncommitted=False, |
3166 | + directory=u'.'): |
3167 | from .export import export, guess_format, get_root_name |
3168 | |
3169 | if branch_or_subdir is None: |
3170 | @@ -3332,8 +3365,8 @@ |
3171 | export_tree = tree |
3172 | else: |
3173 | export_tree = _get_one_revision_tree( |
3174 | - 'export', revision, branch=b, |
3175 | - tree=tree) |
3176 | + 'export', revision, branch=b, |
3177 | + tree=tree) |
3178 | |
3179 | if format is None: |
3180 | format = guess_format(dest) |
3181 | @@ -3349,7 +3382,7 @@ |
3182 | if filters: |
3183 | from breezy.filter_tree import ContentFilterTree |
3184 | export_tree = ContentFilterTree( |
3185 | - export_tree, export_tree._content_filter_stack) |
3186 | + export_tree, export_tree._content_filter_stack) |
3187 | |
3188 | try: |
3189 | export(export_tree, dest, format, root, subdir, |
3190 | @@ -3370,11 +3403,12 @@ |
3191 | |
3192 | _see_also = ['ls'] |
3193 | takes_options = ['directory', |
3194 | - Option('name-from-revision', help='The path name in the old tree.'), |
3195 | - Option('filters', help='Apply content filters to display the ' |
3196 | - 'convenience form.'), |
3197 | - 'revision', |
3198 | - ] |
3199 | + Option('name-from-revision', |
3200 | + help='The path name in the old tree.'), |
3201 | + Option('filters', help='Apply content filters to display the ' |
3202 | + 'convenience form.'), |
3203 | + 'revision', |
3204 | + ] |
3205 | takes_args = ['filename'] |
3206 | encoding_type = 'exact' |
3207 | |
3208 | @@ -3383,7 +3417,7 @@ |
3209 | filters=False, directory=None): |
3210 | if revision is not None and len(revision) != 1: |
3211 | raise errors.BzrCommandError(gettext("brz cat --revision takes exactly" |
3212 | - " one revision specifier")) |
3213 | + " one revision specifier")) |
3214 | tree, branch, relpath = \ |
3215 | _open_directory_or_containing_tree_or_branch(filename, directory) |
3216 | self.add_cleanup(branch.lock_read().unlock) |
3217 | @@ -3391,7 +3425,7 @@ |
3218 | name_from_revision, filters) |
3219 | |
3220 | def _run(self, tree, b, relpath, filename, revision, name_from_revision, |
3221 | - filtered): |
3222 | + filtered): |
3223 | import shutil |
3224 | if tree is None: |
3225 | tree = b.basis_tree() |
3226 | @@ -3425,8 +3459,8 @@ |
3227 | relpath = rev_tree.id2path(actual_file_id) |
3228 | if filtered: |
3229 | from .filter_tree import ContentFilterTree |
3230 | - filter_tree = ContentFilterTree(rev_tree, |
3231 | - rev_tree._content_filter_stack) |
3232 | + filter_tree = ContentFilterTree( |
3233 | + rev_tree, rev_tree._content_filter_stack) |
3234 | fileobj = filter_tree.get_file(relpath) |
3235 | else: |
3236 | fileobj = rev_tree.get_file(relpath) |
3237 | @@ -3443,7 +3477,6 @@ |
3238 | self.outf.write("%s\n" % osutils.local_time_offset()) |
3239 | |
3240 | |
3241 | - |
3242 | class cmd_commit(Command): |
3243 | __doc__ = """Commit changes into a new revision. |
3244 | |
3245 | @@ -3539,11 +3572,11 @@ |
3246 | Option('show-diff', short_name='p', |
3247 | help='When no message is supplied, show the diff along' |
3248 | ' with the status summary in the message editor.'), |
3249 | - Option('lossy', |
3250 | + Option('lossy', |
3251 | help='When committing to a foreign version control ' |
3252 | 'system do not push data that can not be natively ' |
3253 | 'represented.'), |
3254 | - ] |
3255 | + ] |
3256 | aliases = ['ci', 'checkin'] |
3257 | |
3258 | def _iter_bug_urls(self, bugs, branch, status): |
3259 | @@ -3643,7 +3676,7 @@ |
3260 | warning_msg = ( |
3261 | 'The commit message is a file name: "%(f)s".\n' |
3262 | '(use --file "%(f)s" to take commit message from that file)' |
3263 | - % { 'f': message }) |
3264 | + % {'f': message}) |
3265 | ui.ui_factory.show_warning(warning_msg) |
3266 | if '\r' in message: |
3267 | message = message.replace('\r\n', '\n') |
3268 | @@ -3663,8 +3696,8 @@ |
3269 | # No message supplied: make one up. |
3270 | # text is the status of the tree |
3271 | text = make_commit_message_template_encoded(tree, |
3272 | - selected_list, diff=show_diff, |
3273 | - output_encoding=osutils.get_user_encoding()) |
3274 | + selected_list, diff=show_diff, |
3275 | + output_encoding=osutils.get_user_encoding()) |
3276 | # start_message is the template generated from hooks |
3277 | # XXX: Warning - looks like hooks return unicode, |
3278 | # make_commit_message_template_encoded returns user encoding. |
3279 | @@ -3672,20 +3705,21 @@ |
3280 | # avoid this. |
3281 | my_message = set_commit_message(commit_obj) |
3282 | if my_message is None: |
3283 | - start_message = generate_commit_message_template(commit_obj) |
3284 | + start_message = generate_commit_message_template( |
3285 | + commit_obj) |
3286 | if start_message is not None: |
3287 | start_message = start_message.encode( |
3288 | - osutils.get_user_encoding()) |
3289 | + osutils.get_user_encoding()) |
3290 | my_message = edit_commit_message_encoded(text, |
3291 | - start_message=start_message) |
3292 | + start_message=start_message) |
3293 | if my_message is None: |
3294 | raise errors.BzrCommandError(gettext("please specify a commit" |
3295 | - " message with either --message or --file")) |
3296 | + " message with either --message or --file")) |
3297 | if my_message == "": |
3298 | raise errors.BzrCommandError(gettext("Empty commit message specified." |
3299 | - " Please specify a commit message with either" |
3300 | - " --message or --file or leave a blank message" |
3301 | - " with --message \"\".")) |
3302 | + " Please specify a commit message with either" |
3303 | + " --message or --file or leave a blank message" |
3304 | + " with --message \"\".")) |
3305 | return my_message |
3306 | |
3307 | # The API permits a commit with a filter of [] to mean 'select nothing' |
3308 | @@ -3703,20 +3737,20 @@ |
3309 | lossy=lossy) |
3310 | except PointlessCommit: |
3311 | raise errors.BzrCommandError(gettext("No changes to commit." |
3312 | - " Please 'brz add' the files you want to commit, or use" |
3313 | - " --unchanged to force an empty commit.")) |
3314 | + " Please 'brz add' the files you want to commit, or use" |
3315 | + " --unchanged to force an empty commit.")) |
3316 | except ConflictsInTree: |
3317 | raise errors.BzrCommandError(gettext('Conflicts detected in working ' |
3318 | - 'tree. Use "brz conflicts" to list, "brz resolve FILE" to' |
3319 | - ' resolve.')) |
3320 | + 'tree. Use "brz conflicts" to list, "brz resolve FILE" to' |
3321 | + ' resolve.')) |
3322 | except StrictCommitFailed: |
3323 | raise errors.BzrCommandError(gettext("Commit refused because there are" |
3324 | - " unknown files in the working tree.")) |
3325 | + " unknown files in the working tree.")) |
3326 | except errors.BoundBranchOutOfDate as e: |
3327 | e.extra_help = (gettext("\n" |
3328 | - 'To commit to master branch, run update and then commit.\n' |
3329 | - 'You can also pass --local to commit to continue working ' |
3330 | - 'disconnected.')) |
3331 | + 'To commit to master branch, run update and then commit.\n' |
3332 | + 'You can also pass --local to commit to continue working ' |
3333 | + 'disconnected.')) |
3334 | raise |
3335 | |
3336 | |
3337 | @@ -3827,15 +3861,16 @@ |
3338 | takes_args = ['url?'] |
3339 | takes_options = [ |
3340 | RegistryOption('format', |
3341 | - help='Upgrade to a specific format. See "brz help' |
3342 | - ' formats" for details.', |
3343 | - lazy_registry=('breezy.controldir', 'format_registry'), |
3344 | - converter=lambda name: controldir.format_registry.make_controldir(name), |
3345 | - value_switches=True, title='Branch format'), |
3346 | + help='Upgrade to a specific format. See "brz help' |
3347 | + ' formats" for details.', |
3348 | + lazy_registry=('breezy.controldir', 'format_registry'), |
3349 | + converter=lambda name: controldir.format_registry.make_controldir( |
3350 | + name), |
3351 | + value_switches=True, title='Branch format'), |
3352 | Option('clean', |
3353 | - help='Remove the backup.bzr directory if successful.'), |
3354 | + help='Remove the backup.bzr directory if successful.'), |
3355 | Option('dry-run', |
3356 | - help="Show what would be done, but don't actually do anything."), |
3357 | + help="Show what would be done, but don't actually do anything."), |
3358 | ] |
3359 | |
3360 | def run(self, url='.', format=None, clean=False, dry_run=False): |
3361 | @@ -3861,13 +3896,13 @@ |
3362 | |
3363 | brz whoami "Frank Chu <fchu@example.com>" |
3364 | """ |
3365 | - takes_options = [ 'directory', |
3366 | - Option('email', |
3367 | - help='Display email address only.'), |
3368 | - Option('branch', |
3369 | - help='Set identity for the current branch instead of ' |
3370 | - 'globally.'), |
3371 | - ] |
3372 | + takes_options = ['directory', |
3373 | + Option('email', |
3374 | + help='Display email address only.'), |
3375 | + Option('branch', |
3376 | + help='Set identity for the current branch instead of ' |
3377 | + 'globally.'), |
3378 | + ] |
3379 | takes_args = ['name?'] |
3380 | encoding_type = 'replace' |
3381 | |
3382 | @@ -3892,12 +3927,12 @@ |
3383 | |
3384 | if email: |
3385 | raise errors.BzrCommandError(gettext("--email can only be used to display existing " |
3386 | - "identity")) |
3387 | + "identity")) |
3388 | |
3389 | # display a warning if an email address isn't included in the given name. |
3390 | try: |
3391 | _mod_config.extract_email_address(name) |
3392 | - except _mod_config.NoEmailInUsername as e: |
3393 | + except _mod_config.NoEmailInUsername: |
3394 | warning('"%s" does not seem to contain an email address. ' |
3395 | 'This is allowed, but not recommended.', name) |
3396 | |
3397 | @@ -3977,7 +4012,7 @@ |
3398 | if equal_pos == -1: |
3399 | self.print_alias(name) |
3400 | else: |
3401 | - self.set_alias(name[:equal_pos], name[equal_pos+1:]) |
3402 | + self.set_alias(name[:equal_pos], name[equal_pos + 1:]) |
3403 | |
3404 | def remove_alias(self, alias_name): |
3405 | if alias_name is None: |
3406 | @@ -4062,6 +4097,7 @@ |
3407 | """ |
3408 | # NB: this is used from the class without creating an instance, which is |
3409 | # why it does not have a self parameter. |
3410 | + |
3411 | def get_transport_type(typestring): |
3412 | """Parse and return a transport specifier.""" |
3413 | if typestring == "sftp": |
3414 | @@ -4081,9 +4117,9 @@ |
3415 | takes_args = ['testspecs*'] |
3416 | takes_options = ['verbose', |
3417 | Option('one', |
3418 | - help='Stop when one test fails.', |
3419 | - short_name='1', |
3420 | - ), |
3421 | + help='Stop when one test fails.', |
3422 | + short_name='1', |
3423 | + ), |
3424 | Option('transport', |
3425 | help='Use a different transport by default ' |
3426 | 'throughout the test suite.', |
3427 | @@ -4103,10 +4139,11 @@ |
3428 | Option('list-only', |
3429 | help='List the tests instead of running them.'), |
3430 | RegistryOption('parallel', |
3431 | - help="Run the test suite in parallel.", |
3432 | - lazy_registry=('breezy.tests', 'parallel_registry'), |
3433 | - value_switches=False, |
3434 | - ), |
3435 | + help="Run the test suite in parallel.", |
3436 | + lazy_registry=( |
3437 | + 'breezy.tests', 'parallel_registry'), |
3438 | + value_switches=False, |
3439 | + ), |
3440 | Option('randomize', type=text_type, argname="SEED", |
3441 | help='Randomize the order of tests using the given' |
3442 | ' seed or "now" for the current time.'), |
3443 | @@ -4126,8 +4163,7 @@ |
3444 | help='Turn on a selftest debug flag.'), |
3445 | ListOption('starting-with', type=text_type, argname='TESTID', |
3446 | param_name='starting_with', short_name='s', |
3447 | - help= |
3448 | - 'Load only the tests starting with TESTID.'), |
3449 | + help='Load only the tests starting with TESTID.'), |
3450 | Option('sync', |
3451 | help="By default we disable fsync and fdatasync" |
3452 | " while running the test suite.") |
3453 | @@ -4161,7 +4197,7 @@ |
3454 | from . import tests |
3455 | except ImportError: |
3456 | raise errors.BzrCommandError("tests not available. Install the " |
3457 | - "breezy tests to run the breezy testsuite.") |
3458 | + "breezy tests to run the breezy testsuite.") |
3459 | |
3460 | if testspecs_list is not None: |
3461 | pattern = '|'.join(testspecs_list) |
3462 | @@ -4181,7 +4217,7 @@ |
3463 | # following code can be deleted when it's sufficiently deployed |
3464 | # -- vila/mgz 20100514 |
3465 | if (sys.platform == "win32" |
3466 | - and getattr(sys.stdout, 'fileno', None) is not None): |
3467 | + and getattr(sys.stdout, 'fileno', None) is not None): |
3468 | import msvcrt |
3469 | msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) |
3470 | if subunit2: |
3471 | @@ -4208,21 +4244,21 @@ |
3472 | if not sync: |
3473 | self._disable_fsync() |
3474 | selftest_kwargs = {"verbose": verbose, |
3475 | - "pattern": pattern, |
3476 | - "stop_on_failure": one, |
3477 | - "transport": transport, |
3478 | - "test_suite_factory": test_suite_factory, |
3479 | - "lsprof_timed": lsprof_timed, |
3480 | - "lsprof_tests": lsprof_tests, |
3481 | - "matching_tests_first": first, |
3482 | - "list_only": list_only, |
3483 | - "random_seed": randomize, |
3484 | - "exclude_pattern": exclude_pattern, |
3485 | - "strict": strict, |
3486 | - "load_list": load_list, |
3487 | - "debug_flags": debugflag, |
3488 | - "starting_with": starting_with |
3489 | - } |
3490 | + "pattern": pattern, |
3491 | + "stop_on_failure": one, |
3492 | + "transport": transport, |
3493 | + "test_suite_factory": test_suite_factory, |
3494 | + "lsprof_timed": lsprof_timed, |
3495 | + "lsprof_tests": lsprof_tests, |
3496 | + "matching_tests_first": first, |
3497 | + "list_only": list_only, |
3498 | + "random_seed": randomize, |
3499 | + "exclude_pattern": exclude_pattern, |
3500 | + "strict": strict, |
3501 | + "load_list": load_list, |
3502 | + "debug_flags": debugflag, |
3503 | + "starting_with": starting_with |
3504 | + } |
3505 | selftest_kwargs.update(self.additional_selftest_args) |
3506 | |
3507 | # Make deprecation warnings visible, unless -Werror is set |
3508 | @@ -4293,7 +4329,7 @@ |
3509 | base_rev_id = graph.find_unique_lca(last1, last2) |
3510 | |
3511 | self.outf.write(gettext('merge base is revision %s\n') % |
3512 | - base_rev_id.decode('utf-8')) |
3513 | + base_rev_id.decode('utf-8')) |
3514 | |
3515 | |
3516 | class cmd_merge(Command): |
3517 | @@ -4394,16 +4430,16 @@ |
3518 | Option('uncommitted', help='Apply uncommitted changes' |
3519 | ' from a working copy, instead of branch changes.'), |
3520 | Option('pull', help='If the destination is already' |
3521 | - ' completely merged into the source, pull from the' |
3522 | - ' source rather than merging. When this happens,' |
3523 | - ' you do not need to commit the result.'), |
3524 | + ' completely merged into the source, pull from the' |
3525 | + ' source rather than merging. When this happens,' |
3526 | + ' you do not need to commit the result.'), |
3527 | custom_help('directory', |
3528 | - help='Branch to merge into, ' |
3529 | + help='Branch to merge into, ' |
3530 | 'rather than the one containing the working directory.'), |
3531 | Option('preview', help='Instead of merging, show a diff of the' |
3532 | ' merge.'), |
3533 | Option('interactive', help='Select changes interactively.', |
3534 | - short_name='i') |
3535 | + short_name='i') |
3536 | ] |
3537 | |
3538 | def run(self, location=None, revision=None, force=False, |
3539 | @@ -4426,7 +4462,7 @@ |
3540 | tree = WorkingTree.open_containing(directory)[0] |
3541 | if tree.branch.last_revision() == _mod_revision.NULL_REVISION: |
3542 | raise errors.BzrCommandError(gettext('Merging into empty branches not currently supported, ' |
3543 | - 'https://bugs.launchpad.net/bzr/+bug/308562')) |
3544 | + 'https://bugs.launchpad.net/bzr/+bug/308562')) |
3545 | |
3546 | # die as quickly as possible if there are uncommitted changes |
3547 | if not force: |
3548 | @@ -4442,49 +4478,50 @@ |
3549 | if location is not None: |
3550 | try: |
3551 | mergeable = bundle.read_mergeable_from_url(location, |
3552 | - possible_transports=possible_transports) |
3553 | + possible_transports=possible_transports) |
3554 | except errors.NotABundle: |
3555 | mergeable = None |
3556 | else: |
3557 | if uncommitted: |
3558 | raise errors.BzrCommandError(gettext('Cannot use --uncommitted' |
3559 | - ' with bundles or merge directives.')) |
3560 | + ' with bundles or merge directives.')) |
3561 | |
3562 | if revision is not None: |
3563 | raise errors.BzrCommandError(gettext( |
3564 | 'Cannot use -r with merge directives or bundles')) |
3565 | merger, verified = _mod_merge.Merger.from_mergeable(tree, |
3566 | - mergeable) |
3567 | + mergeable) |
3568 | |
3569 | if merger is None and uncommitted: |
3570 | if revision is not None and len(revision) > 0: |
3571 | raise errors.BzrCommandError(gettext('Cannot use --uncommitted and' |
3572 | - ' --revision at the same time.')) |
3573 | + ' --revision at the same time.')) |
3574 | merger = self.get_merger_from_uncommitted(tree, location, None) |
3575 | allow_pending = False |
3576 | |
3577 | if merger is None: |
3578 | merger, allow_pending = self._get_merger_from_branch(tree, |
3579 | - location, revision, remember, possible_transports, None) |
3580 | + location, revision, remember, possible_transports, None) |
3581 | |
3582 | merger.merge_type = merge_type |
3583 | merger.reprocess = reprocess |
3584 | merger.show_base = show_base |
3585 | self.sanity_check_merger(merger) |
3586 | if (merger.base_rev_id == merger.other_rev_id and |
3587 | - merger.other_rev_id is not None): |
3588 | + merger.other_rev_id is not None): |
3589 | # check if location is a nonexistent file (and not a branch) to |
3590 | # disambiguate the 'Nothing to do' |
3591 | if merger.interesting_files: |
3592 | if not merger.other_tree.has_filename( |
3593 | - merger.interesting_files[0]): |
3594 | + merger.interesting_files[0]): |
3595 | note(gettext("merger: ") + str(merger)) |
3596 | raise errors.PathsDoNotExist([location]) |
3597 | note(gettext('Nothing to do.')) |
3598 | return 0 |
3599 | if pull and not preview: |
3600 | if merger.interesting_files is not None: |
3601 | - raise errors.BzrCommandError(gettext('Cannot pull individual files')) |
3602 | + raise errors.BzrCommandError( |
3603 | + gettext('Cannot pull individual files')) |
3604 | if (merger.base_rev_id == tree.last_revision()): |
3605 | result = tree.pull(merger.other_branch, False, |
3606 | merger.other_rev_id) |
3607 | @@ -4549,9 +4586,9 @@ |
3608 | |
3609 | def sanity_check_merger(self, merger): |
3610 | if (merger.show_base and |
3611 | - not merger.merge_type is _mod_merge.Merge3Merger): |
3612 | + merger.merge_type is not _mod_merge.Merge3Merger): |
3613 | raise errors.BzrCommandError(gettext("Show-base is not supported for this" |
3614 | - " merge type. %s") % merger.merge_type) |
3615 | + " merge type. %s") % merger.merge_type) |
3616 | if merger.reprocess is None: |
3617 | if merger.show_base: |
3618 | merger.reprocess = False |
3619 | @@ -4560,11 +4597,11 @@ |
3620 | merger.reprocess = merger.merge_type.supports_reprocess |
3621 | if merger.reprocess and not merger.merge_type.supports_reprocess: |
3622 | raise errors.BzrCommandError(gettext("Conflict reduction is not supported" |
3623 | - " for merge type %s.") % |
3624 | + " for merge type %s.") % |
3625 | merger.merge_type) |
3626 | if merger.reprocess and merger.show_base: |
3627 | raise errors.BzrCommandError(gettext("Cannot do conflict reduction and" |
3628 | - " show base.")) |
3629 | + " show base.")) |
3630 | |
3631 | if (merger.merge_type.requires_file_merge_plan and |
3632 | (not getattr(merger.this_tree, 'plan_file_merge', None) or |
3633 | @@ -4572,28 +4609,28 @@ |
3634 | (merger.base_tree is not None and |
3635 | not getattr(merger.base_tree, 'plan_file_merge', None)))): |
3636 | raise errors.BzrCommandError( |
3637 | - gettext('Plan file merge unsupported: ' |
3638 | - 'Merge type incompatible with tree formats.')) |
3639 | + gettext('Plan file merge unsupported: ' |
3640 | + 'Merge type incompatible with tree formats.')) |
3641 | |
3642 | def _get_merger_from_branch(self, tree, location, revision, remember, |
3643 | possible_transports, pb): |
3644 | """Produce a merger from a location, assuming it refers to a branch.""" |
3645 | # find the branch locations |
3646 | other_loc, user_location = self._select_branch_location(tree, location, |
3647 | - revision, -1) |
3648 | + revision, -1) |
3649 | if revision is not None and len(revision) == 2: |
3650 | base_loc, _unused = self._select_branch_location(tree, |
3651 | - location, revision, 0) |
3652 | + location, revision, 0) |
3653 | else: |
3654 | base_loc = other_loc |
3655 | # Open the branches |
3656 | other_branch, other_path = Branch.open_containing(other_loc, |
3657 | - possible_transports) |
3658 | + possible_transports) |
3659 | if base_loc == other_loc: |
3660 | base_branch = other_branch |
3661 | else: |
3662 | base_branch, base_path = Branch.open_containing(base_loc, |
3663 | - possible_transports) |
3664 | + possible_transports) |
3665 | # Find the revision ids |
3666 | other_revision_id = None |
3667 | base_revision_id = None |
3668 | @@ -4611,15 +4648,15 @@ |
3669 | # - user ask to remember or there is no previous location set to merge |
3670 | # from and user didn't ask to *not* remember |
3671 | if (user_location is not None |
3672 | - and ((remember |
3673 | - or (remember is None |
3674 | - and tree.branch.get_submit_branch() is None)))): |
3675 | + and ((remember or |
3676 | + (remember is None and |
3677 | + tree.branch.get_submit_branch() is None)))): |
3678 | tree.branch.set_submit_branch(other_branch.base) |
3679 | # Merge tags (but don't set them in the master branch yet, the user |
3680 | # might revert this merge). Commit will propagate them. |
3681 | other_branch.tags.merge_to(tree.branch.tags, ignore_master=True) |
3682 | merger = _mod_merge.Merger.from_revision_ids(tree, |
3683 | - other_revision_id, base_revision_id, other_branch, base_branch) |
3684 | + other_revision_id, base_revision_id, other_branch, base_branch) |
3685 | if other_path != '': |
3686 | allow_pending = False |
3687 | merger.interesting_files = [other_path] |
3688 | @@ -4660,7 +4697,7 @@ |
3689 | will be the user-entered location. |
3690 | """ |
3691 | if (revision is not None and index is not None |
3692 | - and revision[index] is not None): |
3693 | + and revision[index] is not None): |
3694 | branch = revision[index].get_branch() |
3695 | if branch is not None: |
3696 | return branch, branch |
3697 | @@ -4682,10 +4719,11 @@ |
3698 | stored_location_type = "parent" |
3699 | mutter("%s", stored_location) |
3700 | if stored_location is None: |
3701 | - raise errors.BzrCommandError(gettext("No location specified or remembered")) |
3702 | + raise errors.BzrCommandError( |
3703 | + gettext("No location specified or remembered")) |
3704 | display_url = urlutils.unescape_for_display(stored_location, 'utf-8') |
3705 | note(gettext("{0} remembered {1} location {2}").format(verb_string, |
3706 | - stored_location_type, display_url)) |
3707 | + stored_location_type, display_url)) |
3708 | return stored_location |
3709 | |
3710 | |
3711 | @@ -4713,11 +4751,11 @@ |
3712 | """ |
3713 | takes_args = ['file*'] |
3714 | takes_options = [ |
3715 | - 'merge-type', |
3716 | - 'reprocess', |
3717 | - Option('show-base', |
3718 | - help="Show base revision text in conflicts."), |
3719 | - ] |
3720 | + 'merge-type', |
3721 | + 'reprocess', |
3722 | + Option('show-base', |
3723 | + help="Show base revision text in conflicts."), |
3724 | + ] |
3725 | |
3726 | def run(self, file_list=None, merge_type=None, show_base=False, |
3727 | reprocess=False): |
3728 | @@ -4728,10 +4766,9 @@ |
3729 | self.add_cleanup(tree.lock_write().unlock) |
3730 | parents = tree.get_parent_ids() |
3731 | if len(parents) != 2: |
3732 | - raise errors.BzrCommandError(gettext("Sorry, remerge only works after normal" |
3733 | - " merges. Not cherrypicking or" |
3734 | - " multi-merges.")) |
3735 | - repository = tree.branch.repository |
3736 | + raise errors.BzrCommandError( |
3737 | + gettext("Sorry, remerge only works after normal" |
3738 | + " merges. Not cherrypicking or multi-merges.")) |
3739 | interesting_files = None |
3740 | new_conflicts = [] |
3741 | conflicts = tree.conflicts() |
3742 | @@ -4744,7 +4781,8 @@ |
3743 | if tree.kind(filename) != "directory": |
3744 | continue |
3745 | |
3746 | - for path, ie in tree.iter_entries_by_dir(specific_files=[filename]): |
3747 | + for path, ie in tree.iter_entries_by_dir( |
3748 | + specific_files=[filename]): |
3749 | interesting_files.add(path) |
3750 | new_conflicts = conflicts.select_conflicts(tree, file_list)[0] |
3751 | else: |
3752 | @@ -4858,7 +4896,7 @@ |
3753 | def _revert_tree_to_revision(tree, revision, file_list, no_backup): |
3754 | rev_tree = _get_one_revision_tree('revert', revision, tree=tree) |
3755 | tree.revert(file_list, rev_tree, not no_backup, None, |
3756 | - report_changes=True) |
3757 | + report_changes=True) |
3758 | |
3759 | |
3760 | class cmd_assert_fail(Command): |
3761 | @@ -4877,8 +4915,8 @@ |
3762 | |
3763 | _see_also = ['topics'] |
3764 | takes_options = [ |
3765 | - Option('long', 'Show help on all commands.'), |
3766 | - ] |
3767 | + Option('long', 'Show help on all commands.'), |
3768 | + ] |
3769 | takes_args = ['topic?'] |
3770 | aliases = ['?', '--help', '-?', '-h'] |
3771 | |
3772 | @@ -4955,12 +4993,12 @@ |
3773 | 'show-ids', |
3774 | 'verbose', |
3775 | custom_help('revision', |
3776 | - help='Filter on other branch revisions (inclusive). ' |
3777 | - 'See "help revisionspec" for details.'), |
3778 | + help='Filter on other branch revisions (inclusive). ' |
3779 | + 'See "help revisionspec" for details.'), |
3780 | Option('my-revision', |
3781 | - type=_parse_revision_str, |
3782 | - help='Filter on local branch revisions (inclusive). ' |
3783 | - 'See "help revisionspec" for details.'), |
3784 | + type=_parse_revision_str, |
3785 | + help='Filter on local branch revisions (inclusive). ' |
3786 | + 'See "help revisionspec" for details.'), |
3787 | Option('include-merged', |
3788 | 'Show all revisions in addition to the mainline ones.'), |
3789 | Option('include-merges', hidden=True, |
3790 | @@ -5004,7 +5042,7 @@ |
3791 | other_branch = parent |
3792 | if other_branch is None: |
3793 | raise errors.BzrCommandError(gettext("No peer location known" |
3794 | - " or specified.")) |
3795 | + " or specified.")) |
3796 | display_url = urlutils.unescape_for_display(parent, |
3797 | self.outf.encoding) |
3798 | message(gettext("Using saved parent location: {0}\n").format( |
3799 | @@ -5018,11 +5056,11 @@ |
3800 | |
3801 | local_revid_range = _revision_range_to_revid_range( |
3802 | _get_revision_range(my_revision, local_branch, |
3803 | - self.name())) |
3804 | + self.name())) |
3805 | |
3806 | remote_revid_range = _revision_range_to_revid_range( |
3807 | _get_revision_range(revision, |
3808 | - remote_branch, self.name())) |
3809 | + remote_branch, self.name())) |
3810 | |
3811 | local_extra, remote_extra = find_unmerged( |
3812 | local_branch, remote_branch, restrict, |
3813 | @@ -5041,16 +5079,16 @@ |
3814 | status_code = 0 |
3815 | if local_extra and not theirs_only: |
3816 | message(ngettext("You have %d extra revision:\n", |
3817 | - "You have %d extra revisions:\n", |
3818 | + "You have %d extra revisions:\n", |
3819 | len(local_extra)) % |
3820 | - len(local_extra)) |
3821 | + len(local_extra)) |
3822 | rev_tag_dict = {} |
3823 | if local_branch.supports_tags(): |
3824 | rev_tag_dict = local_branch.tags.get_reverse_tag_dict() |
3825 | for revision in iter_log_revisions(local_extra, |
3826 | - local_branch.repository, |
3827 | - verbose, |
3828 | - rev_tag_dict): |
3829 | + local_branch.repository, |
3830 | + verbose, |
3831 | + rev_tag_dict): |
3832 | lf.log_revision(revision) |
3833 | printed_local = True |
3834 | status_code = 1 |
3835 | @@ -5063,13 +5101,13 @@ |
3836 | message(ngettext("You are missing %d revision:\n", |
3837 | "You are missing %d revisions:\n", |
3838 | len(remote_extra)) % |
3839 | - len(remote_extra)) |
3840 | + len(remote_extra)) |
3841 | if remote_branch.supports_tags(): |
3842 | rev_tag_dict = remote_branch.tags.get_reverse_tag_dict() |
3843 | for revision in iter_log_revisions(remote_extra, |
3844 | - remote_branch.repository, |
3845 | - verbose, |
3846 | - rev_tag_dict): |
3847 | + remote_branch.repository, |
3848 | + verbose, |
3849 | + rev_tag_dict): |
3850 | lf.log_revision(revision) |
3851 | status_code = 1 |
3852 | |
3853 | @@ -5115,7 +5153,8 @@ |
3854 | _see_also = ['repositories'] |
3855 | takes_args = ['branch_or_repo?'] |
3856 | takes_options = [ |
3857 | - Option('clean-obsolete-packs', 'Delete obsolete packs to save disk space.'), |
3858 | + Option('clean-obsolete-packs', |
3859 | + 'Delete obsolete packs to save disk space.'), |
3860 | ] |
3861 | |
3862 | def run(self, branch_or_repo='.', clean_obsolete_packs=False): |
3863 | @@ -5160,12 +5199,13 @@ |
3864 | class cmd_testament(Command): |
3865 | __doc__ = """Show testament (signing-form) of a revision.""" |
3866 | takes_options = [ |
3867 | - 'revision', |
3868 | - Option('long', help='Produce long-format testament.'), |
3869 | - Option('strict', |
3870 | - help='Produce a strict-format testament.')] |
3871 | + 'revision', |
3872 | + Option('long', help='Produce long-format testament.'), |
3873 | + Option('strict', |
3874 | + help='Produce a strict-format testament.')] |
3875 | takes_args = ['branch?'] |
3876 | encoding_type = 'exact' |
3877 | + |
3878 | @display_command |
3879 | def run(self, branch=u'.', revision=None, long=False, strict=False): |
3880 | from .testament import Testament, StrictTestament |
3881 | @@ -5245,15 +5285,17 @@ |
3882 | __doc__ = """Create a digital signature for an existing revision.""" |
3883 | # TODO be able to replace existing ones. |
3884 | |
3885 | - hidden = True # is this right ? |
3886 | + hidden = True # is this right ? |
3887 | takes_args = ['revision_id*'] |
3888 | takes_options = ['directory', 'revision'] |
3889 | |
3890 | def run(self, revision_id_list=None, revision=None, directory=u'.'): |
3891 | if revision_id_list is not None and revision is not None: |
3892 | - raise errors.BzrCommandError(gettext('You can only supply one of revision_id or --revision')) |
3893 | + raise errors.BzrCommandError( |
3894 | + gettext('You can only supply one of revision_id or --revision')) |
3895 | if revision_id_list is None and revision is None: |
3896 | - raise errors.BzrCommandError(gettext('You must supply either --revision or a revision_id')) |
3897 | + raise errors.BzrCommandError( |
3898 | + gettext('You must supply either --revision or a revision_id')) |
3899 | b = WorkingTree.open_containing(directory)[0].branch |
3900 | self.add_cleanup(b.lock_write().unlock) |
3901 | return self._run(b, revision_id_list, revision) |
3902 | @@ -5266,7 +5308,7 @@ |
3903 | for revision_id in revision_id_list: |
3904 | revision_id = cache_utf8.encode(revision_id) |
3905 | b.repository.sign_revision(revision_id, gpg_strategy) |
3906 | - except: |
3907 | + except BaseException: |
3908 | b.repository.abort_write_group() |
3909 | raise |
3910 | else: |
3911 | @@ -5277,7 +5319,7 @@ |
3912 | b.repository.start_write_group() |
3913 | try: |
3914 | b.repository.sign_revision(rev_id, gpg_strategy) |
3915 | - except: |
3916 | + except BaseException: |
3917 | b.repository.abort_write_group() |
3918 | raise |
3919 | else: |
3920 | @@ -5291,19 +5333,21 @@ |
3921 | if to_revid is None: |
3922 | to_revno = b.revno() |
3923 | if from_revno is None or to_revno is None: |
3924 | - raise errors.BzrCommandError(gettext('Cannot sign a range of non-revision-history revisions')) |
3925 | + raise errors.BzrCommandError( |
3926 | + gettext('Cannot sign a range of non-revision-history revisions')) |
3927 | b.repository.start_write_group() |
3928 | try: |
3929 | for revno in range(from_revno, to_revno + 1): |
3930 | b.repository.sign_revision(b.get_rev_id(revno), |
3931 | gpg_strategy) |
3932 | - except: |
3933 | + except BaseException: |
3934 | b.repository.abort_write_group() |
3935 | raise |
3936 | else: |
3937 | b.repository.commit_write_group() |
3938 | else: |
3939 | - raise errors.BzrCommandError(gettext('Please supply either one revision, or a range.')) |
3940 | + raise errors.BzrCommandError( |
3941 | + gettext('Please supply either one revision, or a range.')) |
3942 | |
3943 | |
3944 | class cmd_bind(Command): |
3945 | @@ -5328,8 +5372,9 @@ |
3946 | try: |
3947 | location = b.get_old_bound_location() |
3948 | except errors.UpgradeRequired: |
3949 | - raise errors.BzrCommandError(gettext('No location supplied. ' |
3950 | - 'This format does not remember old locations.')) |
3951 | + raise errors.BzrCommandError( |
3952 | + gettext('No location supplied. ' |
3953 | + 'This format does not remember old locations.')) |
3954 | else: |
3955 | if location is None: |
3956 | if b.get_bound_location() is not None: |
3957 | @@ -5343,8 +5388,9 @@ |
3958 | try: |
3959 | b.bind(b_other) |
3960 | except errors.DivergedBranches: |
3961 | - raise errors.BzrCommandError(gettext('These branches have diverged.' |
3962 | - ' Try merging, and then bind again.')) |
3963 | + raise errors.BzrCommandError( |
3964 | + gettext('These branches have diverged.' |
3965 | + ' Try merging, and then bind again.')) |
3966 | if b.get_config().has_explicit_nickname(): |
3967 | b.nick = b_other.nick |
3968 | |
3969 | @@ -5388,15 +5434,15 @@ |
3970 | # information in shared branches as well. |
3971 | _see_also = ['commit'] |
3972 | takes_options = ['verbose', 'revision', |
3973 | - Option('dry-run', help='Don\'t actually make changes.'), |
3974 | - Option('force', help='Say yes to all questions.'), |
3975 | - Option('keep-tags', |
3976 | - help='Keep tags that point to removed revisions.'), |
3977 | - Option('local', |
3978 | - help="Only remove the commits from the local branch" |
3979 | - " when in a checkout." |
3980 | - ), |
3981 | - ] |
3982 | + Option('dry-run', help='Don\'t actually make changes.'), |
3983 | + Option('force', help='Say yes to all questions.'), |
3984 | + Option('keep-tags', |
3985 | + help='Keep tags that point to removed revisions.'), |
3986 | + Option('local', |
3987 | + help="Only remove the commits from the local " |
3988 | + "branch when in a checkout." |
3989 | + ), |
3990 | + ] |
3991 | takes_args = ['location?'] |
3992 | aliases = [] |
3993 | encoding_type = 'replace' |
3994 | @@ -5458,9 +5504,10 @@ |
3995 | |
3996 | if dry_run: |
3997 | self.outf.write(gettext('Dry-run, pretending to remove' |
3998 | - ' the above revisions.\n')) |
3999 | + ' the above revisions.\n')) |
4000 | else: |
4001 | - self.outf.write(gettext('The above revision(s) will be removed.\n')) |
4002 | + self.outf.write( |
4003 | + gettext('The above revision(s) will be removed.\n')) |
4004 | |
4005 | if not force: |
4006 | if not ui.ui_factory.confirm_action( |
4007 | @@ -5474,8 +5521,10 @@ |
4008 | last_rev_id, rev_id) |
4009 | uncommit(b, tree=tree, dry_run=dry_run, verbose=verbose, |
4010 | revno=revno, local=local, keep_tags=keep_tags) |
4011 | - self.outf.write(gettext('You can restore the old tip by running:\n' |
4012 | - ' brz pull . -r revid:%s\n') % last_rev_id.decode('utf-8')) |
4013 | + self.outf.write( |
4014 | + gettext('You can restore the old tip by running:\n' |
4015 | + ' brz pull . -r revid:%s\n') |
4016 | + % last_rev_id.decode('utf-8')) |
4017 | |
4018 | |
4019 | class cmd_break_lock(Command): |
4020 | @@ -5501,7 +5550,7 @@ |
4021 | Option('config', |
4022 | help='LOCATION is the directory where the config lock is.'), |
4023 | Option('force', |
4024 | - help='Do not ask for confirmation before breaking the lock.'), |
4025 | + help='Do not ask for confirmation before breaking the lock.'), |
4026 | ] |
4027 | |
4028 | def run(self, location=None, config=False, force=False): |
4029 | @@ -5509,8 +5558,8 @@ |
4030 | location = u'.' |
4031 | if force: |
4032 | ui.ui_factory = ui.ConfirmationUserInterfacePolicy(ui.ui_factory, |
4033 | - None, |
4034 | - {'breezy.lockdir.break': True}) |
4035 | + None, |
4036 | + {'breezy.lockdir.break': True}) |
4037 | if config: |
4038 | conf = _mod_config.LockableConfig(file_name=location) |
4039 | conf.break_lock() |
4040 | @@ -5545,18 +5594,20 @@ |
4041 | Option('inet', |
4042 | help='Serve on stdin/out for use from inetd or sshd.'), |
4043 | RegistryOption('protocol', |
4044 | - help="Protocol to serve.", |
4045 | - lazy_registry=('breezy.transport', 'transport_server_registry'), |
4046 | - value_switches=True), |
4047 | + help="Protocol to serve.", |
4048 | + lazy_registry=('breezy.transport', |
4049 | + 'transport_server_registry'), |
4050 | + value_switches=True), |
4051 | Option('listen', |
4052 | - help='Listen for connections on nominated address.', type=text_type), |
4053 | + help='Listen for connections on nominated address.', |
4054 | + type=text_type), |
4055 | Option('port', |
4056 | help='Listen for connections on nominated port. Passing 0 as ' |
4057 | 'the port number will result in a dynamically allocated ' |
4058 | 'port. The default port depends on the protocol.', |
4059 | type=int), |
4060 | custom_help('directory', |
4061 | - help='Serve contents of this directory.'), |
4062 | + help='Serve contents of this directory.'), |
4063 | Option('allow-writes', |
4064 | help='By default the server is a readonly server. Supplying ' |
4065 | '--allow-writes enables write access to the contents of ' |
4066 | @@ -5565,7 +5616,7 @@ |
4067 | 'external authentication is arranged supplying this ' |
4068 | 'option leads to global uncontrolled write access to your ' |
4069 | 'file system.' |
4070 | - ), |
4071 | + ), |
4072 | Option('client-timeout', type=float, |
4073 | help='Override the default idle client timeout (5min).'), |
4074 | ] |
4075 | @@ -5601,8 +5652,8 @@ |
4076 | _see_also = ['split'] |
4077 | takes_args = ['tree'] |
4078 | takes_options = [ |
4079 | - Option('reference', help='Join by reference.', hidden=True), |
4080 | - ] |
4081 | + Option('reference', help='Join by reference.', hidden=True), |
4082 | + ] |
4083 | |
4084 | def run(self, tree, reference=False): |
4085 | from breezy.mutabletree import BadReferenceTarget |
4086 | @@ -5622,13 +5673,13 @@ |
4087 | # XXX: Would be better to just raise a nicely printable |
4088 | # exception from the real origin. Also below. mbp 20070306 |
4089 | raise errors.BzrCommandError( |
4090 | - gettext("Cannot join {0}. {1}").format(tree, e.reason)) |
4091 | + gettext("Cannot join {0}. {1}").format(tree, e.reason)) |
4092 | else: |
4093 | try: |
4094 | containing_tree.subsume(sub_tree) |
4095 | except errors.BadSubsumeSource as e: |
4096 | raise errors.BzrCommandError( |
4097 | - gettext("Cannot join {0}. {1}").format(tree, e.reason)) |
4098 | + gettext("Cannot join {0}. {1}").format(tree, e.reason)) |
4099 | |
4100 | |
4101 | class cmd_split(Command): |
4102 | @@ -5681,7 +5732,8 @@ |
4103 | |
4104 | takes_options = [ |
4105 | 'directory', |
4106 | - RegistryOption.from_kwargs('patch-type', |
4107 | + RegistryOption.from_kwargs( |
4108 | + 'patch-type', |
4109 | 'The type of patch to include in the directive.', |
4110 | title='Patch type', |
4111 | value_switches=True, |
4112 | @@ -5691,9 +5743,10 @@ |
4113 | plain='No patch, just directive.'), |
4114 | Option('sign', help='GPG-sign the directive.'), 'revision', |
4115 | Option('mail-to', type=text_type, |
4116 | - help='Instead of printing the directive, email to this address.'), |
4117 | + help='Instead of printing the directive, email to this ' |
4118 | + 'address.'), |
4119 | Option('message', type=text_type, short_name='m', |
4120 | - help='Message to use when committing this merge.') |
4121 | + help='Message to use when committing this merge.') |
4122 | ] |
4123 | |
4124 | encoding_type = 'exact' |
4125 | @@ -5717,7 +5770,8 @@ |
4126 | if submit_branch is None: |
4127 | submit_branch = branch.get_parent() |
4128 | if submit_branch is None: |
4129 | - raise errors.BzrCommandError(gettext('No submit branch specified or known')) |
4130 | + raise errors.BzrCommandError( |
4131 | + gettext('No submit branch specified or known')) |
4132 | |
4133 | stored_public_branch = branch.get_public_branch() |
4134 | if public_branch is None: |
4135 | @@ -5726,13 +5780,14 @@ |
4136 | # FIXME: Should be done only if we succeed ? -- vila 2012-01-03 |
4137 | branch.set_public_branch(public_branch) |
4138 | if not include_bundle and public_branch is None: |
4139 | - raise errors.BzrCommandError(gettext('No public branch specified or' |
4140 | - ' known')) |
4141 | + raise errors.BzrCommandError( |
4142 | + gettext('No public branch specified or known')) |
4143 | base_revision_id = None |
4144 | if revision is not None: |
4145 | if len(revision) > 2: |
4146 | - raise errors.BzrCommandError(gettext('brz merge-directive takes ' |
4147 | - 'at most two one revision identifiers')) |
4148 | + raise errors.BzrCommandError( |
4149 | + gettext('brz merge-directive takes ' |
4150 | + 'at most two one revision identifiers')) |
4151 | revision_id = revision[-1].as_revision_id(branch) |
4152 | if len(revision) == 2: |
4153 | base_revision_id = revision[0].as_revision_id(branch) |
4154 | @@ -5936,9 +5991,9 @@ |
4155 | output = '-' |
4156 | from .send import send |
4157 | return send(submit_branch, revision, public_branch, remember, |
4158 | - format, no_bundle, no_patch, output, |
4159 | - kwargs.get('from', '.'), None, None, None, |
4160 | - self.outf, strict=strict) |
4161 | + format, no_bundle, no_patch, output, |
4162 | + kwargs.get('from', '.'), None, None, None, |
4163 | + self.outf, strict=strict) |
4164 | |
4165 | |
4166 | class cmd_tag(Command): |
4167 | @@ -5957,7 +6012,7 @@ |
4168 | To rename a tag (change the name but keep it on the same revsion), run ``brz |
4169 | tag new-name -r tag:old-name`` and then ``brz tag --delete oldname``. |
4170 | |
4171 | - If no tag name is specified it will be determined through the |
4172 | + If no tag name is specified it will be determined through the |
4173 | 'automatic_tag_name' hook. This can e.g. be used to automatically tag |
4174 | upstream releases by reading configure.ac. See ``brz help hooks`` for |
4175 | details. |
4176 | @@ -5967,13 +6022,13 @@ |
4177 | takes_args = ['tag_name?'] |
4178 | takes_options = [ |
4179 | Option('delete', |
4180 | - help='Delete this tag rather than placing it.', |
4181 | - ), |
4182 | + help='Delete this tag rather than placing it.', |
4183 | + ), |
4184 | custom_help('directory', |
4185 | - help='Branch in which to place the tag.'), |
4186 | + help='Branch in which to place the tag.'), |
4187 | Option('force', |
4188 | - help='Replace existing tags.', |
4189 | - ), |
4190 | + help='Replace existing tags.', |
4191 | + ), |
4192 | 'revision', |
4193 | ] |
4194 | |
4195 | @@ -5987,7 +6042,8 @@ |
4196 | self.add_cleanup(branch.lock_write().unlock) |
4197 | if delete: |
4198 | if tag_name is None: |
4199 | - raise errors.BzrCommandError(gettext("No tag specified to delete.")) |
4200 | + raise errors.BzrCommandError( |
4201 | + gettext("No tag specified to delete.")) |
4202 | branch.tags.delete_tag(tag_name) |
4203 | note(gettext('Deleted tag %s.') % tag_name) |
4204 | else: |
4205 | @@ -6029,11 +6085,11 @@ |
4206 | _see_also = ['tag'] |
4207 | takes_options = [ |
4208 | custom_help('directory', |
4209 | - help='Branch whose tags should be displayed.'), |
4210 | + help='Branch whose tags should be displayed.'), |
4211 | RegistryOption('sort', |
4212 | - 'Sort tags by different criteria.', title='Sorting', |
4213 | - lazy_registry=('breezy.tag', 'tag_sort_methods') |
4214 | - ), |
4215 | + 'Sort tags by different criteria.', title='Sorting', |
4216 | + lazy_registry=('breezy.tag', 'tag_sort_methods') |
4217 | + ), |
4218 | 'show-ids', |
4219 | 'revision', |
4220 | ] |
4221 | @@ -6092,8 +6148,8 @@ |
4222 | tagged_revids = branch.tags.get_reverse_tag_dict() |
4223 | found = [] |
4224 | for r in branch.iter_merge_sorted_revisions( |
4225 | - start_revision_id=revid2, stop_revision_id=revid1, |
4226 | - stop_rule='include'): |
4227 | + start_revision_id=revid2, stop_revision_id=revid1, |
4228 | + stop_rule='include'): |
4229 | revid_tags = tagged_revids.get(r[0], None) |
4230 | if revid_tags: |
4231 | found.extend([(tag, r[0]) for tag in revid_tags]) |
4232 | @@ -6126,7 +6182,7 @@ |
4233 | tree='Reconfigure to be an unbound branch with a working tree.', |
4234 | checkout='Reconfigure to be a bound branch with a working tree.', |
4235 | lightweight_checkout='Reconfigure to be a lightweight' |
4236 | - ' checkout (with no local history).', |
4237 | + ' checkout (with no local history).', |
4238 | ), |
4239 | RegistryOption.from_kwargs( |
4240 | 'repository_type', |
4241 | @@ -6134,7 +6190,7 @@ |
4242 | help='Location fo the repository.', |
4243 | value_switches=True, enum_switch=False, |
4244 | standalone='Reconfigure to be a standalone branch ' |
4245 | - '(i.e. stop using shared repository).', |
4246 | + '(i.e. stop using shared repository).', |
4247 | use_shared='Reconfigure to use a shared repository.', |
4248 | ), |
4249 | RegistryOption.from_kwargs( |
4250 | @@ -6143,22 +6199,22 @@ |
4251 | help='Whether new branches in the repository have trees.', |
4252 | value_switches=True, enum_switch=False, |
4253 | with_trees='Reconfigure repository to create ' |
4254 | - 'working trees on branches by default.', |
4255 | + 'working trees on branches by default.', |
4256 | with_no_trees='Reconfigure repository to not create ' |
4257 | - 'working trees on branches by default.' |
4258 | + 'working trees on branches by default.' |
4259 | ), |
4260 | Option('bind-to', help='Branch to bind checkout to.', type=text_type), |
4261 | Option('force', |
4262 | - help='Perform reconfiguration even if local changes' |
4263 | - ' will be lost.'), |
4264 | + help='Perform reconfiguration even if local changes' |
4265 | + ' will be lost.'), |
4266 | Option('stacked-on', |
4267 | - help='Reconfigure a branch to be stacked on another branch.', |
4268 | - type=text_type, |
4269 | - ), |
4270 | + help='Reconfigure a branch to be stacked on another branch.', |
4271 | + type=text_type, |
4272 | + ), |
4273 | Option('unstacked', |
4274 | - help='Reconfigure a branch to be unstacked. This ' |
4275 | - 'may require copying substantial data into it.', |
4276 | - ), |
4277 | + help='Reconfigure a branch to be unstacked. This ' |
4278 | + 'may require copying substantial data into it.', |
4279 | + ), |
4280 | ] |
4281 | |
4282 | def run(self, location=None, bind_to=None, force=False, |
4283 | @@ -6166,7 +6222,8 @@ |
4284 | stacked_on=None, unstacked=None): |
4285 | directory = controldir.ControlDir.open(location) |
4286 | if stacked_on and unstacked: |
4287 | - raise errors.BzrCommandError(gettext("Can't use both --stacked-on and --unstacked")) |
4288 | + raise errors.BzrCommandError( |
4289 | + gettext("Can't use both --stacked-on and --unstacked")) |
4290 | elif stacked_on is not None: |
4291 | reconfigure.ReconfigureStackedOn().apply(directory, stacked_on) |
4292 | elif unstacked: |
4293 | @@ -6176,12 +6233,12 @@ |
4294 | # to ban it. |
4295 | if (tree_type is None and |
4296 | repository_type is None and |
4297 | - repository_trees is None): |
4298 | + repository_trees is None): |
4299 | if stacked_on or unstacked: |
4300 | return |
4301 | else: |
4302 | raise errors.BzrCommandError(gettext('No target configuration ' |
4303 | - 'specified')) |
4304 | + 'specified')) |
4305 | reconfiguration = None |
4306 | if tree_type == 'branch': |
4307 | reconfiguration = reconfigure.Reconfigure.to_branch(directory) |
4308 | @@ -6240,15 +6297,15 @@ |
4309 | takes_args = ['to_location?'] |
4310 | takes_options = ['directory', |
4311 | Option('force', |
4312 | - help='Switch even if local commits will be lost.'), |
4313 | + help='Switch even if local commits will be lost.'), |
4314 | 'revision', |
4315 | Option('create-branch', short_name='b', |
4316 | - help='Create the target branch from this one before' |
4317 | - ' switching to it.'), |
4318 | + help='Create the target branch from this one before' |
4319 | + ' switching to it.'), |
4320 | Option('store', |
4321 | - help='Store and restore uncommitted changes in the' |
4322 | - ' branch.'), |
4323 | - ] |
4324 | + help='Store and restore uncommitted changes in the' |
4325 | + ' branch.'), |
4326 | + ] |
4327 | |
4328 | def run(self, to_location=None, force=False, create_branch=False, |
4329 | revision=None, directory=u'.', store=False): |
4330 | @@ -6257,11 +6314,11 @@ |
4331 | revision = _get_one_revision('switch', revision) |
4332 | possible_transports = [] |
4333 | control_dir = controldir.ControlDir.open_containing(tree_location, |
4334 | - possible_transports=possible_transports)[0] |
4335 | + possible_transports=possible_transports)[0] |
4336 | if to_location is None: |
4337 | if revision is None: |
4338 | raise errors.BzrCommandError(gettext('You must supply either a' |
4339 | - ' revision or a location')) |
4340 | + ' revision or a location')) |
4341 | to_location = tree_location |
4342 | try: |
4343 | branch = control_dir.open_branch( |
4344 | @@ -6274,20 +6331,23 @@ |
4345 | if branch is None: |
4346 | raise errors.BzrCommandError( |
4347 | gettext('cannot create branch without source branch')) |
4348 | - to_location = lookup_new_sibling_branch(control_dir, to_location, |
4349 | + to_location = lookup_new_sibling_branch( |
4350 | + control_dir, to_location, |
4351 | possible_transports=possible_transports) |
4352 | if revision is not None: |
4353 | revision = revision.as_revision_id(branch) |
4354 | - to_branch = branch.controldir.sprout(to_location, |
4355 | + to_branch = branch.controldir.sprout( |
4356 | + to_location, |
4357 | possible_transports=possible_transports, |
4358 | revision_id=revision, |
4359 | source_branch=branch).open_branch() |
4360 | else: |
4361 | try: |
4362 | to_branch = Branch.open(to_location, |
4363 | - possible_transports=possible_transports) |
4364 | + possible_transports=possible_transports) |
4365 | except errors.NotBranchError: |
4366 | - to_branch = open_sibling_branch(control_dir, to_location, |
4367 | + to_branch = open_sibling_branch( |
4368 | + control_dir, to_location, |
4369 | possible_transports=possible_transports) |
4370 | if revision is not None: |
4371 | revision = revision.as_revision_id(to_branch) |
4372 | @@ -6296,15 +6356,14 @@ |
4373 | store_uncommitted=store) |
4374 | except controldir.BranchReferenceLoop: |
4375 | raise errors.BzrCommandError( |
4376 | - gettext('switching would create a branch reference loop. ' |
4377 | - 'Use the "bzr up" command to switch to a ' |
4378 | - 'different revision.')) |
4379 | + gettext('switching would create a branch reference loop. ' |
4380 | + 'Use the "bzr up" command to switch to a ' |
4381 | + 'different revision.')) |
4382 | if had_explicit_nick: |
4383 | - branch = control_dir.open_branch() #get the new branch! |
4384 | + branch = control_dir.open_branch() # get the new branch! |
4385 | branch.nick = to_branch.nick |
4386 | note(gettext('Switched to branch: %s'), |
4387 | - urlutils.unescape_for_display(to_branch.base, 'utf-8')) |
4388 | - |
4389 | + urlutils.unescape_for_display(to_branch.base, 'utf-8')) |
4390 | |
4391 | |
4392 | class cmd_view(Command): |
4393 | @@ -6373,19 +6432,19 @@ |
4394 | takes_args = ['file*'] |
4395 | takes_options = [ |
4396 | Option('all', |
4397 | - help='Apply list or delete action to all views.', |
4398 | - ), |
4399 | + help='Apply list or delete action to all views.', |
4400 | + ), |
4401 | Option('delete', |
4402 | - help='Delete the view.', |
4403 | - ), |
4404 | + help='Delete the view.', |
4405 | + ), |
4406 | Option('name', |
4407 | - help='Name of the view to define, list or delete.', |
4408 | - type=text_type, |
4409 | - ), |
4410 | + help='Name of the view to define, list or delete.', |
4411 | + type=text_type, |
4412 | + ), |
4413 | Option('switch', |
4414 | - help='Name of the view to switch to.', |
4415 | - type=text_type, |
4416 | - ), |
4417 | + help='Name of the view to switch to.', |
4418 | + type=text_type, |
4419 | + ), |
4420 | ] |
4421 | |
4422 | def run(self, file_list, |
4423 | @@ -6395,7 +6454,7 @@ |
4424 | switch=None, |
4425 | ): |
4426 | tree, file_list = WorkingTree.open_containing_paths(file_list, |
4427 | - apply_view=False) |
4428 | + apply_view=False) |
4429 | current_view, view_dict = tree.views.get_view_info() |
4430 | if name is None: |
4431 | name = current_view |
4432 | @@ -6410,7 +6469,8 @@ |
4433 | tree.views.set_view_info(None, {}) |
4434 | self.outf.write(gettext("Deleted all views.\n")) |
4435 | elif name is None: |
4436 | - raise errors.BzrCommandError(gettext("No current view to delete")) |
4437 | + raise errors.BzrCommandError( |
4438 | + gettext("No current view to delete")) |
4439 | else: |
4440 | tree.views.delete_view(name) |
4441 | self.outf.write(gettext("Deleted '%s' view.\n") % name) |
4442 | @@ -6423,13 +6483,16 @@ |
4443 | "Both --switch and --all specified")) |
4444 | elif switch == 'off': |
4445 | if current_view is None: |
4446 | - raise errors.BzrCommandError(gettext("No current view to disable")) |
4447 | + raise errors.BzrCommandError( |
4448 | + gettext("No current view to disable")) |
4449 | tree.views.set_view_info(None, view_dict) |
4450 | - self.outf.write(gettext("Disabled '%s' view.\n") % (current_view)) |
4451 | + self.outf.write(gettext("Disabled '%s' view.\n") % |
4452 | + (current_view)) |
4453 | else: |
4454 | tree.views.set_view_info(switch, view_dict) |
4455 | view_str = views.view_display_str(tree.views.lookup_view()) |
4456 | - self.outf.write(gettext("Using '{0}' view: {1}\n").format(switch, view_str)) |
4457 | + self.outf.write( |
4458 | + gettext("Using '{0}' view: {1}\n").format(switch, view_str)) |
4459 | elif all: |
4460 | if view_dict: |
4461 | self.outf.write(gettext('Views defined:\n')) |
4462 | @@ -6451,7 +6514,8 @@ |
4463 | "Cannot change the 'off' pseudo view")) |
4464 | tree.views.set_view(name, sorted(file_list)) |
4465 | view_str = views.view_display_str(tree.views.lookup_view()) |
4466 | - self.outf.write(gettext("Using '{0}' view: {1}\n").format(name, view_str)) |
4467 | + self.outf.write( |
4468 | + gettext("Using '{0}' view: {1}\n").format(name, view_str)) |
4469 | else: |
4470 | # list the files |
4471 | if name is None: |
4472 | @@ -6459,7 +6523,8 @@ |
4473 | self.outf.write(gettext('No current view.\n')) |
4474 | else: |
4475 | view_str = views.view_display_str(tree.views.lookup_view(name)) |
4476 | - self.outf.write(gettext("'{0}' view is: {1}\n").format(name, view_str)) |
4477 | + self.outf.write( |
4478 | + gettext("'{0}' view is: {1}\n").format(name, view_str)) |
4479 | |
4480 | |
4481 | class cmd_hooks(Command): |
4482 | @@ -6485,7 +6550,7 @@ |
4483 | class cmd_remove_branch(Command): |
4484 | __doc__ = """Remove a branch. |
4485 | |
4486 | - This will remove the branch from the specified location but |
4487 | + This will remove the branch from the specified location but |
4488 | will keep any working tree or repository in place. |
4489 | |
4490 | :Examples: |
4491 | @@ -6499,7 +6564,7 @@ |
4492 | takes_args = ["location?"] |
4493 | |
4494 | takes_options = ['directory', |
4495 | - Option('force', help='Remove branch even if it is the active branch.')] |
4496 | + Option('force', help='Remove branch even if it is the active branch.')] |
4497 | |
4498 | aliases = ["rmbranch"] |
4499 | |
4500 | @@ -6511,7 +6576,7 @@ |
4501 | except errors.NotBranchError: |
4502 | active_branch = None |
4503 | if (active_branch is not None and |
4504 | - br.control_url == active_branch.control_url): |
4505 | + br.control_url == active_branch.control_url): |
4506 | raise errors.BzrCommandError( |
4507 | gettext("Branch is active. Use --force to remove it.")) |
4508 | br.controldir.destroy_branch(br.name) |
4509 | @@ -6580,7 +6645,7 @@ |
4510 | writer = breezy.option.diff_writer_registry.get() |
4511 | try: |
4512 | shelver = Shelver.from_args(writer(self.outf), revision, all, |
4513 | - file_list, message, destroy=destroy, directory=directory) |
4514 | + file_list, message, destroy=destroy, directory=directory) |
4515 | try: |
4516 | shelver.run() |
4517 | finally: |
4518 | @@ -6695,7 +6760,7 @@ |
4519 | branchdir = '.' |
4520 | if path is not None: |
4521 | branchdir = path |
4522 | - tree, branch, relpath =( |
4523 | + tree, branch, relpath = ( |
4524 | controldir.ControlDir.open_containing_tree_or_branch(branchdir)) |
4525 | if path is not None: |
4526 | path = relpath |
4527 | @@ -6727,13 +6792,13 @@ |
4528 | |
4529 | hidden = True |
4530 | takes_options = [Option('plugin', |
4531 | - help='Export help text from named command '\ |
4532 | + help='Export help text from named command ' |
4533 | '(defaults to all built in commands).', |
4534 | type=text_type), |
4535 | Option('include-duplicates', |
4536 | help='Output multiple copies of the same msgid ' |
4537 | 'string if it appears more than once.'), |
4538 | - ] |
4539 | + ] |
4540 | |
4541 | def run(self, plugin=None, include_duplicates=False): |
4542 | from .export_pot import export_pot |
4543 | @@ -6807,16 +6872,16 @@ |
4544 | # register lazy builtins from other modules; called at startup and should |
4545 | # be only called once. |
4546 | for (name, aliases, module_name) in [ |
4547 | - ('cmd_bisect', [], 'breezy.bisect'), |
4548 | - ('cmd_bundle_info', [], 'breezy.bundle.commands'), |
4549 | - ('cmd_config', [], 'breezy.config'), |
4550 | - ('cmd_dump_btree', [], 'breezy.bzr.debug_commands'), |
4551 | - ('cmd_version_info', [], 'breezy.cmd_version_info'), |
4552 | - ('cmd_resolve', ['resolved'], 'breezy.conflicts'), |
4553 | - ('cmd_conflicts', [], 'breezy.conflicts'), |
4554 | - ('cmd_ping', [], 'breezy.bzr.smart.ping'), |
4555 | - ('cmd_sign_my_commits', [], 'breezy.commit_signature_commands'), |
4556 | - ('cmd_verify_signatures', [], 'breezy.commit_signature_commands'), |
4557 | - ('cmd_test_script', [], 'breezy.cmd_test_script'), |
4558 | - ]: |
4559 | + ('cmd_bisect', [], 'breezy.bisect'), |
4560 | + ('cmd_bundle_info', [], 'breezy.bundle.commands'), |
4561 | + ('cmd_config', [], 'breezy.config'), |
4562 | + ('cmd_dump_btree', [], 'breezy.bzr.debug_commands'), |
4563 | + ('cmd_version_info', [], 'breezy.cmd_version_info'), |
4564 | + ('cmd_resolve', ['resolved'], 'breezy.conflicts'), |
4565 | + ('cmd_conflicts', [], 'breezy.conflicts'), |
4566 | + ('cmd_ping', [], 'breezy.bzr.smart.ping'), |
4567 | + ('cmd_sign_my_commits', [], 'breezy.commit_signature_commands'), |
4568 | + ('cmd_verify_signatures', [], 'breezy.commit_signature_commands'), |
4569 | + ('cmd_test_script', [], 'breezy.cmd_test_script'), |
4570 | + ]: |
4571 | builtin_command_registry.register_lazy(name, aliases, module_name) |
4572 | |
4573 | === modified file 'breezy/bundle/__init__.py' |
4574 | --- breezy/bundle/__init__.py 2017-05-22 00:56:52 +0000 |
4575 | +++ breezy/bundle/__init__.py 2018-11-16 18:34:24 +0000 |
4576 | @@ -41,7 +41,7 @@ |
4577 | the target is not a mergeable type. |
4578 | """ |
4579 | child_transport = _mod_transport.get_transport(url, |
4580 | - possible_transports=possible_transports) |
4581 | + possible_transports=possible_transports) |
4582 | transport = child_transport.clone('..') |
4583 | filename = transport.relpath(child_transport.base) |
4584 | mergeable, transport = read_mergeable_from_transport(transport, filename, |
4585 | |
4586 | === modified file 'breezy/bundle/apply_bundle.py' |
4587 | --- breezy/bundle/apply_bundle.py 2018-06-20 01:25:17 +0000 |
4588 | +++ breezy/bundle/apply_bundle.py 2018-11-16 18:34:24 +0000 |
4589 | @@ -39,12 +39,12 @@ |
4590 | if repository.has_revision(revision.revision_id): |
4591 | continue |
4592 | cset_tree = bundle_reader.revision_tree(repository, |
4593 | - revision.revision_id) |
4594 | + revision.revision_id) |
4595 | install_revision(repository, revision, cset_tree) |
4596 | |
4597 | |
4598 | def merge_bundle(reader, tree, check_clean, merge_type, |
4599 | - reprocess, show_base, change_reporter=None): |
4600 | + reprocess, show_base, change_reporter=None): |
4601 | """Merge a revision bundle into the current tree.""" |
4602 | with ui.ui_factory.nested_progress_bar() as pb: |
4603 | pp = ProgressPhase("Merge phase", 6, pb) |
4604 | |
4605 | === modified file 'breezy/bundle/bundle_data.py' |
4606 | --- breezy/bundle/bundle_data.py 2018-11-16 15:01:06 +0000 |
4607 | +++ breezy/bundle/bundle_data.py 2018-11-16 18:34:24 +0000 |
4608 | @@ -74,11 +74,11 @@ |
4609 | |
4610 | def as_revision(self): |
4611 | rev = Revision(revision_id=self.revision_id, |
4612 | - committer=self.committer, |
4613 | - timestamp=float(self.timestamp), |
4614 | - timezone=int(self.timezone), |
4615 | - inventory_sha1=self.inventory_sha1, |
4616 | - message='\n'.join(self.message)) |
4617 | + committer=self.committer, |
4618 | + timestamp=float(self.timestamp), |
4619 | + timezone=int(self.timezone), |
4620 | + inventory_sha1=self.inventory_sha1, |
4621 | + message='\n'.join(self.message)) |
4622 | |
4623 | if self.parent_ids: |
4624 | rev.parent_ids.extend(self.parent_ids) |
4625 | @@ -93,7 +93,7 @@ |
4626 | value = '' |
4627 | else: |
4628 | key = str(property[:key_end]) |
4629 | - value = property[key_end+2:] |
4630 | + value = property[key_end + 2:] |
4631 | rev.properties[key] = value |
4632 | |
4633 | return rev |
4634 | @@ -116,6 +116,7 @@ |
4635 | """This contains the meta information. Stuff that allows you to |
4636 | recreate the revision or inventory XML. |
4637 | """ |
4638 | + |
4639 | def __init__(self, bundle_format=None): |
4640 | self.bundle_format = None |
4641 | self.committer = None |
4642 | @@ -155,7 +156,7 @@ |
4643 | if rev.timestamp is None: |
4644 | if rev.date is not None: |
4645 | rev.timestamp, rev.timezone = \ |
4646 | - unpack_highres_date(rev.date) |
4647 | + unpack_highres_date(rev.date) |
4648 | else: |
4649 | rev.timestamp = self.timestamp |
4650 | rev.timezone = self.timezone |
4651 | @@ -210,7 +211,7 @@ |
4652 | revision_info = self.get_revision_info(revision_id) |
4653 | inventory_revision_id = revision_id |
4654 | bundle_tree = BundleTree(repository.revision_tree(base), |
4655 | - inventory_revision_id) |
4656 | + inventory_revision_id) |
4657 | self._update_tree(bundle_tree, revision_id) |
4658 | |
4659 | inv = bundle_tree.inventory |
4660 | @@ -226,19 +227,20 @@ |
4661 | """ |
4662 | rev_to_sha = {} |
4663 | inv_to_sha = {} |
4664 | + |
4665 | def add_sha(d, revision_id, sha1): |
4666 | if revision_id is None: |
4667 | if sha1 is not None: |
4668 | raise BzrError('A Null revision should always' |
4669 | - 'have a null sha1 hash') |
4670 | + 'have a null sha1 hash') |
4671 | return |
4672 | if revision_id in d: |
4673 | # This really should have been validated as part |
4674 | # of _validate_revisions but lets do it again |
4675 | if sha1 != d[revision_id]: |
4676 | raise BzrError('** Revision %r referenced with 2 different' |
4677 | - ' sha hashes %s != %s' % (revision_id, |
4678 | - sha1, d[revision_id])) |
4679 | + ' sha hashes %s != %s' % (revision_id, |
4680 | + sha1, d[revision_id])) |
4681 | else: |
4682 | d[revision_id] = sha1 |
4683 | |
4684 | @@ -262,7 +264,7 @@ |
4685 | revision_id) |
4686 | if sha1 != local_sha1: |
4687 | raise BzrError('sha1 mismatch. For revision id {%s}' |
4688 | - 'local: %s, bundle: %s' % (revision_id, local_sha1, sha1)) |
4689 | + 'local: %s, bundle: %s' % (revision_id, local_sha1, sha1)) |
4690 | else: |
4691 | count += 1 |
4692 | elif revision_id not in checked: |
4693 | @@ -309,7 +311,7 @@ |
4694 | raise TestamentMismatch(rev.revision_id, rev_info.sha1, sha1) |
4695 | if rev.revision_id in rev_to_sha1: |
4696 | raise BzrError('Revision {%s} given twice in the list' |
4697 | - % (rev.revision_id)) |
4698 | + % (rev.revision_id)) |
4699 | rev_to_sha1[rev.revision_id] = sha1 |
4700 | |
4701 | def _update_tree(self, bundle_tree, revision_id): |
4702 | @@ -352,7 +354,7 @@ |
4703 | if encoding == 'base64': |
4704 | patch = base64.b64decode(b''.join(lines)) |
4705 | elif encoding is None: |
4706 | - patch = b''.join(lines) |
4707 | + patch = b''.join(lines) |
4708 | else: |
4709 | raise ValueError(encoding) |
4710 | bundle_tree.note_patch(path, patch) |
4711 | @@ -361,7 +363,7 @@ |
4712 | info = extra.split(' // ') |
4713 | if len(info) < 2: |
4714 | raise BzrError('renamed action lines need both a from and to' |
4715 | - ': %r' % extra) |
4716 | + ': %r' % extra) |
4717 | old_path = info[0] |
4718 | if info[1].startswith('=> '): |
4719 | new_path = info[1][3:] |
4720 | @@ -380,7 +382,7 @@ |
4721 | # TODO: in the future we might allow file ids to be |
4722 | # given for removed entries |
4723 | raise BzrError('removed action lines should only have the path' |
4724 | - ': %r' % extra) |
4725 | + ': %r' % extra) |
4726 | path = info[0] |
4727 | bundle_tree.note_deletion(path) |
4728 | |
4729 | @@ -388,14 +390,14 @@ |
4730 | info = extra.split(' // ') |
4731 | if len(info) <= 1: |
4732 | raise BzrError('add action lines require the path and file id' |
4733 | - ': %r' % extra) |
4734 | + ': %r' % extra) |
4735 | elif len(info) > 5: |
4736 | raise BzrError('add action lines have fewer than 5 entries.' |
4737 | - ': %r' % extra) |
4738 | + ': %r' % extra) |
4739 | path = info[0] |
4740 | if not info[1].startswith('file-id:'): |
4741 | raise BzrError('The file-id should follow the path for an add' |
4742 | - ': %r' % extra) |
4743 | + ': %r' % extra) |
4744 | # This will be Unicode because of how the stream is read. Turn it |
4745 | # back into a utf8 file_id |
4746 | file_id = cache_utf8.encode(info[1][8:]) |
4747 | @@ -413,7 +415,7 @@ |
4748 | info = extra.split(' // ') |
4749 | if len(info) < 1: |
4750 | raise BzrError('modified action lines have at least' |
4751 | - 'the path in them: %r' % extra) |
4752 | + 'the path in them: %r' % extra) |
4753 | path = info[0] |
4754 | |
4755 | last_modified, encoding = extra_info(info[1:], path) |
4756 | @@ -422,31 +424,31 @@ |
4757 | do_patch(path, lines, encoding) |
4758 | |
4759 | valid_actions = { |
4760 | - 'renamed':renamed, |
4761 | - 'removed':removed, |
4762 | - 'added':added, |
4763 | - 'modified':modified |
4764 | + 'renamed': renamed, |
4765 | + 'removed': removed, |
4766 | + 'added': added, |
4767 | + 'modified': modified |
4768 | } |
4769 | for action_line, lines in \ |
4770 | - self.get_revision_info(revision_id).tree_actions: |
4771 | + self.get_revision_info(revision_id).tree_actions: |
4772 | first = action_line.find(' ') |
4773 | if first == -1: |
4774 | raise BzrError('Bogus action line' |
4775 | - ' (no opening space): %r' % action_line) |
4776 | - second = action_line.find(' ', first+1) |
4777 | + ' (no opening space): %r' % action_line) |
4778 | + second = action_line.find(' ', first + 1) |
4779 | if second == -1: |
4780 | raise BzrError('Bogus action line' |
4781 | - ' (missing second space): %r' % action_line) |
4782 | + ' (missing second space): %r' % action_line) |
4783 | action = action_line[:first] |
4784 | - kind = action_line[first+1:second] |
4785 | + kind = action_line[first + 1:second] |
4786 | if kind not in ('file', 'directory', 'symlink'): |
4787 | raise BzrError('Bogus action line' |
4788 | - ' (invalid object kind %r): %r' % (kind, action_line)) |
4789 | - extra = action_line[second+1:] |
4790 | + ' (invalid object kind %r): %r' % (kind, action_line)) |
4791 | + extra = action_line[second + 1:] |
4792 | |
4793 | if action not in valid_actions: |
4794 | raise BzrError('Bogus action line' |
4795 | - ' (unrecognized action): %r' % action_line) |
4796 | + ' (unrecognized action): %r' % action_line) |
4797 | valid_actions[action](kind, extra, lines) |
4798 | |
4799 | def install_revisions(self, target_repo, stream_input=True): |
4800 | @@ -470,15 +472,15 @@ |
4801 | |
4802 | def __init__(self, base_tree, revision_id): |
4803 | self.base_tree = base_tree |
4804 | - self._renamed = {} # Mapping from old_path => new_path |
4805 | - self._renamed_r = {} # new_path => old_path |
4806 | - self._new_id = {} # new_path => new_id |
4807 | - self._new_id_r = {} # new_id => new_path |
4808 | - self._kinds = {} # new_path => kind |
4809 | - self._last_changed = {} # new_id => revision_id |
4810 | - self._executable = {} # new_id => executable value |
4811 | + self._renamed = {} # Mapping from old_path => new_path |
4812 | + self._renamed_r = {} # new_path => old_path |
4813 | + self._new_id = {} # new_path => new_id |
4814 | + self._new_id_r = {} # new_id => new_path |
4815 | + self._kinds = {} # new_path => kind |
4816 | + self._last_changed = {} # new_id => revision_id |
4817 | + self._executable = {} # new_id => executable value |
4818 | self.patches = {} |
4819 | - self._targets = {} # new path => new symlink target |
4820 | + self._targets = {} # new path => new symlink target |
4821 | self.deleted = [] |
4822 | self.contents_by_id = True |
4823 | self.revision_id = revision_id |
4824 | @@ -506,9 +508,9 @@ |
4825 | if (file_id in self._last_changed |
4826 | and self._last_changed[file_id] != revision_id): |
4827 | raise BzrError('Mismatched last-changed revision for file_id {%s}' |
4828 | - ': %s != %s' % (file_id, |
4829 | - self._last_changed[file_id], |
4830 | - revision_id)) |
4831 | + ': %s != %s' % (file_id, |
4832 | + self._last_changed[file_id], |
4833 | + revision_id)) |
4834 | self._last_changed[file_id] = revision_id |
4835 | |
4836 | def note_patch(self, new_path, patch): |
4837 | @@ -545,8 +547,8 @@ |
4838 | old_path = pathjoin(old_dir, basename) |
4839 | else: |
4840 | old_path = new_path |
4841 | - #If the new path wasn't in renamed, the old one shouldn't be in |
4842 | - #renamed_r |
4843 | + # If the new path wasn't in renamed, the old one shouldn't be in |
4844 | + # renamed_r |
4845 | if old_path in self._renamed_r: |
4846 | return None |
4847 | return old_path |
4848 | @@ -571,8 +573,8 @@ |
4849 | new_path = pathjoin(new_dir, basename) |
4850 | else: |
4851 | new_path = old_path |
4852 | - #If the old path wasn't in renamed, the new one shouldn't be in |
4853 | - #renamed_r |
4854 | + # If the old path wasn't in renamed, the new one shouldn't be in |
4855 | + # renamed_r |
4856 | if new_path in self._renamed: |
4857 | return None |
4858 | return new_path |
4859 | @@ -627,7 +629,7 @@ |
4860 | file_id = self.path2id(path) |
4861 | base_id = self.old_contents_id(file_id) |
4862 | if (base_id is not None and |
4863 | - base_id != self.base_tree.get_root_id()): |
4864 | + base_id != self.base_tree.get_root_id()): |
4865 | old_path = self.base_tree.id2path(base_id) |
4866 | patch_original = self.base_tree.get_file(old_path) |
4867 | else: |
4868 | @@ -635,7 +637,7 @@ |
4869 | file_patch = self.patches.get(path) |
4870 | if file_patch is None: |
4871 | if (patch_original is None and |
4872 | - self.kind(path) == 'directory'): |
4873 | + self.kind(path) == 'directory'): |
4874 | return BytesIO() |
4875 | if patch_original is None: |
4876 | raise AssertionError("None: %s" % file_id) |
4877 | @@ -794,4 +796,4 @@ |
4878 | # string.splitlines(True) also splits on '\r', but the iter_patched code |
4879 | # only expects to iterate over '\n' style lines |
4880 | return IterableFile(iter_patched(original, |
4881 | - BytesIO(file_patch).readlines())) |
4882 | + BytesIO(file_patch).readlines())) |
4883 | |
4884 | === modified file 'breezy/bundle/commands.py' |
4885 | --- breezy/bundle/commands.py 2018-07-17 21:20:55 +0000 |
4886 | +++ breezy/bundle/commands.py 2018-11-16 18:34:24 +0000 |
4887 | @@ -63,15 +63,16 @@ |
4888 | else: |
4889 | if verbose: |
4890 | raise errors.BzrCommandError(gettext( |
4891 | - '--verbose requires a merge directive')) |
4892 | + '--verbose requires a merge directive')) |
4893 | reader_method = getattr(bundle_info, 'get_bundle_reader', None) |
4894 | if reader_method is None: |
4895 | - raise errors.BzrCommandError(gettext('Bundle format not supported')) |
4896 | + raise errors.BzrCommandError( |
4897 | + gettext('Bundle format not supported')) |
4898 | |
4899 | by_kind = {} |
4900 | file_ids = set() |
4901 | for bytes, parents, repo_kind, revision_id, file_id\ |
4902 | - in reader_method().iter_records(): |
4903 | + in reader_method().iter_records(): |
4904 | by_kind.setdefault(repo_kind, []).append( |
4905 | (bytes, parents, repo_kind, revision_id, file_id)) |
4906 | if file_id is not None: |
4907 | @@ -93,9 +94,9 @@ |
4908 | |
4909 | self.outf.write(gettext('Revisions\n')) |
4910 | self.outf.write((gettext('nicks: %s\n') |
4911 | - % ', '.join(sorted(nicks))).encode(term_encoding, 'replace')) |
4912 | + % ', '.join(sorted(nicks))).encode(term_encoding, 'replace')) |
4913 | self.outf.write((gettext('committers: \n%s\n') % |
4914 | - '\n'.join(sorted(committers)).encode(term_encoding, 'replace'))) |
4915 | + '\n'.join(sorted(committers)).encode(term_encoding, 'replace'))) |
4916 | if verbose: |
4917 | self.outf.write('\n') |
4918 | bundle_file.seek(0) |
4919 | |
4920 | === modified file 'breezy/bundle/serializer/__init__.py' |
4921 | --- breezy/bundle/serializer/__init__.py 2018-07-15 18:45:17 +0000 |
4922 | +++ breezy/bundle/serializer/__init__.py 2018-11-16 18:34:24 +0000 |
4923 | @@ -49,6 +49,7 @@ |
4924 | def _get_bundle_header(version): |
4925 | return b''.join([BUNDLE_HEADER, version.encode('ascii'), b'\n']) |
4926 | |
4927 | + |
4928 | def _get_filename(f): |
4929 | return getattr(f, 'name', '<unknown>') |
4930 | |
4931 | @@ -74,7 +75,7 @@ |
4932 | if m: |
4933 | version = m.group('version') |
4934 | raise errors.BundleNotSupported(version, |
4935 | - 'old format bundles not supported') |
4936 | + 'old format bundles not supported') |
4937 | |
4938 | if version is None: |
4939 | raise errors.NotABundle('Did not find an opening header') |
4940 | @@ -87,7 +88,7 @@ |
4941 | serializer = serializer_registry.get(version) |
4942 | except KeyError: |
4943 | raise errors.BundleNotSupported(version, |
4944 | - 'unknown bundle format') |
4945 | + 'unknown bundle format') |
4946 | |
4947 | return serializer(version) |
4948 | |
4949 | @@ -126,6 +127,7 @@ |
4950 | |
4951 | Common functionality should be included here. |
4952 | """ |
4953 | + |
4954 | def __init__(self, version): |
4955 | self.version = version |
4956 | |
4957 | @@ -158,8 +160,11 @@ |
4958 | base64.encode(temp, to_file) |
4959 | to_file.write(b'\n') |
4960 | |
4961 | -serializer_registry.register_lazy('0.8', 'breezy.bundle.serializer.v08', 'BundleSerializerV08') |
4962 | -serializer_registry.register_lazy('0.9', 'breezy.bundle.serializer.v09', 'BundleSerializerV09') |
4963 | + |
4964 | +serializer_registry.register_lazy( |
4965 | + '0.8', 'breezy.bundle.serializer.v08', 'BundleSerializerV08') |
4966 | +serializer_registry.register_lazy( |
4967 | + '0.9', 'breezy.bundle.serializer.v09', 'BundleSerializerV09') |
4968 | serializer_registry.register_lazy('4', 'breezy.bundle.serializer.v4', |
4969 | - 'BundleSerializerV4') |
4970 | + 'BundleSerializerV4') |
4971 | serializer_registry.default_key = '4' |
4972 | |
4973 | === modified file 'breezy/bundle/serializer/v08.py' |
4974 | --- breezy/bundle/serializer/v08.py 2018-10-30 02:36:00 +0000 |
4975 | +++ breezy/bundle/serializer/v08.py 2018-11-16 18:34:24 +0000 |
4976 | @@ -73,7 +73,7 @@ |
4977 | |
4978 | def write(self, to_file): |
4979 | """Write action as to a file""" |
4980 | - p_texts = [' '.join([self.name]+self.parameters)] |
4981 | + p_texts = [' '.join([self.name] + self.parameters)] |
4982 | for prop in self.properties: |
4983 | if len(prop) == 1: |
4984 | p_texts.append(prop[0]) |
4985 | @@ -91,7 +91,7 @@ |
4986 | text_line = text_line[available:] |
4987 | to_file.write(b'\n... ') |
4988 | available = 79 - len(b'... ') |
4989 | - to_file.write(text_line+b'\n') |
4990 | + to_file.write(text_line + b'\n') |
4991 | |
4992 | |
4993 | class BundleSerializerV08(BundleSerializer): |
4994 | @@ -128,12 +128,12 @@ |
4995 | |
4996 | def write_bundle(self, repository, revision_id, base_revision_id, out): |
4997 | """Helper function for translating write_bundle to write""" |
4998 | - forced_bases = {revision_id:base_revision_id} |
4999 | + forced_bases = {revision_id: base_revision_id} |
5000 | if base_revision_id is NULL_REVISION: |
The diff has been truncated for viewing.
Lets trust the autopep8 isn't too far off and do another manual pass later.