Merge lp:~vila/bzr/552922-plugins-at into lp:bzr/2.2
- 552922-plugins-at
- Merge into 2.2
Proposed by
Vincent Ladeuil
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~vila/bzr/552922-plugins-at | ||||
Merge into: | lp:bzr/2.2 | ||||
Diff against target: |
8039 lines (+2585/-1104) 269 files modified
.testr.conf (+3/-0) NEWS (+207/-41) NEWS-template.txt (+31/-0) bzrlib/_annotator_pyx.pyx (+1/-1) bzrlib/_bencode_pyx.pyx (+1/-1) bzrlib/_btree_serializer_py.py (+1/-1) bzrlib/_btree_serializer_pyx.pyx (+1/-1) bzrlib/_chk_map_py.py (+1/-1) bzrlib/_chk_map_pyx.pyx (+1/-1) bzrlib/_groupcompress_pyx.pyx (+1/-1) bzrlib/_knit_load_data_pyx.pyx (+1/-1) bzrlib/_known_graph_py.py (+1/-1) bzrlib/_known_graph_pyx.pyx (+1/-1) bzrlib/_readdir_pyx.pyx (+1/-1) bzrlib/_rio_pyx.pyx (+1/-1) bzrlib/_simple_set_pyx.pxd (+1/-1) bzrlib/_simple_set_pyx.pyx (+1/-1) bzrlib/_static_tuple_c.c (+1/-1) bzrlib/_static_tuple_c.pxd (+1/-1) bzrlib/_static_tuple_py.py (+1/-1) bzrlib/_walkdirs_win32.pyx (+1/-1) bzrlib/atomicfile.py (+1/-1) bzrlib/benchmarks/bench_dirstate.py (+1/-1) bzrlib/benchmarks/tree_creator/kernel_like.py (+2/-1) bzrlib/branch.py (+47/-37) bzrlib/branchbuilder.py (+8/-5) bzrlib/btree_index.py (+1/-1) bzrlib/bugtracker.py (+1/-1) bzrlib/builtins.py (+46/-35) bzrlib/bundle/__init__.py (+1/-1) bzrlib/bzrdir.py (+44/-23) bzrlib/chk_serializer.py (+1/-1) bzrlib/cleanup.py (+1/-1) bzrlib/cmd_version_info.py (+1/-1) bzrlib/cmdline.py (+8/-8) bzrlib/commands.py (+33/-23) bzrlib/commit.py (+1/-1) bzrlib/conflicts.py (+35/-7) bzrlib/decorators.py (+1/-1) bzrlib/delta.py (+1/-1) bzrlib/diff.py (+1/-1) bzrlib/doc_generate/autodoc_rstx.py (+1/-1) bzrlib/errors.py (+12/-2) bzrlib/export/__init__.py (+10/-5) bzrlib/export/dir_exporter.py (+7/-3) bzrlib/export/tar_exporter.py (+17/-10) bzrlib/export/zip_exporter.py (+10/-5) bzrlib/globbing.py (+1/-1) bzrlib/graph.py (+1/-1) bzrlib/groupcompress.py (+1/-1) bzrlib/help.py (+1/-1) bzrlib/help_topics/en/authentication.txt (+4/-4) bzrlib/help_topics/en/configuration.txt (+43/-1) bzrlib/hooks.py (+1/-1) bzrlib/index.py (+1/-1) bzrlib/info.py (+1/-1) bzrlib/inventory.py (+1/-1) bzrlib/lockdir.py (+19/-8) bzrlib/merge.py (+2/-1) bzrlib/merge_directive.py (+1/-1) bzrlib/msgeditor.py (+1/-1) bzrlib/osutils.py (+85/-9) bzrlib/patches.py (+54/-9) bzrlib/plugin.py (+181/-69) bzrlib/plugins/launchpad/__init__.py (+2/-2) bzrlib/plugins/launchpad/lp_api.py (+1/-1) bzrlib/plugins/launchpad/lp_directory.py (+1/-1) bzrlib/plugins/launchpad/test_lp_api.py (+1/-1) bzrlib/plugins/launchpad/test_lp_directory.py (+1/-1) bzrlib/plugins/launchpad/test_lp_open.py (+1/-1) bzrlib/progress.py (+0/-5) bzrlib/reconcile.py (+1/-1) bzrlib/reconfigure.py (+1/-1) bzrlib/remote.py (+39/-27) bzrlib/revisionspec.py (+1/-1) bzrlib/revisiontree.py (+1/-1) bzrlib/serializer.py (+1/-1) bzrlib/shellcomplete.py (+1/-1) bzrlib/smart/bzrdir.py (+1/-1) bzrlib/smart/client.py (+1/-1) bzrlib/smart/medium.py (+1/-1) bzrlib/smart/protocol.py (+1/-1) bzrlib/smart/repository.py (+1/-1) bzrlib/smart/request.py (+1/-1) bzrlib/smart/server.py (+1/-1) bzrlib/smart/vfs.py (+1/-1) bzrlib/static_tuple.py (+1/-1) bzrlib/status.py (+1/-1) bzrlib/switch.py (+1/-1) bzrlib/tests/TestUtil.py (+1/-1) bzrlib/tests/__init__.py (+29/-1) bzrlib/tests/blackbox/test_annotate.py (+1/-1) bzrlib/tests/blackbox/test_branch.py (+1/-1) bzrlib/tests/blackbox/test_break_lock.py (+1/-1) bzrlib/tests/blackbox/test_cat.py (+1/-1) bzrlib/tests/blackbox/test_checkout.py (+1/-1) bzrlib/tests/blackbox/test_debug.py (+1/-1) bzrlib/tests/blackbox/test_exceptions.py (+1/-1) bzrlib/tests/blackbox/test_export.py (+11/-1) bzrlib/tests/blackbox/test_filtered_view_ops.py (+1/-1) bzrlib/tests/blackbox/test_help.py (+1/-1) bzrlib/tests/blackbox/test_ignore.py (+1/-1) bzrlib/tests/blackbox/test_info.py (+2/-1) bzrlib/tests/blackbox/test_init.py (+1/-1) bzrlib/tests/blackbox/test_ls.py (+1/-1) bzrlib/tests/blackbox/test_merge.py (+1/-1) bzrlib/tests/blackbox/test_mv.py (+1/-1) bzrlib/tests/blackbox/test_nick.py (+19/-19) bzrlib/tests/blackbox/test_non_ascii.py (+1/-1) bzrlib/tests/blackbox/test_pull.py (+1/-1) bzrlib/tests/blackbox/test_push.py (+1/-1) bzrlib/tests/blackbox/test_remerge.py (+1/-1) bzrlib/tests/blackbox/test_send.py (+1/-1) bzrlib/tests/blackbox/test_serve.py (+1/-1) bzrlib/tests/blackbox/test_shared_repository.py (+1/-1) bzrlib/tests/blackbox/test_shelve.py (+1/-1) bzrlib/tests/blackbox/test_status.py (+2/-1) bzrlib/tests/blackbox/test_switch.py (+1/-1) bzrlib/tests/blackbox/test_too_much.py (+1/-1) bzrlib/tests/blackbox/test_uncommit.py (+1/-1) bzrlib/tests/blackbox/test_update.py (+4/-3) bzrlib/tests/blackbox/test_versioning.py (+19/-6) bzrlib/tests/commands/test_branch.py (+1/-1) bzrlib/tests/commands/test_cat.py (+1/-1) bzrlib/tests/commands/test_checkout.py (+1/-1) bzrlib/tests/commands/test_commit.py (+2/-3) bzrlib/tests/commands/test_init.py (+1/-1) bzrlib/tests/commands/test_init_repository.py (+1/-1) bzrlib/tests/commands/test_merge.py (+1/-1) bzrlib/tests/commands/test_missing.py (+1/-1) bzrlib/tests/commands/test_pull.py (+1/-1) bzrlib/tests/commands/test_push.py (+1/-1) bzrlib/tests/commands/test_update.py (+1/-1) bzrlib/tests/ftp_server/__init__.py (+1/-1) bzrlib/tests/ftp_server/medusa_based.py (+1/-1) bzrlib/tests/ftp_server/pyftpdlib_based.py (+1/-1) bzrlib/tests/http_server.py (+1/-1) bzrlib/tests/http_utils.py (+1/-1) bzrlib/tests/per_branch/test_branch.py (+17/-0) bzrlib/tests/per_branch/test_iter_merge_sorted_revisions.py (+1/-1) bzrlib/tests/per_branch/test_parent.py (+1/-1) bzrlib/tests/per_bzrdir/test_bzrdir.py (+39/-11) bzrlib/tests/per_foreign_vcs/__init__.py (+1/-1) bzrlib/tests/per_foreign_vcs/test_repository.py (+1/-1) bzrlib/tests/per_interbranch/test_push.py (+1/-1) bzrlib/tests/per_intertree/__init__.py (+1/-1) bzrlib/tests/per_pack_repository.py (+1/-1) bzrlib/tests/per_repository/test_check.py (+1/-1) bzrlib/tests/per_repository/test_check_reconcile.py (+1/-1) bzrlib/tests/per_repository_reference/test_check.py (+1/-1) bzrlib/tests/per_transport.py (+47/-1) bzrlib/tests/per_tree/test_get_file_with_stat.py (+1/-1) bzrlib/tests/per_tree/test_iter_search_rules.py (+1/-1) bzrlib/tests/per_tree/test_path_content_summary.py (+1/-1) bzrlib/tests/per_tree/test_revision_tree.py (+9/-6) bzrlib/tests/per_workingtree/test_content_filters.py (+1/-1) bzrlib/tests/per_workingtree/test_is_ignored.py (+1/-1) bzrlib/tests/per_workingtree/test_revision_tree.py (+57/-6) bzrlib/tests/per_workingtree/test_workingtree.py (+6/-3) bzrlib/tests/script.py (+1/-1) bzrlib/tests/stub_sftp.py (+9/-7) bzrlib/tests/test__annotator.py (+1/-1) bzrlib/tests/test__bencode.py (+1/-1) bzrlib/tests/test__chk_map.py (+1/-1) bzrlib/tests/test__chunks_to_lines.py (+1/-1) bzrlib/tests/test__dirstate_helpers.py (+1/-1) bzrlib/tests/test__groupcompress.py (+1/-1) bzrlib/tests/test__known_graph.py (+1/-1) bzrlib/tests/test__rio.py (+1/-1) bzrlib/tests/test__simple_set.py (+1/-1) bzrlib/tests/test__static_tuple.py (+1/-1) bzrlib/tests/test__walkdirs_win32.py (+1/-1) bzrlib/tests/test_branch.py (+4/-4) bzrlib/tests/test_branchbuilder.py (+9/-0) bzrlib/tests/test_btree_index.py (+1/-1) bzrlib/tests/test_bzrdir.py (+7/-3) bzrlib/tests/test_cleanup.py (+1/-1) bzrlib/tests/test_cmdline.py (+1/-1) bzrlib/tests/test_commands.py (+32/-11) bzrlib/tests/test_commit.py (+1/-1) bzrlib/tests/test_config.py (+1/-1) bzrlib/tests/test_conflicts.py (+115/-52) bzrlib/tests/test_diff.py (+1/-1) bzrlib/tests/test_directory_service.py (+1/-1) bzrlib/tests/test_errors.py (+1/-1) bzrlib/tests/test_export.py (+22/-1) bzrlib/tests/test_fetch.py (+1/-84) bzrlib/tests/test_foreign.py (+6/-4) bzrlib/tests/test_ftp_transport.py (+19/-1) bzrlib/tests/test_globbing.py (+1/-1) bzrlib/tests/test_graph.py (+1/-1) bzrlib/tests/test_groupcompress.py (+1/-1) bzrlib/tests/test_hooks.py (+1/-1) bzrlib/tests/test_http_response.py (+1/-1) bzrlib/tests/test_ignores.py (+1/-1) bzrlib/tests/test_index.py (+1/-1) bzrlib/tests/test_info.py (+1/-1) bzrlib/tests/test_knit.py (+1/-1) bzrlib/tests/test_lockable_files.py (+1/-1) bzrlib/tests/test_lockdir.py (+20/-1) bzrlib/tests/test_log.py (+1/-1) bzrlib/tests/test_merge.py (+5/-0) bzrlib/tests/test_merge_core.py (+19/-3) bzrlib/tests/test_msgeditor.py (+1/-1) bzrlib/tests/test_patches.py (+9/-2) bzrlib/tests/test_plugins.py (+270/-96) bzrlib/tests/test_progress.py (+1/-1) bzrlib/tests/test_remote.py (+1/-1) bzrlib/tests/test_revisionspec.py (+1/-1) bzrlib/tests/test_revisiontree.py (+1/-1) bzrlib/tests/test_script.py (+1/-1) bzrlib/tests/test_shelf_ui.py (+1/-1) bzrlib/tests/test_smart.py (+1/-1) bzrlib/tests/test_source.py (+1/-1) bzrlib/tests/test_ssh_transport.py (+1/-1) bzrlib/tests/test_trace.py (+22/-1) bzrlib/tests/test_transport_log.py (+1/-1) bzrlib/tests/test_urlutils.py (+1/-1) bzrlib/tests/test_version.py (+1/-1) bzrlib/tests/test_win32utils.py (+1/-1) bzrlib/tests/test_xml.py (+1/-1) bzrlib/tests/transport_util.py (+1/-1) bzrlib/trace.py (+1/-1) bzrlib/transport/__init__.py (+14/-2) bzrlib/transport/chroot.py (+1/-1) bzrlib/transport/decorator.py (+1/-1) bzrlib/transport/ftp/__init__.py (+21/-15) bzrlib/transport/http/__init__.py (+1/-1) bzrlib/transport/http/_urllib.py (+1/-1) bzrlib/transport/http/_urllib2_wrappers.py (+1/-1) bzrlib/transport/http/wsgi.py (+1/-1) bzrlib/transport/local.py (+33/-6) bzrlib/transport/memory.py (+1/-1) bzrlib/transport/pathfilter.py (+1/-1) bzrlib/transport/sftp.py (+24/-2) bzrlib/transport/ssh.py (+6/-3) bzrlib/ui/text.py (+5/-1) bzrlib/urlutils.py (+1/-1) bzrlib/version_info_formats/format_rio.py (+1/-1) bzrlib/versionedfile.py (+1/-1) bzrlib/workingtree.py (+2/-1) bzrlib/workingtree_4.py (+4/-2) bzrlib/xml4.py (+1/-1) bzrlib/xml5.py (+1/-1) bzrlib/xml7.py (+1/-1) bzrlib/xml8.py (+1/-1) bzrlib/xml_serializer.py (+1/-1) doc/developers/_templates/layout.html (+0/-19) doc/developers/bug-handling.txt (+2/-0) doc/developers/contribution-quickstart.txt (+117/-56) doc/developers/index-plain.txt (+2/-2) doc/developers/index.txt (+18/-5) doc/developers/plugin-api.txt (+5/-5) doc/developers/process.txt (+0/-39) doc/developers/testing.txt (+36/-3) doc/en/_templates/index.html (+16/-4) doc/en/_templates/layout.html (+0/-19) doc/en/admin-guide/hooks-plugins.txt (+1/-1) doc/en/conf.py (+6/-0) doc/en/index.txt (+1/-0) doc/en/user-guide/http_smart_server.txt (+79/-15) doc/en/whats-new/whats-new-in-2.1.txt (+202/-0) doc/es/_templates/layout.html (+0/-19) doc/index.es.txt (+1/-1) doc/index.ja.txt (+1/-1) doc/index.ru.txt (+1/-1) doc/index.txt (+1/-1) doc/ru/_templates/layout.html (+0/-19) setup.py (+23/-7) |
||||
To merge this branch: | bzr merge lp:~vila/bzr/552922-plugins-at | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vincent Ladeuil | Needs Resubmitting | ||
Review via email: mp+22694@code.launchpad.net |
Commit message
Description of the change
@Reviewers: this is targeted at lp:bzr/2.2 but I'm afraid the branch (2.2)
is not up-to-date, so if the diff looks awfully wrong, you'll know why.
This patch fixes the BZR_PLUGINS_AT handling to not depend on os.listdir() order.
The automated tests couldn't catch the problem and I was lucky enough to not encounter
it before (and neither was Gary).
Unlike _find_module_
names from the loadable files, BZR_PLUGINS_AT *knows* the plugin names and can (and should)
try some file names explicitly.
Tests added.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file '.testr.conf' | |||
2 | --- .testr.conf 1970-01-01 00:00:00 +0000 | |||
3 | +++ .testr.conf 2010-04-06 07:24:41 +0000 | |||
4 | @@ -0,0 +1,3 @@ | |||
5 | 1 | [DEFAULT] | ||
6 | 2 | test_command=./bzr selftest --subunit $IDOPTION | ||
7 | 3 | test_id_option=--load-list $IDFILE | ||
8 | 0 | 4 | ||
9 | === modified file 'NEWS' | |||
10 | --- NEWS 2010-02-18 04:59:30 +0000 | |||
11 | +++ NEWS 2010-04-06 07:24:41 +0000 | |||
12 | @@ -8,7 +8,6 @@ | |||
13 | 8 | bzr 2.2.0b1 | 8 | bzr 2.2.0b1 |
14 | 9 | ########### | 9 | ########### |
15 | 10 | 10 | ||
16 | 11 | :Codename: ??? | ||
17 | 12 | :2.2.0b1: Not released yet | 11 | :2.2.0b1: Not released yet |
18 | 13 | 12 | ||
19 | 14 | Compatibility Breaks | 13 | Compatibility Breaks |
20 | @@ -31,9 +30,17 @@ | |||
21 | 31 | ``bzrlib.tests.test_server``. | 30 | ``bzrlib.tests.test_server``. |
22 | 32 | (Vincent Ladeuil) | 31 | (Vincent Ladeuil) |
23 | 33 | 32 | ||
24 | 33 | * ``BranchReferenceFormat.initialize()`` now takes an optional name argument | ||
25 | 34 | as its second parameter, for consistency with the initialize() method of | ||
26 | 35 | other formats. (Jelmer Vernooij) | ||
27 | 36 | |||
28 | 34 | New Features | 37 | New Features |
29 | 35 | ************ | 38 | ************ |
30 | 36 | 39 | ||
31 | 40 | * ``bzr export`` now takes an optional argument ``--per-file-timestamps`` | ||
32 | 41 | to set file mtimes to the last timestamp of the last revision in which | ||
33 | 42 | they were changed rather than the current time. (Jelmer Vernooij) | ||
34 | 43 | |||
35 | 37 | * If the Apport crash-reporting tool is available, bzr crashes are now | 44 | * If the Apport crash-reporting tool is available, bzr crashes are now |
36 | 38 | stored into the ``/var/crash`` apport spool directory, and the user is | 45 | stored into the ``/var/crash`` apport spool directory, and the user is |
37 | 39 | invited to report them to the developers from there, either | 46 | invited to report them to the developers from there, either |
38 | @@ -44,6 +51,17 @@ | |||
39 | 44 | treats backslash as an escape character on Windows. (Gordon Tyler, | 51 | treats backslash as an escape character on Windows. (Gordon Tyler, |
40 | 45 | #392248) | 52 | #392248) |
41 | 46 | 53 | ||
42 | 54 | * Plugins can be disabled by defining ``BZR_DISABLE_PLUGINS`` as | ||
43 | 55 | a list of plugin names separated by ':' (';' on windows). | ||
44 | 56 | (Vincent Ladeuil, #411413) | ||
45 | 57 | |||
46 | 58 | * Plugins can be loaded from arbitrary locations by defining | ||
47 | 59 | ``BZR_PLUGINS_AT`` as a list of name@path separated by ':' (';' on | ||
48 | 60 | windows). This takes precedence over ``BZR_PLUGIN_PATH`` for the | ||
49 | 61 | specified plugins. This is targeted at plugin developers for punctual | ||
50 | 62 | needs and *not* intended to replace ``BZR_PLUGIN_PATH``. | ||
51 | 63 | (Vincent Ladeuil, #82693) | ||
52 | 64 | |||
53 | 47 | * Tree-shape conflicts can be resolved by providing ``--take-this`` and | 65 | * Tree-shape conflicts can be resolved by providing ``--take-this`` and |
54 | 48 | ``--take-other`` to the ``bzr resolve`` command. Just marking the conflict | 66 | ``--take-other`` to the ``bzr resolve`` command. Just marking the conflict |
55 | 49 | as resolved is still accessible via the ``--done`` default action. | 67 | as resolved is still accessible via the ``--done`` default action. |
56 | @@ -61,6 +79,11 @@ | |||
57 | 61 | * Allow exporting a single file using ``bzr export``. | 79 | * Allow exporting a single file using ``bzr export``. |
58 | 62 | (Michal Junák, #511987) | 80 | (Michal Junák, #511987) |
59 | 63 | 81 | ||
60 | 82 | * Allow syscalls to automatically restart when ``TextUIFactory``'s | ||
61 | 83 | SIGWINCH handler is invoked, avoiding ``EINTR`` errors during blocking | ||
62 | 84 | IO, which are often poorly handled by Python's libraries and parts of | ||
63 | 85 | bzrlib. (Andrew Bennetts, #496813) | ||
64 | 86 | |||
65 | 64 | * Avoid infinite recursion when probing for apport. | 87 | * Avoid infinite recursion when probing for apport. |
66 | 65 | (Vincent Ladeuil, #516934) | 88 | (Vincent Ladeuil, #516934) |
67 | 66 | 89 | ||
68 | @@ -70,9 +93,39 @@ | |||
69 | 70 | * ``bzr add`` will not add conflict related files unless explicitly required. | 93 | * ``bzr add`` will not add conflict related files unless explicitly required. |
70 | 71 | (Vincent Ladeuil, #322767, #414589) | 94 | (Vincent Ladeuil, #322767, #414589) |
71 | 72 | 95 | ||
72 | 96 | * ``bzr help`` will no longer trigger the get_missing_command hook when | ||
73 | 97 | doing a topic lookup. This avoids prompting (like 'no command plugins/loom, | ||
74 | 98 | did you mean log?') when getting help. In future we may trigger the hook | ||
75 | 99 | deliberately when no help topics match from any help index. | ||
76 | 100 | (Robert Collins, #396261) | ||
77 | 101 | |||
78 | 73 | * ``bzr remove-tree`` can now remove multiple working trees. | 102 | * ``bzr remove-tree`` can now remove multiple working trees. |
79 | 74 | (Jared Hance, Andrew Bennetts, #253137) | 103 | (Jared Hance, Andrew Bennetts, #253137) |
80 | 75 | 104 | ||
81 | 105 | * ``bzr resolve --take-this`` and ``--take-other`` now correctly renames | ||
82 | 106 | the kept file on content conflicts where one side deleted the file. | ||
83 | 107 | (Vincent Ladeuil, #529968) | ||
84 | 108 | |||
85 | 109 | * ``bzr upgrade`` now names backup directory as ``backup.bzr.~N~`` instead | ||
86 | 110 | of ``backup.bzr``. This directory is ignored by bzr commands such as | ||
87 | 111 | ``add``. | ||
88 | 112 | (Parth Malwankar, #335033, #300001) | ||
89 | 113 | |||
90 | 114 | * Correctly interpret "451 Rename/move failure: Directory not empty" from | ||
91 | 115 | ftp servers while trying to take a lock. | ||
92 | 116 | (Martin Pool, #528722) | ||
93 | 117 | |||
94 | 118 | * DirStateRevisionTree.kind() was returning wrong result when 'kind' | ||
95 | 119 | changes occured between the workingtree and one of its parents. | ||
96 | 120 | (Vincent Ladeuil, #533437) | ||
97 | 121 | |||
98 | 122 | * Fix stub sftp test server to call os.getcwdu(). | ||
99 | 123 | (Vincent Ladeuil, #526211, #526353) | ||
100 | 124 | |||
101 | 125 | * Loading a plugin from a given path with ``BZR_PLUGINS_AT`` doesn't depend | ||
102 | 126 | on os.lisdir() order and is now reliable. | ||
103 | 127 | (Vincent Ladeuil, #552922). | ||
104 | 128 | |||
105 | 76 | * Network transfer amounts and rates are now displayed in SI units according | 129 | * Network transfer amounts and rates are now displayed in SI units according |
106 | 77 | to the Ubuntu Units Policy <https://wiki.ubuntu.com/UnitsPolicy>. | 130 | to the Ubuntu Units Policy <https://wiki.ubuntu.com/UnitsPolicy>. |
107 | 78 | (Gordon Tyler, #514399) | 131 | (Gordon Tyler, #514399) |
108 | @@ -81,26 +134,85 @@ | |||
109 | 81 | prevents ``bzr status --short`` from crashing when those files are | 134 | prevents ``bzr status --short`` from crashing when those files are |
110 | 82 | present. (John Arbash Meinel, #303275) | 135 | present. (John Arbash Meinel, #303275) |
111 | 83 | 136 | ||
116 | 84 | * ``bzr upgrade`` now names backup directory as ``backup.bzr.~N~`` instead | 137 | * ``bzr mkdir DIR`` will not create DIR unless DIR's parent is a versioned |
117 | 85 | of ``backup.bzr``. This directory is ignored by bzr commands such as | 138 | directory. (Parth Malwankar, #138600) |
118 | 86 | ``add``. | 139 | |
119 | 87 | (Parth Malwankar, #335033, #300001) | 140 | * SSH child processes will now ignore SIGQUIT on nix systems so breaking into |
120 | 141 | the debugger won't kill the session. | ||
121 | 142 | (Martin <gzlist@googlemail.com>, #162502) | ||
122 | 143 | |||
123 | 144 | * Allow additional arguments to | ||
124 | 145 | ``RemoteRepository.add_inventory_by_delta()``. (Jelmer Vernooij, #532631) | ||
125 | 146 | |||
126 | 147 | * Tolerate patches with leading noise in ``bzr-handle-patch``. | ||
127 | 148 | (Toshio Kuratomi, Martin Pool, #502076) | ||
128 | 88 | 149 | ||
129 | 89 | API Changes | 150 | API Changes |
130 | 90 | *********** | 151 | *********** |
131 | 91 | 152 | ||
132 | 153 | * ``BranchFormat.initialize`` now takes an optional ``name`` of the colocated | ||
133 | 154 | branch to create. (Jelmer Vernooij) | ||
134 | 155 | |||
135 | 156 | * ``BzrDir.get_branch_transport`` now takes an optional ``name`` of the | ||
136 | 157 | colocated branch to open. (Jelmer Vernooij) | ||
137 | 158 | |||
138 | 159 | * Added ``bzrlib.osutils.set_signal_handler``, a convenience function that | ||
139 | 160 | can set a signal handler and call ``signal.siginterrupt(signum, | ||
140 | 161 | False)`` for it, if the platform and Python version supports it. | ||
141 | 162 | (Andrew Bennetts, #496813) | ||
142 | 163 | |||
143 | 92 | * New ``bzrlib.initialize`` is recommended for programs using bzrlib to | 164 | * New ``bzrlib.initialize`` is recommended for programs using bzrlib to |
144 | 93 | run when starting up; it sets up several things that previously needed | 165 | run when starting up; it sets up several things that previously needed |
145 | 94 | to be done separately. | 166 | to be done separately. |
146 | 95 | (Martin Pool, #507710) | 167 | (Martin Pool, #507710) |
147 | 96 | 168 | ||
148 | 169 | * Exporters now support a ``per_file_timestamps`` argument to write out the | ||
149 | 170 | timestamp of the commit in which a file revision was introduced. | ||
150 | 171 | (Jelmer Vernooij) | ||
151 | 172 | |||
152 | 173 | * New method ``BzrDir.list_branches()`` that returns a sequence of branches | ||
153 | 174 | present in a control directory. (Jelmer Vernooij) | ||
154 | 175 | |||
155 | 176 | * New transport methods ``readlink``, ``symlink`` and ``hardlink``. | ||
156 | 177 | (Neil Santos) | ||
157 | 178 | |||
158 | 97 | * Remove unused ``CommandFailed`` exception. | 179 | * Remove unused ``CommandFailed`` exception. |
159 | 98 | (Martin Pool) | 180 | (Martin Pool) |
160 | 99 | 181 | ||
161 | 182 | Internals | ||
162 | 183 | ********* | ||
163 | 184 | |||
164 | 185 | * ``bzrlib.branchbuilder.BranchBuilder.build_snapshot`` now accepts a | ||
165 | 186 | ``message_callback`` in the same way that commit does. (Robert Collins) | ||
166 | 187 | |||
167 | 188 | * ``bzrlib.builtins.Commit.run`` raises ``bzrlib.errors.BoundBranchOutOfDate`` | ||
168 | 189 | rather than ``bzrlib.errors.BzrCommandError`` when the bound branch is out | ||
169 | 190 | of date. (Gary van der Merwe) | ||
170 | 191 | |||
171 | 192 | * ``bzrlib.commands.run_bzr`` is more extensible: callers can supply the | ||
172 | 193 | functions to load or disable plugins if they wish to use a different | ||
173 | 194 | plugin mechanism; the --help, --version and no-command name code paths | ||
174 | 195 | now use the generic pluggable command lookup infrastructure. | ||
175 | 196 | (Robert Collins) | ||
176 | 197 | |||
177 | 198 | * ``bzrlib.errors.BoundBranchOutOfDate`` has a new field ``extra_help`` | ||
178 | 199 | which can be set to add extra help to the error. (Gary van der Merwe) | ||
179 | 200 | |||
180 | 201 | * The methods ``BzrDir.create_branch()``, ``BzrDir.destroy_branch()`` and | ||
181 | 202 | ``BzrDir.open_branch()`` now take an optional ``name`` argument. | ||
182 | 203 | (Jelmer Vernooij) | ||
183 | 204 | |||
184 | 100 | Testing | 205 | Testing |
185 | 101 | ******* | 206 | ******* |
186 | 102 | 207 | ||
188 | 103 | * New `bzrlib.tests.test_import_tariff` can make assertions about what | 208 | * bzr now has a ``.testr.conf`` file in its source tree configured |
189 | 209 | appropriately for running tests with Testrepository | ||
190 | 210 | (``https://launchpad.net/testrepository``). (Robert Collins) | ||
191 | 211 | |||
192 | 212 | * Documentation about testing with ``subunit`` has been tweaked. | ||
193 | 213 | (Robert Collins) | ||
194 | 214 | |||
195 | 215 | * New ``bzrlib.tests.test_import_tariff`` can make assertions about what | ||
196 | 104 | Python modules are loaded, to guard against startup time or library | 216 | Python modules are loaded, to guard against startup time or library |
197 | 105 | dependency regressions. | 217 | dependency regressions. |
198 | 106 | (Martin Pool) | 218 | (Martin Pool) |
199 | @@ -108,6 +220,70 @@ | |||
200 | 108 | * Stop sending apport crash files to ``.cache`` in the directory from | 220 | * Stop sending apport crash files to ``.cache`` in the directory from |
201 | 109 | which ``bzr selftest`` was run. (Martin Pool, #422350) | 221 | which ``bzr selftest`` was run. (Martin Pool, #422350) |
202 | 110 | 222 | ||
203 | 223 | * Tests no longer fail if "close() called during concurrent | ||
204 | 224 | operation on the same file object" occurs when closing the log file | ||
205 | 225 | (which can happen if a thread tries to write to the log file at the | ||
206 | 226 | wrong moment). An warning will be written to ``stderr`` when this | ||
207 | 227 | happens, and another warning will be written if the log file could not | ||
208 | 228 | be closed after retrying 100 times. (Andrew Bennetts, #531746) | ||
209 | 229 | |||
210 | 230 | bzr 2.1.1 | ||
211 | 231 | ######### | ||
212 | 232 | |||
213 | 233 | :2.1.1: not released yet | ||
214 | 234 | |||
215 | 235 | Bug Fixes | ||
216 | 236 | ********* | ||
217 | 237 | |||
218 | 238 | * Allow syscalls to automatically restart when ``TextUIFactory``'s | ||
219 | 239 | SIGWINCH handler is invoked, avoiding ``EINTR`` errors during blocking | ||
220 | 240 | IO, which are often poorly handled by Python's libraries and parts of | ||
221 | 241 | bzrlib. (Andrew Bennetts, #496813) | ||
222 | 242 | |||
223 | 243 | * Avoid ``malloc(0)`` in ``patiencediff``, which is non-portable. | ||
224 | 244 | (Martin Pool, #331095) | ||
225 | 245 | |||
226 | 246 | * Fix plugin packaging on Windows. (Ian Clatworthy, #524162) | ||
227 | 247 | |||
228 | 248 | * Fix stub sftp test server to call os.getcwdu(). | ||
229 | 249 | (Vincent Ladeuil, #526211, #526353) | ||
230 | 250 | |||
231 | 251 | * Fixed CHM generation by moving the NEWS section template into | ||
232 | 252 | a separate file. (Ian Clatworthy, #524184) | ||
233 | 253 | |||
234 | 254 | * Merge correctly when this_tree is not a WorkingTree. (Aaron Bentley) | ||
235 | 255 | |||
236 | 256 | * Register SIGWINCH handler only when creating a ``TextUIFactory``; avoids | ||
237 | 257 | problems importing bzrlib from a non-main thread. | ||
238 | 258 | (Elliot Murphy, #521989) | ||
239 | 259 | |||
240 | 260 | * Standardize the error handling when creating a new ``StaticTuple`` | ||
241 | 261 | (problems will raise TypeError). (Matt Nordhoff, #457979) | ||
242 | 262 | |||
243 | 263 | * Warn if pyrex is too old to compile the new ``SimpleSet`` and | ||
244 | 264 | ``StaticTuple`` extensions, rather than having the build fail randomly. | ||
245 | 265 | (John Arbash Meinel, #449776) | ||
246 | 266 | |||
247 | 267 | |||
248 | 268 | Documentation | ||
249 | 269 | ************* | ||
250 | 270 | |||
251 | 271 | * Added a link to the Desktop Guide. (Ian Clatworthy) | ||
252 | 272 | |||
253 | 273 | * Added What's New in Bazaar 2.1 document. (Ian Clatworthy) | ||
254 | 274 | |||
255 | 275 | * Drop Google Analytics from the core docs as they caused problems | ||
256 | 276 | in the CHM files. (Ian Clatworthy, #502010) | ||
257 | 277 | |||
258 | 278 | API Changes | ||
259 | 279 | *********** | ||
260 | 280 | |||
261 | 281 | * Added ``bzrlib.osutils.set_signal_handler``, a convenience function that | ||
262 | 282 | can set a signal handler and call ``signal.siginterrupt(signum, | ||
263 | 283 | False)`` for it, if the platform and Python version supports it. | ||
264 | 284 | (Andrew Bennetts, #496813) | ||
265 | 285 | |||
266 | 286 | |||
267 | 111 | bzr 2.1.0 | 287 | bzr 2.1.0 |
268 | 112 | ######### | 288 | ######### |
269 | 113 | 289 | ||
270 | @@ -465,18 +641,36 @@ | |||
271 | 465 | (Martin Pool) | 641 | (Martin Pool) |
272 | 466 | 642 | ||
273 | 467 | 643 | ||
276 | 468 | bzr 2.0.5 (not released yet) | 644 | bzr 2.0.5 |
277 | 469 | ############################ | 645 | ######### |
278 | 470 | 646 | ||
279 | 471 | :Codename: | 647 | :Codename: |
281 | 472 | :2.0.5: | 648 | :2.0.5: NOT RELEASED YET |
282 | 473 | 649 | ||
283 | 474 | Bug Fixes | 650 | Bug Fixes |
284 | 475 | ********* | 651 | ********* |
285 | 476 | 652 | ||
286 | 653 | * Avoid ``malloc(0)`` in ``patiencediff``, which is non-portable. | ||
287 | 654 | (Martin Pool, #331095) | ||
288 | 655 | |||
289 | 656 | * Concurrent autopacking is more resilient to already-renamed pack files. | ||
290 | 657 | If we find that a file we are about to obsolete is already obsoleted, we | ||
291 | 658 | do not try to rename it, and we leave the file in ``obsolete_packs``. | ||
292 | 659 | The code is also fault tolerant if a file goes missing, assuming that | ||
293 | 660 | another process already removed the file. | ||
294 | 661 | (John Arbash Meinel, Gareth White, #507557) | ||
295 | 662 | |||
296 | 663 | * Cope with the lockdir ``held/info`` file being empty, which seems to | ||
297 | 664 | happen fairly often if the process is suddenly interrupted while taking | ||
298 | 665 | a lock. | ||
299 | 666 | (Martin Pool, #185103) | ||
300 | 667 | |||
301 | 477 | * Handle renames correctly when there are files or directories that | 668 | * Handle renames correctly when there are files or directories that |
302 | 478 | differ only in case. (Chris Jones, Martin Pool, #368931) | 669 | differ only in case. (Chris Jones, Martin Pool, #368931) |
303 | 479 | 670 | ||
304 | 671 | * Fixed CHM generation by moving the NEWS section template into | ||
305 | 672 | a separate file. (Ian Clatworthy, #524184) | ||
306 | 673 | |||
307 | 480 | * If ``bzr push --create-prefix`` triggers an unexpected ``NoSuchFile`` | 674 | * If ``bzr push --create-prefix`` triggers an unexpected ``NoSuchFile`` |
308 | 481 | error, report that error rather than failing with an unhelpful | 675 | error, report that error rather than failing with an unhelpful |
309 | 482 | ``UnboundLocalError``. | 676 | ``UnboundLocalError``. |
310 | @@ -486,6 +680,10 @@ | |||
311 | 486 | version number along with rest of the help text. | 680 | version number along with rest of the help text. |
312 | 487 | (Parth Malwankar, #369501) | 681 | (Parth Malwankar, #369501) |
313 | 488 | 682 | ||
314 | 683 | * Use osutils.O_NOINHERIT for some files on win32 to avoid PermissionDenied | ||
315 | 684 | errors. | ||
316 | 685 | (Inada Naoki, #524560) | ||
317 | 686 | |||
318 | 489 | Documentation | 687 | Documentation |
319 | 490 | ************* | 688 | ************* |
320 | 491 | 689 | ||
321 | @@ -11972,37 +12170,5 @@ | |||
322 | 11972 | diff, status, etc. | 12170 | diff, status, etc. |
323 | 11973 | 12171 | ||
324 | 11974 | 12172 | ||
325 | 11975 | bzr ?.?.? (not released yet) | ||
326 | 11976 | ############################ | ||
327 | 11977 | |||
328 | 11978 | :Codename: template | ||
329 | 11979 | :2.0.2: ??? | ||
330 | 11980 | |||
331 | 11981 | Compatibility Breaks | ||
332 | 11982 | ******************** | ||
333 | 11983 | |||
334 | 11984 | New Features | ||
335 | 11985 | ************ | ||
336 | 11986 | |||
337 | 11987 | Bug Fixes | ||
338 | 11988 | ********* | ||
339 | 11989 | |||
340 | 11990 | Improvements | ||
341 | 11991 | ************ | ||
342 | 11992 | |||
343 | 11993 | Documentation | ||
344 | 11994 | ************* | ||
345 | 11995 | |||
346 | 11996 | API Changes | ||
347 | 11997 | *********** | ||
348 | 11998 | |||
349 | 11999 | Internals | ||
350 | 12000 | ********* | ||
351 | 12001 | |||
352 | 12002 | Testing | ||
353 | 12003 | ******* | ||
354 | 12004 | |||
355 | 12005 | |||
356 | 12006 | |||
357 | 12007 | .. | 12173 | .. |
358 | 12008 | vim: tw=74 ft=rst ff=unix encoding=utf-8 | 12174 | vim: tw=74 ft=rst ff=unix encoding=utf-8 |
359 | 12009 | 12175 | ||
360 | === added file 'NEWS-template.txt' | |||
361 | --- NEWS-template.txt 1970-01-01 00:00:00 +0000 | |||
362 | +++ NEWS-template.txt 2010-04-06 07:24:41 +0000 | |||
363 | @@ -0,0 +1,31 @@ | |||
364 | 1 | bzr ?.?.? | ||
365 | 2 | ######### | ||
366 | 3 | |||
367 | 4 | :Codename: Nirvana | ||
368 | 5 | :2.x.y: NOT RELEASED YET | ||
369 | 6 | |||
370 | 7 | Compatibility Breaks | ||
371 | 8 | ******************** | ||
372 | 9 | |||
373 | 10 | New Features | ||
374 | 11 | ************ | ||
375 | 12 | |||
376 | 13 | Bug Fixes | ||
377 | 14 | ********* | ||
378 | 15 | |||
379 | 16 | Improvements | ||
380 | 17 | ************ | ||
381 | 18 | |||
382 | 19 | Documentation | ||
383 | 20 | ************* | ||
384 | 21 | |||
385 | 22 | API Changes | ||
386 | 23 | *********** | ||
387 | 24 | |||
388 | 25 | Internals | ||
389 | 26 | ********* | ||
390 | 27 | |||
391 | 28 | Testing | ||
392 | 29 | ******* | ||
393 | 30 | |||
394 | 31 | |||
395 | 0 | 32 | ||
396 | === modified file 'bzrlib/_annotator_pyx.pyx' | |||
397 | --- bzrlib/_annotator_pyx.pyx 2010-01-05 04:59:57 +0000 | |||
398 | +++ bzrlib/_annotator_pyx.pyx 2010-04-06 07:24:41 +0000 | |||
399 | @@ -1,4 +1,4 @@ | |||
401 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
402 | 2 | # | 2 | # |
403 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
404 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
405 | 5 | 5 | ||
406 | === modified file 'bzrlib/_bencode_pyx.pyx' | |||
407 | --- bzrlib/_bencode_pyx.pyx 2010-01-04 02:25:11 +0000 | |||
408 | +++ bzrlib/_bencode_pyx.pyx 2010-04-06 07:24:41 +0000 | |||
409 | @@ -1,4 +1,4 @@ | |||
411 | 1 | # Copyright (C) 2007,2009 Canonical Ltd | 1 | # Copyright (C) 2007, 2009, 2010 Canonical Ltd |
412 | 2 | # | 2 | # |
413 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
414 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
415 | 5 | 5 | ||
416 | === modified file 'bzrlib/_btree_serializer_py.py' | |||
417 | --- bzrlib/_btree_serializer_py.py 2009-11-07 00:28:26 +0000 | |||
418 | +++ bzrlib/_btree_serializer_py.py 2010-04-06 07:24:41 +0000 | |||
419 | @@ -1,4 +1,4 @@ | |||
421 | 1 | # Copyright (C) 2008 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
422 | 2 | # | 2 | # |
423 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
424 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
425 | 5 | 5 | ||
426 | === modified file 'bzrlib/_btree_serializer_pyx.pyx' | |||
427 | --- bzrlib/_btree_serializer_pyx.pyx 2010-01-05 05:09:45 +0000 | |||
428 | +++ bzrlib/_btree_serializer_pyx.pyx 2010-04-06 07:24:41 +0000 | |||
429 | @@ -1,4 +1,4 @@ | |||
431 | 1 | # Copyright (C) 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
432 | 2 | # | 2 | # |
433 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
434 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
435 | 5 | 5 | ||
436 | === modified file 'bzrlib/_chk_map_py.py' | |||
437 | --- bzrlib/_chk_map_py.py 2009-10-21 21:27:19 +0000 | |||
438 | +++ bzrlib/_chk_map_py.py 2010-04-06 07:24:41 +0000 | |||
439 | @@ -1,4 +1,4 @@ | |||
441 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
442 | 2 | # | 2 | # |
443 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
444 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
445 | 5 | 5 | ||
446 | === modified file 'bzrlib/_chk_map_pyx.pyx' | |||
447 | --- bzrlib/_chk_map_pyx.pyx 2010-01-05 05:09:45 +0000 | |||
448 | +++ bzrlib/_chk_map_pyx.pyx 2010-04-06 07:24:41 +0000 | |||
449 | @@ -1,4 +1,4 @@ | |||
451 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
452 | 2 | # | 2 | # |
453 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
454 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
455 | 5 | 5 | ||
456 | === modified file 'bzrlib/_groupcompress_pyx.pyx' | |||
457 | --- bzrlib/_groupcompress_pyx.pyx 2010-01-05 05:09:45 +0000 | |||
458 | +++ bzrlib/_groupcompress_pyx.pyx 2010-04-06 07:24:41 +0000 | |||
459 | @@ -1,4 +1,4 @@ | |||
461 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
462 | 2 | # | 2 | # |
463 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
464 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
465 | 5 | 5 | ||
466 | === modified file 'bzrlib/_knit_load_data_pyx.pyx' | |||
467 | --- bzrlib/_knit_load_data_pyx.pyx 2010-01-04 23:13:20 +0000 | |||
468 | +++ bzrlib/_knit_load_data_pyx.pyx 2010-04-06 07:24:41 +0000 | |||
469 | @@ -1,4 +1,4 @@ | |||
471 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
472 | 2 | # | 2 | # |
473 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
474 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
475 | 5 | 5 | ||
476 | === modified file 'bzrlib/_known_graph_py.py' | |||
477 | --- bzrlib/_known_graph_py.py 2009-11-30 17:25:22 +0000 | |||
478 | +++ bzrlib/_known_graph_py.py 2010-04-06 07:24:41 +0000 | |||
479 | @@ -1,4 +1,4 @@ | |||
481 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
482 | 2 | # | 2 | # |
483 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
484 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
485 | 5 | 5 | ||
486 | === modified file 'bzrlib/_known_graph_pyx.pyx' | |||
487 | --- bzrlib/_known_graph_pyx.pyx 2010-01-05 05:09:45 +0000 | |||
488 | +++ bzrlib/_known_graph_pyx.pyx 2010-04-06 07:24:41 +0000 | |||
489 | @@ -1,4 +1,4 @@ | |||
491 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
492 | 2 | # | 2 | # |
493 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
494 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
495 | 5 | 5 | ||
496 | === modified file 'bzrlib/_readdir_pyx.pyx' | |||
497 | --- bzrlib/_readdir_pyx.pyx 2010-01-06 22:17:10 +0000 | |||
498 | +++ bzrlib/_readdir_pyx.pyx 2010-04-06 07:24:41 +0000 | |||
499 | @@ -1,4 +1,4 @@ | |||
501 | 1 | # Copyright (C) 2006, 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2006, 2008, 2009, 2010 Canonical Ltd |
502 | 2 | # | 2 | # |
503 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
504 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
505 | 5 | 5 | ||
506 | === modified file 'bzrlib/_rio_pyx.pyx' | |||
507 | --- bzrlib/_rio_pyx.pyx 2010-01-05 04:59:57 +0000 | |||
508 | +++ bzrlib/_rio_pyx.pyx 2010-04-06 07:24:41 +0000 | |||
509 | @@ -1,4 +1,4 @@ | |||
511 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
512 | 2 | # | 2 | # |
513 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
514 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
515 | 5 | 5 | ||
516 | === modified file 'bzrlib/_simple_set_pyx.pxd' | |||
517 | --- bzrlib/_simple_set_pyx.pxd 2010-01-05 05:28:42 +0000 | |||
518 | +++ bzrlib/_simple_set_pyx.pxd 2010-04-06 07:24:41 +0000 | |||
519 | @@ -1,4 +1,4 @@ | |||
521 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
522 | 2 | # | 2 | # |
523 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
524 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
525 | 5 | 5 | ||
526 | === modified file 'bzrlib/_simple_set_pyx.pyx' | |||
527 | --- bzrlib/_simple_set_pyx.pyx 2010-01-05 05:28:42 +0000 | |||
528 | +++ bzrlib/_simple_set_pyx.pyx 2010-04-06 07:24:41 +0000 | |||
529 | @@ -1,4 +1,4 @@ | |||
531 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
532 | 2 | # | 2 | # |
533 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
534 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
535 | 5 | 5 | ||
536 | === modified file 'bzrlib/_static_tuple_c.c' | |||
537 | --- bzrlib/_static_tuple_c.c 2010-02-18 01:10:16 +0000 | |||
538 | +++ bzrlib/_static_tuple_c.c 2010-04-06 07:24:41 +0000 | |||
539 | @@ -1,4 +1,4 @@ | |||
541 | 1 | /* Copyright (C) 2009 Canonical Ltd | 1 | /* Copyright (C) 2009, 2010 Canonical Ltd |
542 | 2 | * | 2 | * |
543 | 3 | * This program is free software; you can redistribute it and/or modify | 3 | * This program is free software; you can redistribute it and/or modify |
544 | 4 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
545 | 5 | 5 | ||
546 | === modified file 'bzrlib/_static_tuple_c.pxd' | |||
547 | --- bzrlib/_static_tuple_c.pxd 2009-10-21 21:27:19 +0000 | |||
548 | +++ bzrlib/_static_tuple_c.pxd 2010-04-06 07:24:41 +0000 | |||
549 | @@ -1,4 +1,4 @@ | |||
551 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
552 | 2 | # | 2 | # |
553 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
554 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
555 | 5 | 5 | ||
556 | === modified file 'bzrlib/_static_tuple_py.py' | |||
557 | --- bzrlib/_static_tuple_py.py 2010-02-18 01:10:16 +0000 | |||
558 | +++ bzrlib/_static_tuple_py.py 2010-04-06 07:24:41 +0000 | |||
559 | @@ -1,4 +1,4 @@ | |||
561 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
562 | 2 | # | 2 | # |
563 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
564 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
565 | 5 | 5 | ||
566 | === modified file 'bzrlib/_walkdirs_win32.pyx' | |||
567 | --- bzrlib/_walkdirs_win32.pyx 2010-01-07 17:02:44 +0000 | |||
568 | +++ bzrlib/_walkdirs_win32.pyx 2010-04-06 07:24:41 +0000 | |||
569 | @@ -1,4 +1,4 @@ | |||
571 | 1 | # Copyright (C) 2008 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
572 | 2 | # | 2 | # |
573 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
574 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
575 | 5 | 5 | ||
576 | === modified file 'bzrlib/atomicfile.py' | |||
577 | --- bzrlib/atomicfile.py 2009-03-23 14:59:43 +0000 | |||
578 | +++ bzrlib/atomicfile.py 2010-04-06 07:24:41 +0000 | |||
579 | @@ -60,7 +60,7 @@ | |||
580 | 60 | 60 | ||
581 | 61 | self.realfilename = filename | 61 | self.realfilename = filename |
582 | 62 | 62 | ||
584 | 63 | flags = os.O_EXCL | os.O_CREAT | os.O_WRONLY | 63 | flags = os.O_EXCL | os.O_CREAT | os.O_WRONLY | osutils.O_NOINHERIT |
585 | 64 | if mode == 'wb': | 64 | if mode == 'wb': |
586 | 65 | flags |= osutils.O_BINARY | 65 | flags |= osutils.O_BINARY |
587 | 66 | elif mode != 'wt': | 66 | elif mode != 'wt': |
588 | 67 | 67 | ||
589 | === modified file 'bzrlib/benchmarks/bench_dirstate.py' | |||
590 | --- bzrlib/benchmarks/bench_dirstate.py 2009-12-22 17:05:47 +0000 | |||
591 | +++ bzrlib/benchmarks/bench_dirstate.py 2010-04-06 07:24:41 +0000 | |||
592 | @@ -1,4 +1,4 @@ | |||
594 | 1 | # Copyright (C) 2007, 2009 Canonical Ltd | 1 | # Copyright (C) 2007, 2009, 2010 Canonical Ltd |
595 | 2 | # | 2 | # |
596 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
597 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
598 | 5 | 5 | ||
599 | === modified file 'bzrlib/benchmarks/tree_creator/kernel_like.py' | |||
600 | --- bzrlib/benchmarks/tree_creator/kernel_like.py 2009-03-23 14:59:43 +0000 | |||
601 | +++ bzrlib/benchmarks/tree_creator/kernel_like.py 2010-04-06 07:24:41 +0000 | |||
602 | @@ -48,7 +48,8 @@ | |||
603 | 48 | if self._url is not None: | 48 | if self._url is not None: |
604 | 49 | b = bzrdir.BzrDir.create_branch_convenience(self._url) | 49 | b = bzrdir.BzrDir.create_branch_convenience(self._url) |
605 | 50 | d = bzrdir.BzrDir.create(root) | 50 | d = bzrdir.BzrDir.create(root) |
607 | 51 | bzrlib.branch.BranchReferenceFormat().initialize(d, b) | 51 | bzrlib.branch.BranchReferenceFormat().initialize(d, |
608 | 52 | target_branch=b) | ||
609 | 52 | tree = d.create_workingtree() | 53 | tree = d.create_workingtree() |
610 | 53 | else: | 54 | else: |
611 | 54 | tree = bzrdir.BzrDir.create_standalone_workingtree(root) | 55 | tree = bzrdir.BzrDir.create_standalone_workingtree(root) |
612 | 55 | 56 | ||
613 | === modified file 'bzrlib/branch.py' | |||
614 | --- bzrlib/branch.py 2010-01-12 02:48:41 +0000 | |||
615 | +++ bzrlib/branch.py 2010-04-06 07:24:41 +0000 | |||
616 | @@ -1,4 +1,4 @@ | |||
618 | 1 | # Copyright (C) 2005, 2006, 2007, 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
619 | 2 | # | 2 | # |
620 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
621 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
622 | @@ -167,13 +167,13 @@ | |||
623 | 167 | """ | 167 | """ |
624 | 168 | control = bzrdir.BzrDir.open(base, _unsupported, | 168 | control = bzrdir.BzrDir.open(base, _unsupported, |
625 | 169 | possible_transports=possible_transports) | 169 | possible_transports=possible_transports) |
627 | 170 | return control.open_branch(_unsupported) | 170 | return control.open_branch(unsupported=_unsupported) |
628 | 171 | 171 | ||
629 | 172 | @staticmethod | 172 | @staticmethod |
631 | 173 | def open_from_transport(transport, _unsupported=False): | 173 | def open_from_transport(transport, name=None, _unsupported=False): |
632 | 174 | """Open the branch rooted at transport""" | 174 | """Open the branch rooted at transport""" |
633 | 175 | control = bzrdir.BzrDir.open_from_transport(transport, _unsupported) | 175 | control = bzrdir.BzrDir.open_from_transport(transport, _unsupported) |
635 | 176 | return control.open_branch(_unsupported) | 176 | return control.open_branch(name=name, unsupported=_unsupported) |
636 | 177 | 177 | ||
637 | 178 | @staticmethod | 178 | @staticmethod |
638 | 179 | def open_containing(url, possible_transports=None): | 179 | def open_containing(url, possible_transports=None): |
639 | @@ -217,9 +217,9 @@ | |||
640 | 217 | def _get_fallback_repository(self, url): | 217 | def _get_fallback_repository(self, url): |
641 | 218 | """Get the repository we fallback to at url.""" | 218 | """Get the repository we fallback to at url.""" |
642 | 219 | url = urlutils.join(self.base, url) | 219 | url = urlutils.join(self.base, url) |
644 | 220 | a_bzrdir = bzrdir.BzrDir.open(url, | 220 | a_branch = Branch.open(url, |
645 | 221 | possible_transports=[self.bzrdir.root_transport]) | 221 | possible_transports=[self.bzrdir.root_transport]) |
647 | 222 | return a_bzrdir.open_branch().repository | 222 | return a_branch.repository |
648 | 223 | 223 | ||
649 | 224 | def _get_tags_bytes(self): | 224 | def _get_tags_bytes(self): |
650 | 225 | """Get the bytes of a serialised tags dict. | 225 | """Get the bytes of a serialised tags dict. |
651 | @@ -1317,7 +1317,8 @@ | |||
652 | 1317 | if lightweight: | 1317 | if lightweight: |
653 | 1318 | format = self._get_checkout_format() | 1318 | format = self._get_checkout_format() |
654 | 1319 | checkout = format.initialize_on_transport(t) | 1319 | checkout = format.initialize_on_transport(t) |
656 | 1320 | from_branch = BranchReferenceFormat().initialize(checkout, self) | 1320 | from_branch = BranchReferenceFormat().initialize(checkout, |
657 | 1321 | target_branch=self) | ||
658 | 1321 | else: | 1322 | else: |
659 | 1322 | format = self._get_checkout_format() | 1323 | format = self._get_checkout_format() |
660 | 1323 | checkout_branch = bzrdir.BzrDir.create_branch_convenience( | 1324 | checkout_branch = bzrdir.BzrDir.create_branch_convenience( |
661 | @@ -1434,10 +1435,10 @@ | |||
662 | 1434 | return not (self == other) | 1435 | return not (self == other) |
663 | 1435 | 1436 | ||
664 | 1436 | @classmethod | 1437 | @classmethod |
666 | 1437 | def find_format(klass, a_bzrdir): | 1438 | def find_format(klass, a_bzrdir, name=None): |
667 | 1438 | """Return the format for the branch object in a_bzrdir.""" | 1439 | """Return the format for the branch object in a_bzrdir.""" |
668 | 1439 | try: | 1440 | try: |
670 | 1440 | transport = a_bzrdir.get_branch_transport(None) | 1441 | transport = a_bzrdir.get_branch_transport(None, name=name) |
671 | 1441 | format_string = transport.get_bytes("format") | 1442 | format_string = transport.get_bytes("format") |
672 | 1442 | return klass._formats[format_string] | 1443 | return klass._formats[format_string] |
673 | 1443 | except errors.NoSuchFile: | 1444 | except errors.NoSuchFile: |
674 | @@ -1483,20 +1484,21 @@ | |||
675 | 1483 | """Return the short format description for this format.""" | 1484 | """Return the short format description for this format.""" |
676 | 1484 | raise NotImplementedError(self.get_format_description) | 1485 | raise NotImplementedError(self.get_format_description) |
677 | 1485 | 1486 | ||
680 | 1486 | def _initialize_helper(self, a_bzrdir, utf8_files, lock_type='metadir', | 1487 | def _initialize_helper(self, a_bzrdir, utf8_files, name=None, |
681 | 1487 | set_format=True): | 1488 | lock_type='metadir', set_format=True): |
682 | 1488 | """Initialize a branch in a bzrdir, with specified files | 1489 | """Initialize a branch in a bzrdir, with specified files |
683 | 1489 | 1490 | ||
684 | 1490 | :param a_bzrdir: The bzrdir to initialize the branch in | 1491 | :param a_bzrdir: The bzrdir to initialize the branch in |
685 | 1491 | :param utf8_files: The files to create as a list of | 1492 | :param utf8_files: The files to create as a list of |
686 | 1492 | (filename, content) tuples | 1493 | (filename, content) tuples |
687 | 1494 | :param name: Name of colocated branch to create, if any | ||
688 | 1493 | :param set_format: If True, set the format with | 1495 | :param set_format: If True, set the format with |
689 | 1494 | self.get_format_string. (BzrBranch4 has its format set | 1496 | self.get_format_string. (BzrBranch4 has its format set |
690 | 1495 | elsewhere) | 1497 | elsewhere) |
691 | 1496 | :return: a branch in this format | 1498 | :return: a branch in this format |
692 | 1497 | """ | 1499 | """ |
693 | 1498 | mutter('creating branch %r in %s', self, a_bzrdir.transport.base) | 1500 | mutter('creating branch %r in %s', self, a_bzrdir.transport.base) |
695 | 1499 | branch_transport = a_bzrdir.get_branch_transport(self) | 1501 | branch_transport = a_bzrdir.get_branch_transport(self, name=name) |
696 | 1500 | lock_map = { | 1502 | lock_map = { |
697 | 1501 | 'metadir': ('lock', lockdir.LockDir), | 1503 | 'metadir': ('lock', lockdir.LockDir), |
698 | 1502 | 'branch4': ('branch-lock', lockable_files.TransportLock), | 1504 | 'branch4': ('branch-lock', lockable_files.TransportLock), |
699 | @@ -1523,10 +1525,13 @@ | |||
700 | 1523 | finally: | 1525 | finally: |
701 | 1524 | if lock_taken: | 1526 | if lock_taken: |
702 | 1525 | control_files.unlock() | 1527 | control_files.unlock() |
704 | 1526 | return self.open(a_bzrdir, _found=True) | 1528 | return self.open(a_bzrdir, name, _found=True) |
705 | 1527 | 1529 | ||
708 | 1528 | def initialize(self, a_bzrdir): | 1530 | def initialize(self, a_bzrdir, name=None): |
709 | 1529 | """Create a branch of this format in a_bzrdir.""" | 1531 | """Create a branch of this format in a_bzrdir. |
710 | 1532 | |||
711 | 1533 | :param name: Name of the colocated branch to create. | ||
712 | 1534 | """ | ||
713 | 1530 | raise NotImplementedError(self.initialize) | 1535 | raise NotImplementedError(self.initialize) |
714 | 1531 | 1536 | ||
715 | 1532 | def is_supported(self): | 1537 | def is_supported(self): |
716 | @@ -1562,10 +1567,11 @@ | |||
717 | 1562 | """ | 1567 | """ |
718 | 1563 | raise NotImplementedError(self.network_name) | 1568 | raise NotImplementedError(self.network_name) |
719 | 1564 | 1569 | ||
721 | 1565 | def open(self, a_bzrdir, _found=False, ignore_fallbacks=False): | 1570 | def open(self, a_bzrdir, name=None, _found=False, ignore_fallbacks=False): |
722 | 1566 | """Return the branch object for a_bzrdir | 1571 | """Return the branch object for a_bzrdir |
723 | 1567 | 1572 | ||
724 | 1568 | :param a_bzrdir: A BzrDir that contains a branch. | 1573 | :param a_bzrdir: A BzrDir that contains a branch. |
725 | 1574 | :param name: Name of colocated branch to open | ||
726 | 1569 | :param _found: a private parameter, do not use it. It is used to | 1575 | :param _found: a private parameter, do not use it. It is used to |
727 | 1570 | indicate if format probing has already be done. | 1576 | indicate if format probing has already be done. |
728 | 1571 | :param ignore_fallbacks: when set, no fallback branches will be opened | 1577 | :param ignore_fallbacks: when set, no fallback branches will be opened |
729 | @@ -1735,12 +1741,12 @@ | |||
730 | 1735 | """See BranchFormat.get_format_description().""" | 1741 | """See BranchFormat.get_format_description().""" |
731 | 1736 | return "Branch format 4" | 1742 | return "Branch format 4" |
732 | 1737 | 1743 | ||
734 | 1738 | def initialize(self, a_bzrdir): | 1744 | def initialize(self, a_bzrdir, name=None): |
735 | 1739 | """Create a branch of this format in a_bzrdir.""" | 1745 | """Create a branch of this format in a_bzrdir.""" |
736 | 1740 | utf8_files = [('revision-history', ''), | 1746 | utf8_files = [('revision-history', ''), |
737 | 1741 | ('branch-name', ''), | 1747 | ('branch-name', ''), |
738 | 1742 | ] | 1748 | ] |
740 | 1743 | return self._initialize_helper(a_bzrdir, utf8_files, | 1749 | return self._initialize_helper(a_bzrdir, utf8_files, name=name, |
741 | 1744 | lock_type='branch4', set_format=False) | 1750 | lock_type='branch4', set_format=False) |
742 | 1745 | 1751 | ||
743 | 1746 | def __init__(self): | 1752 | def __init__(self): |
744 | @@ -1751,8 +1757,10 @@ | |||
745 | 1751 | """The network name for this format is the control dirs disk label.""" | 1757 | """The network name for this format is the control dirs disk label.""" |
746 | 1752 | return self._matchingbzrdir.get_format_string() | 1758 | return self._matchingbzrdir.get_format_string() |
747 | 1753 | 1759 | ||
749 | 1754 | def open(self, a_bzrdir, _found=False, ignore_fallbacks=False): | 1760 | def open(self, a_bzrdir, name=None, _found=False, ignore_fallbacks=False): |
750 | 1755 | """See BranchFormat.open().""" | 1761 | """See BranchFormat.open().""" |
751 | 1762 | if name is not None: | ||
752 | 1763 | raise errors.NoColocatedBranchSupport(a_bzrdir) | ||
753 | 1756 | if not _found: | 1764 | if not _found: |
754 | 1757 | # we are being called directly and must probe. | 1765 | # we are being called directly and must probe. |
755 | 1758 | raise NotImplementedError | 1766 | raise NotImplementedError |
756 | @@ -1779,15 +1787,15 @@ | |||
757 | 1779 | """ | 1787 | """ |
758 | 1780 | return self.get_format_string() | 1788 | return self.get_format_string() |
759 | 1781 | 1789 | ||
761 | 1782 | def open(self, a_bzrdir, _found=False, ignore_fallbacks=False): | 1790 | def open(self, a_bzrdir, name=None, _found=False, ignore_fallbacks=False): |
762 | 1783 | """See BranchFormat.open().""" | 1791 | """See BranchFormat.open().""" |
763 | 1784 | if not _found: | 1792 | if not _found: |
765 | 1785 | format = BranchFormat.find_format(a_bzrdir) | 1793 | format = BranchFormat.find_format(a_bzrdir, name=name) |
766 | 1786 | if format.__class__ != self.__class__: | 1794 | if format.__class__ != self.__class__: |
767 | 1787 | raise AssertionError("wrong format %r found for %r" % | 1795 | raise AssertionError("wrong format %r found for %r" % |
768 | 1788 | (format, self)) | 1796 | (format, self)) |
769 | 1789 | try: | 1797 | try: |
771 | 1790 | transport = a_bzrdir.get_branch_transport(None) | 1798 | transport = a_bzrdir.get_branch_transport(None, name=name) |
772 | 1791 | control_files = lockable_files.LockableFiles(transport, 'lock', | 1799 | control_files = lockable_files.LockableFiles(transport, 'lock', |
773 | 1792 | lockdir.LockDir) | 1800 | lockdir.LockDir) |
774 | 1793 | return self._branch_class()(_format=self, | 1801 | return self._branch_class()(_format=self, |
775 | @@ -1831,12 +1839,12 @@ | |||
776 | 1831 | """See BranchFormat.get_format_description().""" | 1839 | """See BranchFormat.get_format_description().""" |
777 | 1832 | return "Branch format 5" | 1840 | return "Branch format 5" |
778 | 1833 | 1841 | ||
780 | 1834 | def initialize(self, a_bzrdir): | 1842 | def initialize(self, a_bzrdir, name=None): |
781 | 1835 | """Create a branch of this format in a_bzrdir.""" | 1843 | """Create a branch of this format in a_bzrdir.""" |
782 | 1836 | utf8_files = [('revision-history', ''), | 1844 | utf8_files = [('revision-history', ''), |
783 | 1837 | ('branch-name', ''), | 1845 | ('branch-name', ''), |
784 | 1838 | ] | 1846 | ] |
786 | 1839 | return self._initialize_helper(a_bzrdir, utf8_files) | 1847 | return self._initialize_helper(a_bzrdir, utf8_files, name) |
787 | 1840 | 1848 | ||
788 | 1841 | def supports_tags(self): | 1849 | def supports_tags(self): |
789 | 1842 | return False | 1850 | return False |
790 | @@ -1864,13 +1872,13 @@ | |||
791 | 1864 | """See BranchFormat.get_format_description().""" | 1872 | """See BranchFormat.get_format_description().""" |
792 | 1865 | return "Branch format 6" | 1873 | return "Branch format 6" |
793 | 1866 | 1874 | ||
795 | 1867 | def initialize(self, a_bzrdir): | 1875 | def initialize(self, a_bzrdir, name=None): |
796 | 1868 | """Create a branch of this format in a_bzrdir.""" | 1876 | """Create a branch of this format in a_bzrdir.""" |
797 | 1869 | utf8_files = [('last-revision', '0 null:\n'), | 1877 | utf8_files = [('last-revision', '0 null:\n'), |
798 | 1870 | ('branch.conf', ''), | 1878 | ('branch.conf', ''), |
799 | 1871 | ('tags', ''), | 1879 | ('tags', ''), |
800 | 1872 | ] | 1880 | ] |
802 | 1873 | return self._initialize_helper(a_bzrdir, utf8_files) | 1881 | return self._initialize_helper(a_bzrdir, utf8_files, name) |
803 | 1874 | 1882 | ||
804 | 1875 | def make_tags(self, branch): | 1883 | def make_tags(self, branch): |
805 | 1876 | """See bzrlib.branch.BranchFormat.make_tags().""" | 1884 | """See bzrlib.branch.BranchFormat.make_tags().""" |
806 | @@ -1894,14 +1902,14 @@ | |||
807 | 1894 | """See BranchFormat.get_format_description().""" | 1902 | """See BranchFormat.get_format_description().""" |
808 | 1895 | return "Branch format 8" | 1903 | return "Branch format 8" |
809 | 1896 | 1904 | ||
811 | 1897 | def initialize(self, a_bzrdir): | 1905 | def initialize(self, a_bzrdir, name=None): |
812 | 1898 | """Create a branch of this format in a_bzrdir.""" | 1906 | """Create a branch of this format in a_bzrdir.""" |
813 | 1899 | utf8_files = [('last-revision', '0 null:\n'), | 1907 | utf8_files = [('last-revision', '0 null:\n'), |
814 | 1900 | ('branch.conf', ''), | 1908 | ('branch.conf', ''), |
815 | 1901 | ('tags', ''), | 1909 | ('tags', ''), |
816 | 1902 | ('references', '') | 1910 | ('references', '') |
817 | 1903 | ] | 1911 | ] |
819 | 1904 | return self._initialize_helper(a_bzrdir, utf8_files) | 1912 | return self._initialize_helper(a_bzrdir, utf8_files, name) |
820 | 1905 | 1913 | ||
821 | 1906 | def __init__(self): | 1914 | def __init__(self): |
822 | 1907 | super(BzrBranchFormat8, self).__init__() | 1915 | super(BzrBranchFormat8, self).__init__() |
823 | @@ -1930,13 +1938,13 @@ | |||
824 | 1930 | This format was introduced in bzr 1.6. | 1938 | This format was introduced in bzr 1.6. |
825 | 1931 | """ | 1939 | """ |
826 | 1932 | 1940 | ||
828 | 1933 | def initialize(self, a_bzrdir): | 1941 | def initialize(self, a_bzrdir, name=None): |
829 | 1934 | """Create a branch of this format in a_bzrdir.""" | 1942 | """Create a branch of this format in a_bzrdir.""" |
830 | 1935 | utf8_files = [('last-revision', '0 null:\n'), | 1943 | utf8_files = [('last-revision', '0 null:\n'), |
831 | 1936 | ('branch.conf', ''), | 1944 | ('branch.conf', ''), |
832 | 1937 | ('tags', ''), | 1945 | ('tags', ''), |
833 | 1938 | ] | 1946 | ] |
835 | 1939 | return self._initialize_helper(a_bzrdir, utf8_files) | 1947 | return self._initialize_helper(a_bzrdir, utf8_files, name) |
836 | 1940 | 1948 | ||
837 | 1941 | def _branch_class(self): | 1949 | def _branch_class(self): |
838 | 1942 | return BzrBranch7 | 1950 | return BzrBranch7 |
839 | @@ -1984,19 +1992,19 @@ | |||
840 | 1984 | transport = a_bzrdir.get_branch_transport(None) | 1992 | transport = a_bzrdir.get_branch_transport(None) |
841 | 1985 | location = transport.put_bytes('location', to_branch.base) | 1993 | location = transport.put_bytes('location', to_branch.base) |
842 | 1986 | 1994 | ||
844 | 1987 | def initialize(self, a_bzrdir, target_branch=None): | 1995 | def initialize(self, a_bzrdir, name=None, target_branch=None): |
845 | 1988 | """Create a branch of this format in a_bzrdir.""" | 1996 | """Create a branch of this format in a_bzrdir.""" |
846 | 1989 | if target_branch is None: | 1997 | if target_branch is None: |
847 | 1990 | # this format does not implement branch itself, thus the implicit | 1998 | # this format does not implement branch itself, thus the implicit |
848 | 1991 | # creation contract must see it as uninitializable | 1999 | # creation contract must see it as uninitializable |
849 | 1992 | raise errors.UninitializableFormat(self) | 2000 | raise errors.UninitializableFormat(self) |
850 | 1993 | mutter('creating branch reference in %s', a_bzrdir.transport.base) | 2001 | mutter('creating branch reference in %s', a_bzrdir.transport.base) |
852 | 1994 | branch_transport = a_bzrdir.get_branch_transport(self) | 2002 | branch_transport = a_bzrdir.get_branch_transport(self, name=name) |
853 | 1995 | branch_transport.put_bytes('location', | 2003 | branch_transport.put_bytes('location', |
854 | 1996 | target_branch.bzrdir.root_transport.base) | 2004 | target_branch.bzrdir.root_transport.base) |
855 | 1997 | branch_transport.put_bytes('format', self.get_format_string()) | 2005 | branch_transport.put_bytes('format', self.get_format_string()) |
856 | 1998 | return self.open( | 2006 | return self.open( |
858 | 1999 | a_bzrdir, _found=True, | 2007 | a_bzrdir, name, _found=True, |
859 | 2000 | possible_transports=[target_branch.bzrdir.root_transport]) | 2008 | possible_transports=[target_branch.bzrdir.root_transport]) |
860 | 2001 | 2009 | ||
861 | 2002 | def __init__(self): | 2010 | def __init__(self): |
862 | @@ -2009,17 +2017,18 @@ | |||
863 | 2009 | def clone(to_bzrdir, revision_id=None, | 2017 | def clone(to_bzrdir, revision_id=None, |
864 | 2010 | repository_policy=None): | 2018 | repository_policy=None): |
865 | 2011 | """See Branch.clone().""" | 2019 | """See Branch.clone().""" |
867 | 2012 | return format.initialize(to_bzrdir, a_branch) | 2020 | return format.initialize(to_bzrdir, target_branch=a_branch) |
868 | 2013 | # cannot obey revision_id limits when cloning a reference ... | 2021 | # cannot obey revision_id limits when cloning a reference ... |
869 | 2014 | # FIXME RBC 20060210 either nuke revision_id for clone, or | 2022 | # FIXME RBC 20060210 either nuke revision_id for clone, or |
870 | 2015 | # emit some sort of warning/error to the caller ?! | 2023 | # emit some sort of warning/error to the caller ?! |
871 | 2016 | return clone | 2024 | return clone |
872 | 2017 | 2025 | ||
874 | 2018 | def open(self, a_bzrdir, _found=False, location=None, | 2026 | def open(self, a_bzrdir, name=None, _found=False, location=None, |
875 | 2019 | possible_transports=None, ignore_fallbacks=False): | 2027 | possible_transports=None, ignore_fallbacks=False): |
876 | 2020 | """Return the branch that the branch reference in a_bzrdir points at. | 2028 | """Return the branch that the branch reference in a_bzrdir points at. |
877 | 2021 | 2029 | ||
878 | 2022 | :param a_bzrdir: A BzrDir that contains a branch. | 2030 | :param a_bzrdir: A BzrDir that contains a branch. |
879 | 2031 | :param name: Name of colocated branch to open, if any | ||
880 | 2023 | :param _found: a private parameter, do not use it. It is used to | 2032 | :param _found: a private parameter, do not use it. It is used to |
881 | 2024 | indicate if format probing has already be done. | 2033 | indicate if format probing has already be done. |
882 | 2025 | :param ignore_fallbacks: when set, no fallback branches will be opened | 2034 | :param ignore_fallbacks: when set, no fallback branches will be opened |
883 | @@ -2030,7 +2039,7 @@ | |||
884 | 2030 | :param possible_transports: An optional reusable transports list. | 2039 | :param possible_transports: An optional reusable transports list. |
885 | 2031 | """ | 2040 | """ |
886 | 2032 | if not _found: | 2041 | if not _found: |
888 | 2033 | format = BranchFormat.find_format(a_bzrdir) | 2042 | format = BranchFormat.find_format(a_bzrdir, name=name) |
889 | 2034 | if format.__class__ != self.__class__: | 2043 | if format.__class__ != self.__class__: |
890 | 2035 | raise AssertionError("wrong format %r found for %r" % | 2044 | raise AssertionError("wrong format %r found for %r" % |
891 | 2036 | (format, self)) | 2045 | (format, self)) |
892 | @@ -2038,7 +2047,8 @@ | |||
893 | 2038 | location = self.get_reference(a_bzrdir) | 2047 | location = self.get_reference(a_bzrdir) |
894 | 2039 | real_bzrdir = bzrdir.BzrDir.open( | 2048 | real_bzrdir = bzrdir.BzrDir.open( |
895 | 2040 | location, possible_transports=possible_transports) | 2049 | location, possible_transports=possible_transports) |
897 | 2041 | result = real_bzrdir.open_branch(ignore_fallbacks=ignore_fallbacks) | 2050 | result = real_bzrdir.open_branch(name=name, |
898 | 2051 | ignore_fallbacks=ignore_fallbacks) | ||
899 | 2042 | # this changes the behaviour of result.clone to create a new reference | 2052 | # this changes the behaviour of result.clone to create a new reference |
900 | 2043 | # rather than a copy of the content of the branch. | 2053 | # rather than a copy of the content of the branch. |
901 | 2044 | # I did not use a proxy object because that needs much more extensive | 2054 | # I did not use a proxy object because that needs much more extensive |
902 | 2045 | 2055 | ||
903 | === modified file 'bzrlib/branchbuilder.py' | |||
904 | --- bzrlib/branchbuilder.py 2009-08-05 02:12:22 +0000 | |||
905 | +++ bzrlib/branchbuilder.py 2010-04-06 07:24:41 +0000 | |||
906 | @@ -103,11 +103,11 @@ | |||
907 | 103 | finally: | 103 | finally: |
908 | 104 | tree.unlock() | 104 | tree.unlock() |
909 | 105 | 105 | ||
911 | 106 | def _do_commit(self, tree, message=None, **kwargs): | 106 | def _do_commit(self, tree, message=None, message_callback=None, **kwargs): |
912 | 107 | reporter = commit.NullCommitReporter() | 107 | reporter = commit.NullCommitReporter() |
914 | 108 | if message is None: | 108 | if message is None and message_callback is None: |
915 | 109 | message = u'commit %d' % (self._branch.revno() + 1,) | 109 | message = u'commit %d' % (self._branch.revno() + 1,) |
917 | 110 | return tree.commit(message, | 110 | return tree.commit(message, message_callback=message_callback, |
918 | 111 | reporter=reporter, | 111 | reporter=reporter, |
919 | 112 | **kwargs) | 112 | **kwargs) |
920 | 113 | 113 | ||
921 | @@ -162,7 +162,7 @@ | |||
922 | 162 | 162 | ||
923 | 163 | def build_snapshot(self, revision_id, parent_ids, actions, | 163 | def build_snapshot(self, revision_id, parent_ids, actions, |
924 | 164 | message=None, timestamp=None, allow_leftmost_as_ghost=False, | 164 | message=None, timestamp=None, allow_leftmost_as_ghost=False, |
926 | 165 | committer=None, timezone=None): | 165 | committer=None, timezone=None, message_callback=None): |
927 | 166 | """Build a commit, shaped in a specific way. | 166 | """Build a commit, shaped in a specific way. |
928 | 167 | 167 | ||
929 | 168 | :param revision_id: The handle for the new commit, can be None | 168 | :param revision_id: The handle for the new commit, can be None |
930 | @@ -175,6 +175,8 @@ | |||
931 | 175 | ('rename', ('orig-path', 'new-path')) | 175 | ('rename', ('orig-path', 'new-path')) |
932 | 176 | :param message: An optional commit message, if not supplied, a default | 176 | :param message: An optional commit message, if not supplied, a default |
933 | 177 | commit message will be written. | 177 | commit message will be written. |
934 | 178 | :param message_callback: A message callback to use for the commit, as | ||
935 | 179 | per mutabletree.commit. | ||
936 | 178 | :param timestamp: If non-None, set the timestamp of the commit to this | 180 | :param timestamp: If non-None, set the timestamp of the commit to this |
937 | 179 | value. | 181 | value. |
938 | 180 | :param timezone: An optional timezone for timestamp. | 182 | :param timezone: An optional timezone for timestamp. |
939 | @@ -244,7 +246,8 @@ | |||
940 | 244 | for file_id, content in new_contents.iteritems(): | 246 | for file_id, content in new_contents.iteritems(): |
941 | 245 | tree.put_file_bytes_non_atomic(file_id, content) | 247 | tree.put_file_bytes_non_atomic(file_id, content) |
942 | 246 | return self._do_commit(tree, message=message, rev_id=revision_id, | 248 | return self._do_commit(tree, message=message, rev_id=revision_id, |
944 | 247 | timestamp=timestamp, timezone=timezone, committer=committer) | 249 | timestamp=timestamp, timezone=timezone, committer=committer, |
945 | 250 | message_callback=message_callback) | ||
946 | 248 | finally: | 251 | finally: |
947 | 249 | tree.unlock() | 252 | tree.unlock() |
948 | 250 | 253 | ||
949 | 251 | 254 | ||
950 | === modified file 'bzrlib/btree_index.py' | |||
951 | --- bzrlib/btree_index.py 2009-11-07 01:58:11 +0000 | |||
952 | +++ bzrlib/btree_index.py 2010-04-06 07:24:41 +0000 | |||
953 | @@ -1,4 +1,4 @@ | |||
955 | 1 | # Copyright (C) 2008 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
956 | 2 | # | 2 | # |
957 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
958 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
959 | 5 | 5 | ||
960 | === modified file 'bzrlib/bugtracker.py' | |||
961 | --- bzrlib/bugtracker.py 2010-01-08 07:37:25 +0000 | |||
962 | +++ bzrlib/bugtracker.py 2010-04-06 07:24:41 +0000 | |||
963 | @@ -1,4 +1,4 @@ | |||
965 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
966 | 2 | # | 2 | # |
967 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
968 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
969 | 5 | 5 | ||
970 | === modified file 'bzrlib/builtins.py' | |||
971 | --- bzrlib/builtins.py 2010-02-15 20:23:34 +0000 | |||
972 | +++ bzrlib/builtins.py 2010-04-06 07:24:41 +0000 | |||
973 | @@ -699,10 +699,15 @@ | |||
974 | 699 | 699 | ||
975 | 700 | def run(self, dir_list): | 700 | def run(self, dir_list): |
976 | 701 | for d in dir_list: | 701 | for d in dir_list: |
977 | 702 | os.mkdir(d) | ||
978 | 703 | wt, dd = WorkingTree.open_containing(d) | 702 | wt, dd = WorkingTree.open_containing(d) |
981 | 704 | wt.add([dd]) | 703 | base = os.path.dirname(dd) |
982 | 705 | self.outf.write('added %s\n' % d) | 704 | id = wt.path2id(base) |
983 | 705 | if id != None: | ||
984 | 706 | os.mkdir(d) | ||
985 | 707 | wt.add([dd]) | ||
986 | 708 | self.outf.write('added %s\n' % d) | ||
987 | 709 | else: | ||
988 | 710 | raise errors.NotVersionedError(path=base) | ||
989 | 706 | 711 | ||
990 | 707 | 712 | ||
991 | 708 | class cmd_relpath(Command): | 713 | class cmd_relpath(Command): |
992 | @@ -2684,7 +2689,7 @@ | |||
993 | 2684 | if old_default_rules is not None: | 2689 | if old_default_rules is not None: |
994 | 2685 | # dump the rules and exit | 2690 | # dump the rules and exit |
995 | 2686 | for pattern in ignores.OLD_DEFAULTS: | 2691 | for pattern in ignores.OLD_DEFAULTS: |
997 | 2687 | print pattern | 2692 | self.outf.write("%s\n" % pattern) |
998 | 2688 | return | 2693 | return |
999 | 2689 | if not name_pattern_list: | 2694 | if not name_pattern_list: |
1000 | 2690 | raise errors.BzrCommandError("ignore requires at least one " | 2695 | raise errors.BzrCommandError("ignore requires at least one " |
1001 | @@ -2706,13 +2711,13 @@ | |||
1002 | 2706 | if id is not None: | 2711 | if id is not None: |
1003 | 2707 | filename = entry[0] | 2712 | filename = entry[0] |
1004 | 2708 | if ignored.match(filename): | 2713 | if ignored.match(filename): |
1006 | 2709 | matches.append(filename.encode('utf-8')) | 2714 | matches.append(filename) |
1007 | 2710 | tree.unlock() | 2715 | tree.unlock() |
1008 | 2711 | if len(matches) > 0: | 2716 | if len(matches) > 0: |
1013 | 2712 | print "Warning: the following files are version controlled and" \ | 2717 | self.outf.write("Warning: the following files are version controlled and" |
1014 | 2713 | " match your ignore pattern:\n%s" \ | 2718 | " match your ignore pattern:\n%s" |
1015 | 2714 | "\nThese files will continue to be version controlled" \ | 2719 | "\nThese files will continue to be version controlled" |
1016 | 2715 | " unless you 'bzr remove' them." % ("\n".join(matches),) | 2720 | " unless you 'bzr remove' them.\n" % ("\n".join(matches),)) |
1017 | 2716 | 2721 | ||
1018 | 2717 | 2722 | ||
1019 | 2718 | class cmd_ignored(Command): | 2723 | class cmd_ignored(Command): |
1020 | @@ -2756,9 +2761,10 @@ | |||
1021 | 2756 | try: | 2761 | try: |
1022 | 2757 | revno = int(revno) | 2762 | revno = int(revno) |
1023 | 2758 | except ValueError: | 2763 | except ValueError: |
1027 | 2759 | raise errors.BzrCommandError("not a valid revision-number: %r" % revno) | 2764 | raise errors.BzrCommandError("not a valid revision-number: %r" |
1028 | 2760 | 2765 | % revno) | |
1029 | 2761 | print WorkingTree.open_containing(u'.')[0].branch.get_rev_id(revno) | 2766 | revid = WorkingTree.open_containing(u'.')[0].branch.get_rev_id(revno) |
1030 | 2767 | self.outf.write("%s\n" % revid) | ||
1031 | 2762 | 2768 | ||
1032 | 2763 | 2769 | ||
1033 | 2764 | class cmd_export(Command): | 2770 | class cmd_export(Command): |
1034 | @@ -2800,9 +2806,12 @@ | |||
1035 | 2800 | Option('root', | 2806 | Option('root', |
1036 | 2801 | type=str, | 2807 | type=str, |
1037 | 2802 | help="Name of the root directory inside the exported file."), | 2808 | help="Name of the root directory inside the exported file."), |
1038 | 2809 | Option('per-file-timestamps', | ||
1039 | 2810 | help='Set modification time of files to that of the last ' | ||
1040 | 2811 | 'revision in which it was changed.'), | ||
1041 | 2803 | ] | 2812 | ] |
1042 | 2804 | def run(self, dest, branch_or_subdir=None, revision=None, format=None, | 2813 | def run(self, dest, branch_or_subdir=None, revision=None, format=None, |
1044 | 2805 | root=None, filters=False): | 2814 | root=None, filters=False, per_file_timestamps=False): |
1045 | 2806 | from bzrlib.export import export | 2815 | from bzrlib.export import export |
1046 | 2807 | 2816 | ||
1047 | 2808 | if branch_or_subdir is None: | 2817 | if branch_or_subdir is None: |
1048 | @@ -2815,7 +2824,8 @@ | |||
1049 | 2815 | 2824 | ||
1050 | 2816 | rev_tree = _get_one_revision_tree('export', revision, branch=b, tree=tree) | 2825 | rev_tree = _get_one_revision_tree('export', revision, branch=b, tree=tree) |
1051 | 2817 | try: | 2826 | try: |
1053 | 2818 | export(rev_tree, dest, format, root, subdir, filtered=filters) | 2827 | export(rev_tree, dest, format, root, subdir, filtered=filters, |
1054 | 2828 | per_file_timestamps=per_file_timestamps) | ||
1055 | 2819 | except errors.NoSuchExportFormat, e: | 2829 | except errors.NoSuchExportFormat, e: |
1056 | 2820 | raise errors.BzrCommandError('Unsupported export format: %s' % e.format) | 2830 | raise errors.BzrCommandError('Unsupported export format: %s' % e.format) |
1057 | 2821 | 2831 | ||
1058 | @@ -2911,7 +2921,7 @@ | |||
1059 | 2911 | hidden = True | 2921 | hidden = True |
1060 | 2912 | @display_command | 2922 | @display_command |
1061 | 2913 | def run(self): | 2923 | def run(self): |
1063 | 2914 | print osutils.local_time_offset() | 2924 | self.outf.write("%s\n" % osutils.local_time_offset()) |
1064 | 2915 | 2925 | ||
1065 | 2916 | 2926 | ||
1066 | 2917 | 2927 | ||
1067 | @@ -3168,10 +3178,11 @@ | |||
1068 | 3168 | raise errors.BzrCommandError("Commit refused because there are" | 3178 | raise errors.BzrCommandError("Commit refused because there are" |
1069 | 3169 | " unknown files in the working tree.") | 3179 | " unknown files in the working tree.") |
1070 | 3170 | except errors.BoundBranchOutOfDate, e: | 3180 | except errors.BoundBranchOutOfDate, e: |
1075 | 3171 | raise errors.BzrCommandError(str(e) + "\n" | 3181 | e.extra_help = ("\n" |
1076 | 3172 | 'To commit to master branch, run update and then commit.\n' | 3182 | 'To commit to master branch, run update and then commit.\n' |
1077 | 3173 | 'You can also pass --local to commit to continue working ' | 3183 | 'You can also pass --local to commit to continue working ' |
1078 | 3174 | 'disconnected.') | 3184 | 'disconnected.') |
1079 | 3185 | raise | ||
1080 | 3175 | 3186 | ||
1081 | 3176 | 3187 | ||
1082 | 3177 | class cmd_check(Command): | 3188 | class cmd_check(Command): |
1083 | @@ -3339,7 +3350,7 @@ | |||
1084 | 3339 | 3350 | ||
1085 | 3340 | @display_command | 3351 | @display_command |
1086 | 3341 | def printme(self, branch): | 3352 | def printme(self, branch): |
1088 | 3342 | print branch.nick | 3353 | self.outf.write('%s\n' % branch.nick) |
1089 | 3343 | 3354 | ||
1090 | 3344 | 3355 | ||
1091 | 3345 | class cmd_alias(Command): | 3356 | class cmd_alias(Command): |
1092 | @@ -3619,7 +3630,7 @@ | |||
1093 | 3619 | 3630 | ||
1094 | 3620 | @display_command | 3631 | @display_command |
1095 | 3621 | def run(self): | 3632 | def run(self): |
1097 | 3622 | print "It sure does!" | 3633 | self.outf.write("It sure does!\n") |
1098 | 3623 | 3634 | ||
1099 | 3624 | 3635 | ||
1100 | 3625 | class cmd_find_merge_base(Command): | 3636 | class cmd_find_merge_base(Command): |
1101 | @@ -3645,7 +3656,7 @@ | |||
1102 | 3645 | graph = branch1.repository.get_graph(branch2.repository) | 3656 | graph = branch1.repository.get_graph(branch2.repository) |
1103 | 3646 | base_rev_id = graph.find_unique_lca(last1, last2) | 3657 | base_rev_id = graph.find_unique_lca(last1, last2) |
1104 | 3647 | 3658 | ||
1106 | 3648 | print 'merge base is revision %s' % base_rev_id | 3659 | self.outf.write('merge base is revision %s\n' % base_rev_id) |
1107 | 3649 | 3660 | ||
1108 | 3650 | 3661 | ||
1109 | 3651 | class cmd_merge(Command): | 3662 | class cmd_merge(Command): |
1110 | @@ -4444,11 +4455,11 @@ | |||
1111 | 4444 | doc = '(no description)' | 4455 | doc = '(no description)' |
1112 | 4445 | result.append((name_ver, doc, plugin.path())) | 4456 | result.append((name_ver, doc, plugin.path())) |
1113 | 4446 | for name_ver, doc, path in sorted(result): | 4457 | for name_ver, doc, path in sorted(result): |
1116 | 4447 | print name_ver | 4458 | self.outf.write("%s\n" % name_ver) |
1117 | 4448 | print ' ', doc | 4459 | self.outf.write(" %s\n" % doc) |
1118 | 4449 | if verbose: | 4460 | if verbose: |
1121 | 4450 | print ' ', path | 4461 | self.outf.write(" %s\n" % path) |
1122 | 4451 | 4462 | self.outf.write("\n") | |
1123 | 4452 | 4463 | ||
1124 | 4453 | 4464 | ||
1125 | 4454 | class cmd_testament(Command): | 4465 | class cmd_testament(Command): |
1126 | @@ -4734,12 +4745,11 @@ | |||
1127 | 4734 | rev_id = b.get_rev_id(revno) | 4745 | rev_id = b.get_rev_id(revno) |
1128 | 4735 | 4746 | ||
1129 | 4736 | if rev_id is None or _mod_revision.is_null(rev_id): | 4747 | if rev_id is None or _mod_revision.is_null(rev_id): |
1131 | 4737 | ui.ui_factory.note('No revisions to uncommit.') | 4748 | self.outf.write('No revisions to uncommit.\n') |
1132 | 4738 | return 1 | 4749 | return 1 |
1133 | 4739 | 4750 | ||
1134 | 4740 | log_collector = ui.ui_factory.make_output_stream() | ||
1135 | 4741 | lf = log_formatter('short', | 4751 | lf = log_formatter('short', |
1137 | 4742 | to_file=log_collector, | 4752 | to_file=self.outf, |
1138 | 4743 | show_timezone='original') | 4753 | show_timezone='original') |
1139 | 4744 | 4754 | ||
1140 | 4745 | show_log(b, | 4755 | show_log(b, |
1141 | @@ -4750,21 +4760,22 @@ | |||
1142 | 4750 | end_revision=last_revno) | 4760 | end_revision=last_revno) |
1143 | 4751 | 4761 | ||
1144 | 4752 | if dry_run: | 4762 | if dry_run: |
1146 | 4753 | ui.ui_factory.note('Dry-run, pretending to remove the above revisions.') | 4763 | self.outf.write('Dry-run, pretending to remove' |
1147 | 4764 | ' the above revisions.\n') | ||
1148 | 4754 | else: | 4765 | else: |
1150 | 4755 | ui.ui_factory.note('The above revision(s) will be removed.') | 4766 | self.outf.write('The above revision(s) will be removed.\n') |
1151 | 4756 | 4767 | ||
1152 | 4757 | if not force: | 4768 | if not force: |
1155 | 4758 | if not ui.ui_factory.get_boolean('Are you sure [y/N]? '): | 4769 | if not ui.ui_factory.get_boolean('Are you sure'): |
1156 | 4759 | ui.ui_factory.note('Canceled') | 4770 | self.outf.write('Canceled') |
1157 | 4760 | return 0 | 4771 | return 0 |
1158 | 4761 | 4772 | ||
1159 | 4762 | mutter('Uncommitting from {%s} to {%s}', | 4773 | mutter('Uncommitting from {%s} to {%s}', |
1160 | 4763 | last_rev_id, rev_id) | 4774 | last_rev_id, rev_id) |
1161 | 4764 | uncommit(b, tree=tree, dry_run=dry_run, verbose=verbose, | 4775 | uncommit(b, tree=tree, dry_run=dry_run, verbose=verbose, |
1162 | 4765 | revno=revno, local=local) | 4776 | revno=revno, local=local) |
1165 | 4766 | ui.ui_factory.note('You can restore the old tip by running:\n' | 4777 | self.outf.write('You can restore the old tip by running:\n' |
1166 | 4767 | ' bzr pull . -r revid:%s' % last_rev_id) | 4778 | ' bzr pull . -r revid:%s\n' % last_rev_id) |
1167 | 4768 | 4779 | ||
1168 | 4769 | 4780 | ||
1169 | 4770 | class cmd_break_lock(Command): | 4781 | class cmd_break_lock(Command): |
1170 | 4771 | 4782 | ||
1171 | === modified file 'bzrlib/bundle/__init__.py' | |||
1172 | --- bzrlib/bundle/__init__.py 2009-11-28 00:48:03 +0000 | |||
1173 | +++ bzrlib/bundle/__init__.py 2010-04-06 07:24:41 +0000 | |||
1174 | @@ -1,4 +1,4 @@ | |||
1176 | 1 | # Copyright (C) 2005, 2006 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
1177 | 2 | # | 2 | # |
1178 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1179 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1180 | 5 | 5 | ||
1181 | === modified file 'bzrlib/bzrdir.py' | |||
1182 | --- bzrlib/bzrdir.py 2010-02-18 04:04:19 +0000 | |||
1183 | +++ bzrlib/bzrdir.py 2010-04-06 07:24:41 +0000 | |||
1184 | @@ -396,16 +396,23 @@ | |||
1185 | 396 | """Destroy the repository in this BzrDir""" | 396 | """Destroy the repository in this BzrDir""" |
1186 | 397 | raise NotImplementedError(self.destroy_repository) | 397 | raise NotImplementedError(self.destroy_repository) |
1187 | 398 | 398 | ||
1189 | 399 | def create_branch(self): | 399 | def create_branch(self, name=None): |
1190 | 400 | """Create a branch in this BzrDir. | 400 | """Create a branch in this BzrDir. |
1191 | 401 | 401 | ||
1192 | 402 | :param name: Name of the colocated branch to create, None for | ||
1193 | 403 | the default branch. | ||
1194 | 404 | |||
1195 | 402 | The bzrdir's format will control what branch format is created. | 405 | The bzrdir's format will control what branch format is created. |
1196 | 403 | For more control see BranchFormatXX.create(a_bzrdir). | 406 | For more control see BranchFormatXX.create(a_bzrdir). |
1197 | 404 | """ | 407 | """ |
1198 | 405 | raise NotImplementedError(self.create_branch) | 408 | raise NotImplementedError(self.create_branch) |
1199 | 406 | 409 | ||
1202 | 407 | def destroy_branch(self): | 410 | def destroy_branch(self, name=None): |
1203 | 408 | """Destroy the branch in this BzrDir""" | 411 | """Destroy a branch in this BzrDir. |
1204 | 412 | |||
1205 | 413 | :param name: Name of the branch to destroy, None for the default | ||
1206 | 414 | branch. | ||
1207 | 415 | """ | ||
1208 | 409 | raise NotImplementedError(self.destroy_branch) | 416 | raise NotImplementedError(self.destroy_branch) |
1209 | 410 | 417 | ||
1210 | 411 | @staticmethod | 418 | @staticmethod |
1211 | @@ -708,7 +715,7 @@ | |||
1212 | 708 | """ | 715 | """ |
1213 | 709 | return None | 716 | return None |
1214 | 710 | 717 | ||
1216 | 711 | def get_branch_transport(self, branch_format): | 718 | def get_branch_transport(self, branch_format, name=None): |
1217 | 712 | """Get the transport for use by branch format in this BzrDir. | 719 | """Get the transport for use by branch format in this BzrDir. |
1218 | 713 | 720 | ||
1219 | 714 | Note that bzr dirs that do not support format strings will raise | 721 | Note that bzr dirs that do not support format strings will raise |
1220 | @@ -892,7 +899,8 @@ | |||
1221 | 892 | BzrDir._check_supported(format, _unsupported) | 899 | BzrDir._check_supported(format, _unsupported) |
1222 | 893 | return format.open(transport, _found=True) | 900 | return format.open(transport, _found=True) |
1223 | 894 | 901 | ||
1225 | 895 | def open_branch(self, unsupported=False, ignore_fallbacks=False): | 902 | def open_branch(self, name=None, unsupported=False, |
1226 | 903 | ignore_fallbacks=False): | ||
1227 | 896 | """Open the branch object at this BzrDir if one is present. | 904 | """Open the branch object at this BzrDir if one is present. |
1228 | 897 | 905 | ||
1229 | 898 | If unsupported is True, then no longer supported branch formats can | 906 | If unsupported is True, then no longer supported branch formats can |
1230 | @@ -1036,7 +1044,7 @@ | |||
1231 | 1036 | """ | 1044 | """ |
1232 | 1037 | raise NotImplementedError(self.open_workingtree) | 1045 | raise NotImplementedError(self.open_workingtree) |
1233 | 1038 | 1046 | ||
1235 | 1039 | def has_branch(self): | 1047 | def has_branch(self, name=None): |
1236 | 1040 | """Tell if this bzrdir contains a branch. | 1048 | """Tell if this bzrdir contains a branch. |
1237 | 1041 | 1049 | ||
1238 | 1042 | Note: if you're going to open the branch, you should just go ahead | 1050 | Note: if you're going to open the branch, you should just go ahead |
1239 | @@ -1044,7 +1052,7 @@ | |||
1240 | 1044 | branch and discards it, and that's somewhat expensive.) | 1052 | branch and discards it, and that's somewhat expensive.) |
1241 | 1045 | """ | 1053 | """ |
1242 | 1046 | try: | 1054 | try: |
1244 | 1047 | self.open_branch() | 1055 | self.open_branch(name) |
1245 | 1048 | return True | 1056 | return True |
1246 | 1049 | except errors.NotBranchError: | 1057 | except errors.NotBranchError: |
1247 | 1050 | return False | 1058 | return False |
1248 | @@ -1373,11 +1381,11 @@ | |||
1249 | 1373 | tree.clone(result) | 1381 | tree.clone(result) |
1250 | 1374 | return result | 1382 | return result |
1251 | 1375 | 1383 | ||
1253 | 1376 | def create_branch(self): | 1384 | def create_branch(self, name=None): |
1254 | 1377 | """See BzrDir.create_branch.""" | 1385 | """See BzrDir.create_branch.""" |
1256 | 1378 | return self._format.get_branch_format().initialize(self) | 1386 | return self._format.get_branch_format().initialize(self, name=name) |
1257 | 1379 | 1387 | ||
1259 | 1380 | def destroy_branch(self): | 1388 | def destroy_branch(self, name=None): |
1260 | 1381 | """See BzrDir.destroy_branch.""" | 1389 | """See BzrDir.destroy_branch.""" |
1261 | 1382 | raise errors.UnsupportedOperation(self.destroy_branch, self) | 1390 | raise errors.UnsupportedOperation(self.destroy_branch, self) |
1262 | 1383 | 1391 | ||
1263 | @@ -1439,8 +1447,10 @@ | |||
1264 | 1439 | raise errors.UnsupportedOperation(self.destroy_workingtree_metadata, | 1447 | raise errors.UnsupportedOperation(self.destroy_workingtree_metadata, |
1265 | 1440 | self) | 1448 | self) |
1266 | 1441 | 1449 | ||
1268 | 1442 | def get_branch_transport(self, branch_format): | 1450 | def get_branch_transport(self, branch_format, name=None): |
1269 | 1443 | """See BzrDir.get_branch_transport().""" | 1451 | """See BzrDir.get_branch_transport().""" |
1270 | 1452 | if name is not None: | ||
1271 | 1453 | raise errors.NoColocatedBranchSupport(self) | ||
1272 | 1444 | if branch_format is None: | 1454 | if branch_format is None: |
1273 | 1445 | return self.transport | 1455 | return self.transport |
1274 | 1446 | try: | 1456 | try: |
1275 | @@ -1479,12 +1489,13 @@ | |||
1276 | 1479 | format = BzrDirFormat.get_default_format() | 1489 | format = BzrDirFormat.get_default_format() |
1277 | 1480 | return not isinstance(self._format, format.__class__) | 1490 | return not isinstance(self._format, format.__class__) |
1278 | 1481 | 1491 | ||
1280 | 1482 | def open_branch(self, unsupported=False, ignore_fallbacks=False): | 1492 | def open_branch(self, name=None, unsupported=False, |
1281 | 1493 | ignore_fallbacks=False): | ||
1282 | 1483 | """See BzrDir.open_branch.""" | 1494 | """See BzrDir.open_branch.""" |
1283 | 1484 | from bzrlib.branch import BzrBranchFormat4 | 1495 | from bzrlib.branch import BzrBranchFormat4 |
1284 | 1485 | format = BzrBranchFormat4() | 1496 | format = BzrBranchFormat4() |
1285 | 1486 | self._check_supported(format, unsupported) | 1497 | self._check_supported(format, unsupported) |
1287 | 1487 | return format.open(self, _found=True) | 1498 | return format.open(self, name, _found=True) |
1288 | 1488 | 1499 | ||
1289 | 1489 | def sprout(self, url, revision_id=None, force_new_repo=False, | 1500 | def sprout(self, url, revision_id=None, force_new_repo=False, |
1290 | 1490 | possible_transports=None, accelerator_tree=None, | 1501 | possible_transports=None, accelerator_tree=None, |
1291 | @@ -1607,12 +1618,14 @@ | |||
1292 | 1607 | """See BzrDir.can_convert_format().""" | 1618 | """See BzrDir.can_convert_format().""" |
1293 | 1608 | return True | 1619 | return True |
1294 | 1609 | 1620 | ||
1296 | 1610 | def create_branch(self): | 1621 | def create_branch(self, name=None): |
1297 | 1611 | """See BzrDir.create_branch.""" | 1622 | """See BzrDir.create_branch.""" |
1299 | 1612 | return self._format.get_branch_format().initialize(self) | 1623 | return self._format.get_branch_format().initialize(self, name=name) |
1300 | 1613 | 1624 | ||
1302 | 1614 | def destroy_branch(self): | 1625 | def destroy_branch(self, name=None): |
1303 | 1615 | """See BzrDir.create_branch.""" | 1626 | """See BzrDir.create_branch.""" |
1304 | 1627 | if name is not None: | ||
1305 | 1628 | raise errors.NoColocatedBranchSupport(self) | ||
1306 | 1616 | self.transport.delete_tree('branch') | 1629 | self.transport.delete_tree('branch') |
1307 | 1617 | 1630 | ||
1308 | 1618 | def create_repository(self, shared=False): | 1631 | def create_repository(self, shared=False): |
1309 | @@ -1661,8 +1674,10 @@ | |||
1310 | 1661 | format = BranchFormat.find_format(self) | 1674 | format = BranchFormat.find_format(self) |
1311 | 1662 | return format.get_reference(self) | 1675 | return format.get_reference(self) |
1312 | 1663 | 1676 | ||
1314 | 1664 | def get_branch_transport(self, branch_format): | 1677 | def get_branch_transport(self, branch_format, name=None): |
1315 | 1665 | """See BzrDir.get_branch_transport().""" | 1678 | """See BzrDir.get_branch_transport().""" |
1316 | 1679 | if name is not None: | ||
1317 | 1680 | raise errors.NoColocatedBranchSupport(self) | ||
1318 | 1666 | # XXX: this shouldn't implicitly create the directory if it's just | 1681 | # XXX: this shouldn't implicitly create the directory if it's just |
1319 | 1667 | # promising to get a transport -- mbp 20090727 | 1682 | # promising to get a transport -- mbp 20090727 |
1320 | 1668 | if branch_format is None: | 1683 | if branch_format is None: |
1321 | @@ -1739,13 +1754,11 @@ | |||
1322 | 1739 | return True | 1754 | return True |
1323 | 1740 | except errors.NoRepositoryPresent: | 1755 | except errors.NoRepositoryPresent: |
1324 | 1741 | pass | 1756 | pass |
1327 | 1742 | try: | 1757 | for branch in self.list_branches(): |
1328 | 1743 | if not isinstance(self.open_branch()._format, | 1758 | if not isinstance(branch._format, |
1329 | 1744 | format.get_branch_format().__class__): | 1759 | format.get_branch_format().__class__): |
1330 | 1745 | # the branch needs an upgrade. | 1760 | # the branch needs an upgrade. |
1331 | 1746 | return True | 1761 | return True |
1332 | 1747 | except errors.NotBranchError: | ||
1333 | 1748 | pass | ||
1334 | 1749 | try: | 1762 | try: |
1335 | 1750 | my_wt = self.open_workingtree(recommend_upgrade=False) | 1763 | my_wt = self.open_workingtree(recommend_upgrade=False) |
1336 | 1751 | if not isinstance(my_wt._format, | 1764 | if not isinstance(my_wt._format, |
1337 | @@ -1756,11 +1769,13 @@ | |||
1338 | 1756 | pass | 1769 | pass |
1339 | 1757 | return False | 1770 | return False |
1340 | 1758 | 1771 | ||
1342 | 1759 | def open_branch(self, unsupported=False, ignore_fallbacks=False): | 1772 | def open_branch(self, name=None, unsupported=False, |
1343 | 1773 | ignore_fallbacks=False): | ||
1344 | 1760 | """See BzrDir.open_branch.""" | 1774 | """See BzrDir.open_branch.""" |
1345 | 1761 | format = self.find_branch_format() | 1775 | format = self.find_branch_format() |
1346 | 1762 | self._check_supported(format, unsupported) | 1776 | self._check_supported(format, unsupported) |
1348 | 1763 | return format.open(self, _found=True, ignore_fallbacks=ignore_fallbacks) | 1777 | return format.open(self, name=name, |
1349 | 1778 | _found=True, ignore_fallbacks=ignore_fallbacks) | ||
1350 | 1764 | 1779 | ||
1351 | 1765 | def open_repository(self, unsupported=False): | 1780 | def open_repository(self, unsupported=False): |
1352 | 1766 | """See BzrDir.open_repository.""" | 1781 | """See BzrDir.open_repository.""" |
1353 | @@ -1798,6 +1813,8 @@ | |||
1354 | 1798 | Once a format is deprecated, just deprecate the initialize and open | 1813 | Once a format is deprecated, just deprecate the initialize and open |
1355 | 1799 | methods on the format class. Do not deprecate the object, as the | 1814 | methods on the format class. Do not deprecate the object, as the |
1356 | 1800 | object will be created every system load. | 1815 | object will be created every system load. |
1357 | 1816 | |||
1358 | 1817 | :cvar colocated_branches: Whether this formats supports colocated branches. | ||
1359 | 1801 | """ | 1818 | """ |
1360 | 1802 | 1819 | ||
1361 | 1803 | _default_format = None | 1820 | _default_format = None |
1362 | @@ -1820,6 +1837,10 @@ | |||
1363 | 1820 | 1837 | ||
1364 | 1821 | _lock_file_name = 'branch-lock' | 1838 | _lock_file_name = 'branch-lock' |
1365 | 1822 | 1839 | ||
1366 | 1840 | colocated_branches = False | ||
1367 | 1841 | """Whether co-located branches are supported for this control dir format. | ||
1368 | 1842 | """ | ||
1369 | 1843 | |||
1370 | 1823 | # _lock_class must be set in subclasses to the lock type, typ. | 1844 | # _lock_class must be set in subclasses to the lock type, typ. |
1371 | 1824 | # TransportLock or LockDir | 1845 | # TransportLock or LockDir |
1372 | 1825 | 1846 | ||
1373 | 1826 | 1847 | ||
1374 | === modified file 'bzrlib/chk_serializer.py' | |||
1375 | --- bzrlib/chk_serializer.py 2009-12-03 04:55:02 +0000 | |||
1376 | +++ bzrlib/chk_serializer.py 2010-04-06 07:24:41 +0000 | |||
1377 | @@ -1,4 +1,4 @@ | |||
1379 | 1 | # Copyright (C) 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
1380 | 2 | # | 2 | # |
1381 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1382 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1383 | 5 | 5 | ||
1384 | === modified file 'bzrlib/cleanup.py' | |||
1385 | --- bzrlib/cleanup.py 2010-02-05 03:37:52 +0000 | |||
1386 | +++ bzrlib/cleanup.py 2010-04-06 07:24:41 +0000 | |||
1387 | @@ -1,4 +1,4 @@ | |||
1389 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
1390 | 2 | # | 2 | # |
1391 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1392 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1393 | 5 | 5 | ||
1394 | === modified file 'bzrlib/cmd_version_info.py' | |||
1395 | --- bzrlib/cmd_version_info.py 2009-11-16 02:26:32 +0000 | |||
1396 | +++ bzrlib/cmd_version_info.py 2010-04-06 07:24:41 +0000 | |||
1397 | @@ -1,4 +1,4 @@ | |||
1399 | 1 | # Copyright (C) 2005, 2006, 2009 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
1400 | 2 | # | 2 | # |
1401 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1402 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1403 | 5 | 5 | ||
1404 | === modified file 'bzrlib/cmdline.py' | |||
1405 | --- bzrlib/cmdline.py 2010-02-12 05:40:17 +0000 | |||
1406 | +++ bzrlib/cmdline.py 2010-04-06 07:24:41 +0000 | |||
1407 | @@ -26,16 +26,16 @@ | |||
1408 | 26 | def __init__(self, orig): | 26 | def __init__(self, orig): |
1409 | 27 | self._iter = iter(orig) | 27 | self._iter = iter(orig) |
1410 | 28 | self._pushback_buffer = [] | 28 | self._pushback_buffer = [] |
1412 | 29 | 29 | ||
1413 | 30 | def next(self): | 30 | def next(self): |
1414 | 31 | if len(self._pushback_buffer) > 0: | 31 | if len(self._pushback_buffer) > 0: |
1415 | 32 | return self._pushback_buffer.pop() | 32 | return self._pushback_buffer.pop() |
1416 | 33 | else: | 33 | else: |
1417 | 34 | return self._iter.next() | 34 | return self._iter.next() |
1419 | 35 | 35 | ||
1420 | 36 | def pushback(self, char): | 36 | def pushback(self, char): |
1421 | 37 | self._pushback_buffer.append(char) | 37 | self._pushback_buffer.append(char) |
1423 | 38 | 38 | ||
1424 | 39 | def __iter__(self): | 39 | def __iter__(self): |
1425 | 40 | return self | 40 | return self |
1426 | 41 | 41 | ||
1427 | @@ -77,7 +77,7 @@ | |||
1428 | 77 | def __init__(self, exit_state): | 77 | def __init__(self, exit_state): |
1429 | 78 | self.exit_state = exit_state | 78 | self.exit_state = exit_state |
1430 | 79 | self.count = 1 | 79 | self.count = 1 |
1432 | 80 | 80 | ||
1433 | 81 | def process(self, next_char, context): | 81 | def process(self, next_char, context): |
1434 | 82 | if next_char == u'\\': | 82 | if next_char == u'\\': |
1435 | 83 | self.count += 1 | 83 | self.count += 1 |
1436 | @@ -104,7 +104,7 @@ | |||
1437 | 104 | # let exit_state handle next_char | 104 | # let exit_state handle next_char |
1438 | 105 | context.seq.pushback(next_char) | 105 | context.seq.pushback(next_char) |
1439 | 106 | return self.exit_state | 106 | return self.exit_state |
1441 | 107 | 107 | ||
1442 | 108 | def finish(self, context): | 108 | def finish(self, context): |
1443 | 109 | if self.count > 0: | 109 | if self.count > 0: |
1444 | 110 | context.token.append(u'\\' * self.count) | 110 | context.token.append(u'\\' * self.count) |
1445 | @@ -129,16 +129,16 @@ | |||
1446 | 129 | self.allowed_quote_chars = u'"' | 129 | self.allowed_quote_chars = u'"' |
1447 | 130 | if single_quotes_allowed: | 130 | if single_quotes_allowed: |
1448 | 131 | self.allowed_quote_chars += u"'" | 131 | self.allowed_quote_chars += u"'" |
1450 | 132 | 132 | ||
1451 | 133 | def __iter__(self): | 133 | def __iter__(self): |
1452 | 134 | return self | 134 | return self |
1454 | 135 | 135 | ||
1455 | 136 | def next(self): | 136 | def next(self): |
1456 | 137 | quoted, token = self._get_token() | 137 | quoted, token = self._get_token() |
1457 | 138 | if token is None: | 138 | if token is None: |
1458 | 139 | raise StopIteration | 139 | raise StopIteration |
1459 | 140 | return quoted, token | 140 | return quoted, token |
1461 | 141 | 141 | ||
1462 | 142 | def _get_token(self): | 142 | def _get_token(self): |
1463 | 143 | self.quoted = False | 143 | self.quoted = False |
1464 | 144 | self.token = [] | 144 | self.token = [] |
1465 | 145 | 145 | ||
1466 | === modified file 'bzrlib/commands.py' | |||
1467 | --- bzrlib/commands.py 2010-02-12 04:02:50 +0000 | |||
1468 | +++ bzrlib/commands.py 2010-04-06 07:24:41 +0000 | |||
1469 | @@ -55,6 +55,7 @@ | |||
1470 | 55 | from bzrlib.hooks import HookPoint, Hooks | 55 | from bzrlib.hooks import HookPoint, Hooks |
1471 | 56 | # Compatibility - Option used to be in commands. | 56 | # Compatibility - Option used to be in commands. |
1472 | 57 | from bzrlib.option import Option | 57 | from bzrlib.option import Option |
1473 | 58 | from bzrlib.plugin import disable_plugins, load_plugins | ||
1474 | 58 | from bzrlib import registry | 59 | from bzrlib import registry |
1475 | 59 | from bzrlib.symbol_versioning import ( | 60 | from bzrlib.symbol_versioning import ( |
1476 | 60 | deprecated_function, | 61 | deprecated_function, |
1477 | @@ -198,11 +199,13 @@ | |||
1478 | 198 | raise errors.BzrCommandError('unknown command "%s"' % cmd_name) | 199 | raise errors.BzrCommandError('unknown command "%s"' % cmd_name) |
1479 | 199 | 200 | ||
1480 | 200 | 201 | ||
1482 | 201 | def _get_cmd_object(cmd_name, plugins_override=True): | 202 | def _get_cmd_object(cmd_name, plugins_override=True, check_missing=True): |
1483 | 202 | """Get a command object. | 203 | """Get a command object. |
1484 | 203 | 204 | ||
1485 | 204 | :param cmd_name: The name of the command. | 205 | :param cmd_name: The name of the command. |
1486 | 205 | :param plugins_override: Allow plugins to override builtins. | 206 | :param plugins_override: Allow plugins to override builtins. |
1487 | 207 | :param check_missing: Look up commands not found in the regular index via | ||
1488 | 208 | the get_missing_command hook. | ||
1489 | 206 | :return: A Command object instance | 209 | :return: A Command object instance |
1490 | 207 | :raises KeyError: If no command is found. | 210 | :raises KeyError: If no command is found. |
1491 | 208 | """ | 211 | """ |
1492 | @@ -218,7 +221,7 @@ | |||
1493 | 218 | # We've found a non-plugin command, don't permit it to be | 221 | # We've found a non-plugin command, don't permit it to be |
1494 | 219 | # overridden. | 222 | # overridden. |
1495 | 220 | break | 223 | break |
1497 | 221 | if cmd is None: | 224 | if cmd is None and check_missing: |
1498 | 222 | for hook in Command.hooks['get_missing_command']: | 225 | for hook in Command.hooks['get_missing_command']: |
1499 | 223 | cmd = hook(cmd_name) | 226 | cmd = hook(cmd_name) |
1500 | 224 | if cmd is not None: | 227 | if cmd is not None: |
1501 | @@ -369,7 +372,7 @@ | |||
1502 | 369 | # List of standard options directly supported | 372 | # List of standard options directly supported |
1503 | 370 | self.supported_std_options = [] | 373 | self.supported_std_options = [] |
1504 | 371 | self._operation = cleanup.OperationWithCleanups(self.run) | 374 | self._operation = cleanup.OperationWithCleanups(self.run) |
1506 | 372 | 375 | ||
1507 | 373 | def add_cleanup(self, cleanup_func, *args, **kwargs): | 376 | def add_cleanup(self, cleanup_func, *args, **kwargs): |
1508 | 374 | """Register a function to call after self.run returns or raises. | 377 | """Register a function to call after self.run returns or raises. |
1509 | 375 | 378 | ||
1510 | @@ -389,7 +392,7 @@ | |||
1511 | 389 | resources (such as writing results to self.outf). | 392 | resources (such as writing results to self.outf). |
1512 | 390 | """ | 393 | """ |
1513 | 391 | self._operation.cleanup_now() | 394 | self._operation.cleanup_now() |
1515 | 392 | 395 | ||
1516 | 393 | @deprecated_method(deprecated_in((2, 1, 0))) | 396 | @deprecated_method(deprecated_in((2, 1, 0))) |
1517 | 394 | def _maybe_expand_globs(self, file_list): | 397 | def _maybe_expand_globs(self, file_list): |
1518 | 395 | """Glob expand file_list if the platform does not do that itself. | 398 | """Glob expand file_list if the platform does not do that itself. |
1519 | @@ -874,6 +877,11 @@ | |||
1520 | 874 | return ret | 877 | return ret |
1521 | 875 | 878 | ||
1522 | 876 | 879 | ||
1523 | 880 | @deprecated_function(deprecated_in((2, 2, 0))) | ||
1524 | 881 | def shlex_split_unicode(unsplit): | ||
1525 | 882 | return cmdline.split(unsplit) | ||
1526 | 883 | |||
1527 | 884 | |||
1528 | 877 | def get_alias(cmd, config=None): | 885 | def get_alias(cmd, config=None): |
1529 | 878 | """Return an expanded alias, or None if no alias exists. | 886 | """Return an expanded alias, or None if no alias exists. |
1530 | 879 | 887 | ||
1531 | @@ -893,15 +901,21 @@ | |||
1532 | 893 | return None | 901 | return None |
1533 | 894 | 902 | ||
1534 | 895 | 903 | ||
1536 | 896 | def run_bzr(argv): | 904 | def run_bzr(argv, load_plugins=load_plugins, disable_plugins=disable_plugins): |
1537 | 897 | """Execute a command. | 905 | """Execute a command. |
1538 | 898 | 906 | ||
1545 | 899 | argv | 907 | :param argv: The command-line arguments, without the program name from |
1546 | 900 | The command-line arguments, without the program name from argv[0] | 908 | argv[0] These should already be decoded. All library/test code calling |
1547 | 901 | These should already be decoded. All library/test code calling | 909 | run_bzr should be passing valid strings (don't need decoding). |
1548 | 902 | run_bzr should be passing valid strings (don't need decoding). | 910 | :param load_plugins: What function to call when triggering plugin loading. |
1549 | 903 | 911 | This function should take no arguments and cause all plugins to be | |
1550 | 904 | Returns a command status or raises an exception. | 912 | loaded. |
1551 | 913 | :param disable_plugins: What function to call when disabling plugin | ||
1552 | 914 | loading. This function should take no arguments and cause all plugin | ||
1553 | 915 | loading to be prohibited (so that code paths in your application that | ||
1554 | 916 | know about some plugins possibly being present will fail to import | ||
1555 | 917 | those plugins even if they are installed.) | ||
1556 | 918 | :return: Returns a command exit code or raises an exception. | ||
1557 | 905 | 919 | ||
1558 | 906 | Special master options: these must come before the command because | 920 | Special master options: these must come before the command because |
1559 | 907 | they control how the command is interpreted. | 921 | they control how the command is interpreted. |
1560 | @@ -972,24 +986,20 @@ | |||
1561 | 972 | 986 | ||
1562 | 973 | debug.set_debug_flags_from_config() | 987 | debug.set_debug_flags_from_config() |
1563 | 974 | 988 | ||
1564 | 989 | if not opt_no_plugins: | ||
1565 | 990 | load_plugins() | ||
1566 | 991 | else: | ||
1567 | 992 | disable_plugins() | ||
1568 | 993 | |||
1569 | 975 | argv = argv_copy | 994 | argv = argv_copy |
1570 | 976 | if (not argv): | 995 | if (not argv): |
1573 | 977 | from bzrlib.builtins import cmd_help | 996 | get_cmd_object('help').run_argv_aliases([]) |
1572 | 978 | cmd_help().run_argv_aliases([]) | ||
1574 | 979 | return 0 | 997 | return 0 |
1575 | 980 | 998 | ||
1576 | 981 | if argv[0] == '--version': | 999 | if argv[0] == '--version': |
1579 | 982 | from bzrlib.builtins import cmd_version | 1000 | get_cmd_object('version').run_argv_aliases([]) |
1578 | 983 | cmd_version().run_argv_aliases([]) | ||
1580 | 984 | return 0 | 1001 | return 0 |
1581 | 985 | 1002 | ||
1582 | 986 | if not opt_no_plugins: | ||
1583 | 987 | from bzrlib.plugin import load_plugins | ||
1584 | 988 | load_plugins() | ||
1585 | 989 | else: | ||
1586 | 990 | from bzrlib.plugin import disable_plugins | ||
1587 | 991 | disable_plugins() | ||
1588 | 992 | |||
1589 | 993 | alias_argv = None | 1003 | alias_argv = None |
1590 | 994 | 1004 | ||
1591 | 995 | if not opt_no_aliases: | 1005 | if not opt_no_aliases: |
1592 | @@ -1159,7 +1169,7 @@ | |||
1593 | 1159 | if topic and topic.startswith(self.prefix): | 1169 | if topic and topic.startswith(self.prefix): |
1594 | 1160 | topic = topic[len(self.prefix):] | 1170 | topic = topic[len(self.prefix):] |
1595 | 1161 | try: | 1171 | try: |
1597 | 1162 | cmd = _get_cmd_object(topic) | 1172 | cmd = _get_cmd_object(topic, check_missing=False) |
1598 | 1163 | except KeyError: | 1173 | except KeyError: |
1599 | 1164 | return [] | 1174 | return [] |
1600 | 1165 | else: | 1175 | else: |
1601 | 1166 | 1176 | ||
1602 | === modified file 'bzrlib/commit.py' | |||
1603 | --- bzrlib/commit.py 2009-10-15 02:53:30 +0000 | |||
1604 | +++ bzrlib/commit.py 2010-04-06 07:24:41 +0000 | |||
1605 | @@ -1,4 +1,4 @@ | |||
1607 | 1 | # Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
1608 | 2 | # | 2 | # |
1609 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1610 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1611 | 5 | 5 | ||
1612 | === modified file 'bzrlib/conflicts.py' | |||
1613 | --- bzrlib/conflicts.py 2010-02-11 09:51:03 +0000 | |||
1614 | +++ bzrlib/conflicts.py 2010-04-06 07:24:41 +0000 | |||
1615 | @@ -26,6 +26,7 @@ | |||
1616 | 26 | 26 | ||
1617 | 27 | from bzrlib import ( | 27 | from bzrlib import ( |
1618 | 28 | builtins, | 28 | builtins, |
1619 | 29 | cleanup, | ||
1620 | 29 | commands, | 30 | commands, |
1621 | 30 | errors, | 31 | errors, |
1622 | 31 | osutils, | 32 | osutils, |
1623 | @@ -479,16 +480,43 @@ | |||
1624 | 479 | def associated_filenames(self): | 480 | def associated_filenames(self): |
1625 | 480 | return [self.path + suffix for suffix in ('.BASE', '.OTHER')] | 481 | return [self.path + suffix for suffix in ('.BASE', '.OTHER')] |
1626 | 481 | 482 | ||
1631 | 482 | # FIXME: I smell something weird here and it seems we should be able to be | 483 | def _take_it(self, tt, suffix_to_remove): |
1632 | 483 | # more coherent with some other conflict ? bzr *did* a choice there but | 484 | """Resolve the conflict. |
1633 | 484 | # neither action_take_this nor action_take_other reflect that... | 485 | |
1634 | 485 | # -- vila 20091224 | 486 | :param tt: The TreeTransform where the conflict is resolved. |
1635 | 487 | :param suffix_to_remove: Either 'THIS' or 'OTHER' | ||
1636 | 488 | |||
1637 | 489 | The resolution is symmetric, when taking THIS, OTHER is deleted and | ||
1638 | 490 | item.THIS is renamed into item and vice-versa. | ||
1639 | 491 | """ | ||
1640 | 492 | try: | ||
1641 | 493 | # Delete 'item.THIS' or 'item.OTHER' depending on | ||
1642 | 494 | # suffix_to_remove | ||
1643 | 495 | tt.delete_contents( | ||
1644 | 496 | tt.trans_id_tree_path(self.path + '.' + suffix_to_remove)) | ||
1645 | 497 | except errors.NoSuchFile: | ||
1646 | 498 | # There are valid cases where 'item.suffix_to_remove' either | ||
1647 | 499 | # never existed or was already deleted (including the case | ||
1648 | 500 | # where the user deleted it) | ||
1649 | 501 | pass | ||
1650 | 502 | # Rename 'item.suffix_to_remove' (note that if | ||
1651 | 503 | # 'item.suffix_to_remove' has been deleted, this is a no-op) | ||
1652 | 504 | this_tid = tt.trans_id_file_id(self.file_id) | ||
1653 | 505 | parent_tid = tt.get_tree_parent(this_tid) | ||
1654 | 506 | tt.adjust_path(self.path, parent_tid, this_tid) | ||
1655 | 507 | tt.apply() | ||
1656 | 508 | |||
1657 | 509 | def _take_it_with_cleanups(self, tree, suffix_to_remove): | ||
1658 | 510 | tt = transform.TreeTransform(tree) | ||
1659 | 511 | op = cleanup.OperationWithCleanups(self._take_it) | ||
1660 | 512 | op.add_cleanup(tt.finalize) | ||
1661 | 513 | op.run_simple(tt, suffix_to_remove) | ||
1662 | 514 | |||
1663 | 486 | def action_take_this(self, tree): | 515 | def action_take_this(self, tree): |
1665 | 487 | tree.remove([self.path + '.OTHER'], force=True, keep_files=False) | 516 | self._take_it_with_cleanups(tree, 'OTHER') |
1666 | 488 | 517 | ||
1667 | 489 | def action_take_other(self, tree): | 518 | def action_take_other(self, tree): |
1670 | 490 | tree.remove([self.path], force=True, keep_files=False) | 519 | self._take_it_with_cleanups(tree, 'THIS') |
1669 | 491 | |||
1671 | 492 | 520 | ||
1672 | 493 | 521 | ||
1673 | 494 | # FIXME: TextConflict is about a single file-id, there never is a conflict_path | 522 | # FIXME: TextConflict is about a single file-id, there never is a conflict_path |
1674 | 495 | 523 | ||
1675 | === modified file 'bzrlib/decorators.py' | |||
1676 | --- bzrlib/decorators.py 2010-01-20 16:05:28 +0000 | |||
1677 | +++ bzrlib/decorators.py 2010-04-06 07:24:41 +0000 | |||
1678 | @@ -1,4 +1,4 @@ | |||
1680 | 1 | # Copyright (C) 2005 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
1681 | 2 | # | 2 | # |
1682 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1683 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1684 | 5 | 5 | ||
1685 | === modified file 'bzrlib/delta.py' | |||
1686 | --- bzrlib/delta.py 2009-10-29 05:54:49 +0000 | |||
1687 | +++ bzrlib/delta.py 2010-04-06 07:24:41 +0000 | |||
1688 | @@ -1,4 +1,4 @@ | |||
1690 | 1 | # Copyright (C) 2005, 2006 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
1691 | 2 | # | 2 | # |
1692 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1693 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1694 | 5 | 5 | ||
1695 | === modified file 'bzrlib/diff.py' | |||
1696 | --- bzrlib/diff.py 2010-02-02 06:30:43 +0000 | |||
1697 | +++ bzrlib/diff.py 2010-04-06 07:24:41 +0000 | |||
1698 | @@ -1,4 +1,4 @@ | |||
1700 | 1 | # Copyright (C) 2004, 2005, 2006 Canonical Ltd. | 1 | # Copyright (C) 2005-2010 Canonical Ltd. |
1701 | 2 | # | 2 | # |
1702 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1703 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1704 | 5 | 5 | ||
1705 | === modified file 'bzrlib/doc_generate/autodoc_rstx.py' | |||
1706 | --- bzrlib/doc_generate/autodoc_rstx.py 2010-01-08 07:34:31 +0000 | |||
1707 | +++ bzrlib/doc_generate/autodoc_rstx.py 2010-04-06 07:24:41 +0000 | |||
1708 | @@ -1,4 +1,4 @@ | |||
1710 | 1 | # Copyright (C) 2006-2007 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
1711 | 2 | # | 2 | # |
1712 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1713 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1714 | 5 | 5 | ||
1715 | === modified file 'bzrlib/errors.py' | |||
1716 | --- bzrlib/errors.py 2010-01-20 22:32:07 +0000 | |||
1717 | +++ bzrlib/errors.py 2010-04-06 07:24:41 +0000 | |||
1718 | @@ -1,4 +1,4 @@ | |||
1720 | 1 | # Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
1721 | 2 | # | 2 | # |
1722 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1723 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1724 | @@ -1297,12 +1297,13 @@ | |||
1725 | 1297 | class BoundBranchOutOfDate(BzrError): | 1297 | class BoundBranchOutOfDate(BzrError): |
1726 | 1298 | 1298 | ||
1727 | 1299 | _fmt = ("Bound branch %(branch)s is out of date with master branch" | 1299 | _fmt = ("Bound branch %(branch)s is out of date with master branch" |
1729 | 1300 | " %(master)s.") | 1300 | " %(master)s.%(extra_help)s") |
1730 | 1301 | 1301 | ||
1731 | 1302 | def __init__(self, branch, master): | 1302 | def __init__(self, branch, master): |
1732 | 1303 | BzrError.__init__(self) | 1303 | BzrError.__init__(self) |
1733 | 1304 | self.branch = branch | 1304 | self.branch = branch |
1734 | 1305 | self.master = master | 1305 | self.master = master |
1735 | 1306 | self.extra_help = '' | ||
1736 | 1306 | 1307 | ||
1737 | 1307 | 1308 | ||
1738 | 1308 | class CommitToDoubleBoundBranch(BzrError): | 1309 | class CommitToDoubleBoundBranch(BzrError): |
1739 | @@ -3124,3 +3125,12 @@ | |||
1740 | 3124 | 3125 | ||
1741 | 3125 | def __init__(self, path): | 3126 | def __init__(self, path): |
1742 | 3126 | self.path = path | 3127 | self.path = path |
1743 | 3128 | |||
1744 | 3129 | |||
1745 | 3130 | class NoColocatedBranchSupport(BzrError): | ||
1746 | 3131 | |||
1747 | 3132 | _fmt = ("%(bzrdir)r does not support co-located branches.") | ||
1748 | 3133 | |||
1749 | 3134 | def __init__(self, bzrdir): | ||
1750 | 3135 | self.bzrdir = bzrdir | ||
1751 | 3136 | |||
1752 | 3127 | 3137 | ||
1753 | === modified file 'bzrlib/export/__init__.py' | |||
1754 | --- bzrlib/export/__init__.py 2010-01-29 12:04:38 +0000 | |||
1755 | +++ bzrlib/export/__init__.py 2010-04-06 07:24:41 +0000 | |||
1756 | @@ -19,7 +19,6 @@ | |||
1757 | 19 | Such as non-controlled directories, tarfiles, zipfiles, etc. | 19 | Such as non-controlled directories, tarfiles, zipfiles, etc. |
1758 | 20 | """ | 20 | """ |
1759 | 21 | 21 | ||
1760 | 22 | from bzrlib.trace import mutter | ||
1761 | 23 | import os | 22 | import os |
1762 | 24 | import bzrlib.errors as errors | 23 | import bzrlib.errors as errors |
1763 | 25 | 24 | ||
1764 | @@ -55,14 +54,16 @@ | |||
1765 | 55 | 54 | ||
1766 | 56 | When requesting a specific type of export, load the respective path. | 55 | When requesting a specific type of export, load the respective path. |
1767 | 57 | """ | 56 | """ |
1769 | 58 | def _loader(tree, dest, root, subdir, filtered): | 57 | def _loader(tree, dest, root, subdir, filtered, per_file_timestamps): |
1770 | 59 | mod = __import__(module, globals(), locals(), [funcname]) | 58 | mod = __import__(module, globals(), locals(), [funcname]) |
1771 | 60 | func = getattr(mod, funcname) | 59 | func = getattr(mod, funcname) |
1773 | 61 | return func(tree, dest, root, subdir, filtered=filtered) | 60 | return func(tree, dest, root, subdir, filtered=filtered, |
1774 | 61 | per_file_timestamps=per_file_timestamps) | ||
1775 | 62 | register_exporter(scheme, extensions, _loader) | 62 | register_exporter(scheme, extensions, _loader) |
1776 | 63 | 63 | ||
1777 | 64 | 64 | ||
1779 | 65 | def export(tree, dest, format=None, root=None, subdir=None, filtered=False): | 65 | def export(tree, dest, format=None, root=None, subdir=None, filtered=False, |
1780 | 66 | per_file_timestamps=False): | ||
1781 | 66 | """Export the given Tree to the specific destination. | 67 | """Export the given Tree to the specific destination. |
1782 | 67 | 68 | ||
1783 | 68 | :param tree: A Tree (such as RevisionTree) to export | 69 | :param tree: A Tree (such as RevisionTree) to export |
1784 | @@ -81,6 +82,9 @@ | |||
1785 | 81 | a directory to start exporting from. | 82 | a directory to start exporting from. |
1786 | 82 | :param filtered: If True, content filtering is applied to the | 83 | :param filtered: If True, content filtering is applied to the |
1787 | 83 | files exported. | 84 | files exported. |
1788 | 85 | :param per_file_timestamps: Whether to use the timestamp stored in the | ||
1789 | 86 | tree rather than now(). This will do a revision lookup | ||
1790 | 87 | for every file so will be significantly slower. | ||
1791 | 84 | """ | 88 | """ |
1792 | 85 | global _exporters, _exporter_extensions | 89 | global _exporters, _exporter_extensions |
1793 | 86 | 90 | ||
1794 | @@ -99,7 +103,8 @@ | |||
1795 | 99 | raise errors.NoSuchExportFormat(format) | 103 | raise errors.NoSuchExportFormat(format) |
1796 | 100 | tree.lock_read() | 104 | tree.lock_read() |
1797 | 101 | try: | 105 | try: |
1799 | 102 | return _exporters[format](tree, dest, root, subdir, filtered=filtered) | 106 | return _exporters[format](tree, dest, root, subdir, filtered=filtered, |
1800 | 107 | per_file_timestamps=per_file_timestamps) | ||
1801 | 103 | finally: | 108 | finally: |
1802 | 104 | tree.unlock() | 109 | tree.unlock() |
1803 | 105 | 110 | ||
1804 | 106 | 111 | ||
1805 | === modified file 'bzrlib/export/dir_exporter.py' | |||
1806 | --- bzrlib/export/dir_exporter.py 2010-02-04 16:06:36 +0000 | |||
1807 | +++ bzrlib/export/dir_exporter.py 2010-04-06 07:24:41 +0000 | |||
1808 | @@ -18,7 +18,6 @@ | |||
1809 | 18 | 18 | ||
1810 | 19 | import errno | 19 | import errno |
1811 | 20 | import os | 20 | import os |
1812 | 21 | import StringIO | ||
1813 | 22 | import time | 21 | import time |
1814 | 23 | 22 | ||
1815 | 24 | from bzrlib import errors, osutils | 23 | from bzrlib import errors, osutils |
1816 | @@ -30,7 +29,8 @@ | |||
1817 | 30 | from bzrlib.trace import mutter | 29 | from bzrlib.trace import mutter |
1818 | 31 | 30 | ||
1819 | 32 | 31 | ||
1821 | 33 | def dir_exporter(tree, dest, root, subdir, filtered=False): | 32 | def dir_exporter(tree, dest, root, subdir, filtered=False, |
1822 | 33 | per_file_timestamps=False): | ||
1823 | 34 | """Export this tree to a new directory. | 34 | """Export this tree to a new directory. |
1824 | 35 | 35 | ||
1825 | 36 | `dest` should either not exist or should be empty. If it does not exist it | 36 | `dest` should either not exist or should be empty. If it does not exist it |
1826 | @@ -92,4 +92,8 @@ | |||
1827 | 92 | out.writelines(chunks) | 92 | out.writelines(chunks) |
1828 | 93 | finally: | 93 | finally: |
1829 | 94 | out.close() | 94 | out.close() |
1831 | 95 | os.utime(fullpath, (now, now)) | 95 | if per_file_timestamps: |
1832 | 96 | mtime = tree.get_file_mtime(tree.path2id(relpath), relpath) | ||
1833 | 97 | else: | ||
1834 | 98 | mtime = now | ||
1835 | 99 | os.utime(fullpath, (mtime, mtime)) | ||
1836 | 96 | 100 | ||
1837 | === modified file 'bzrlib/export/tar_exporter.py' | |||
1838 | --- bzrlib/export/tar_exporter.py 2009-03-23 14:59:43 +0000 | |||
1839 | +++ bzrlib/export/tar_exporter.py 2010-04-06 07:24:41 +0000 | |||
1840 | @@ -17,13 +17,12 @@ | |||
1841 | 17 | """Export a Tree to a non-versioned directory. | 17 | """Export a Tree to a non-versioned directory. |
1842 | 18 | """ | 18 | """ |
1843 | 19 | 19 | ||
1844 | 20 | import os | ||
1845 | 21 | import StringIO | 20 | import StringIO |
1846 | 22 | import sys | 21 | import sys |
1847 | 23 | import tarfile | 22 | import tarfile |
1848 | 24 | import time | 23 | import time |
1849 | 25 | 24 | ||
1851 | 26 | from bzrlib import errors, export, osutils | 25 | from bzrlib import export, osutils |
1852 | 27 | from bzrlib.export import _export_iter_entries | 26 | from bzrlib.export import _export_iter_entries |
1853 | 28 | from bzrlib.filters import ( | 27 | from bzrlib.filters import ( |
1854 | 29 | ContentFilterContext, | 28 | ContentFilterContext, |
1855 | @@ -32,7 +31,8 @@ | |||
1856 | 32 | from bzrlib.trace import mutter | 31 | from bzrlib.trace import mutter |
1857 | 33 | 32 | ||
1858 | 34 | 33 | ||
1860 | 35 | def tar_exporter(tree, dest, root, subdir, compression=None, filtered=False): | 34 | def tar_exporter(tree, dest, root, subdir, compression=None, filtered=False, |
1861 | 35 | per_file_timestamps=False): | ||
1862 | 36 | """Export this tree to a new tar file. | 36 | """Export this tree to a new tar file. |
1863 | 37 | 37 | ||
1864 | 38 | `dest` will be created holding the contents of this tree; if it | 38 | `dest` will be created holding the contents of this tree; if it |
1865 | @@ -52,7 +52,10 @@ | |||
1866 | 52 | for dp, ie in _export_iter_entries(tree, subdir): | 52 | for dp, ie in _export_iter_entries(tree, subdir): |
1867 | 53 | filename = osutils.pathjoin(root, dp).encode('utf8') | 53 | filename = osutils.pathjoin(root, dp).encode('utf8') |
1868 | 54 | item = tarfile.TarInfo(filename) | 54 | item = tarfile.TarInfo(filename) |
1870 | 55 | item.mtime = now | 55 | if per_file_timestamps: |
1871 | 56 | item.mtime = tree.get_file_mtime(ie.file_id, dp) | ||
1872 | 57 | else: | ||
1873 | 58 | item.mtime = now | ||
1874 | 56 | if ie.kind == "file": | 59 | if ie.kind == "file": |
1875 | 57 | item.type = tarfile.REGTYPE | 60 | item.type = tarfile.REGTYPE |
1876 | 58 | if tree.is_executable(ie.file_id): | 61 | if tree.is_executable(ie.file_id): |
1877 | @@ -89,9 +92,13 @@ | |||
1878 | 89 | ball.close() | 92 | ball.close() |
1879 | 90 | 93 | ||
1880 | 91 | 94 | ||
1887 | 92 | def tgz_exporter(tree, dest, root, subdir, filtered=False): | 95 | def tgz_exporter(tree, dest, root, subdir, filtered=False, |
1888 | 93 | tar_exporter(tree, dest, root, subdir, compression='gz', filtered=filtered) | 96 | per_file_timestamps=False): |
1889 | 94 | 97 | tar_exporter(tree, dest, root, subdir, compression='gz', | |
1890 | 95 | 98 | filtered=filtered, per_file_timestamps=per_file_timestamps) | |
1891 | 96 | def tbz_exporter(tree, dest, root, subdir, filtered=False): | 99 | |
1892 | 97 | tar_exporter(tree, dest, root, subdir, compression='bz2', filtered=filtered) | 100 | |
1893 | 101 | def tbz_exporter(tree, dest, root, subdir, filtered=False, | ||
1894 | 102 | per_file_timestamps=False): | ||
1895 | 103 | tar_exporter(tree, dest, root, subdir, compression='bz2', | ||
1896 | 104 | filtered=filtered, per_file_timestamps=per_file_timestamps) | ||
1897 | 98 | 105 | ||
1898 | === modified file 'bzrlib/export/zip_exporter.py' | |||
1899 | --- bzrlib/export/zip_exporter.py 2009-11-25 00:14:05 +0000 | |||
1900 | +++ bzrlib/export/zip_exporter.py 2010-04-06 07:24:41 +0000 | |||
1901 | @@ -1,4 +1,4 @@ | |||
1903 | 1 | # Copyright (C) 2005 Canonical Ltd | 1 | # Copyright (C) 2005, 2006, 2008, 2009, 2010 Canonical Ltd |
1904 | 2 | # | 2 | # |
1905 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1906 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1907 | @@ -42,7 +42,8 @@ | |||
1908 | 42 | _DIR_ATTR = stat.S_IFDIR | ZIP_DIRECTORY_BIT | 42 | _DIR_ATTR = stat.S_IFDIR | ZIP_DIRECTORY_BIT |
1909 | 43 | 43 | ||
1910 | 44 | 44 | ||
1912 | 45 | def zip_exporter(tree, dest, root, subdir, filtered=False): | 45 | def zip_exporter(tree, dest, root, subdir, filtered=False, |
1913 | 46 | per_file_timestamps=False): | ||
1914 | 46 | """ Export this tree to a new zip file. | 47 | """ Export this tree to a new zip file. |
1915 | 47 | 48 | ||
1916 | 48 | `dest` will be created holding the contents of this tree; if it | 49 | `dest` will be created holding the contents of this tree; if it |
1917 | @@ -62,11 +63,15 @@ | |||
1918 | 62 | 63 | ||
1919 | 63 | # zipfile.ZipFile switches all paths to forward | 64 | # zipfile.ZipFile switches all paths to forward |
1920 | 64 | # slashes anyway, so just stick with that. | 65 | # slashes anyway, so just stick with that. |
1921 | 66 | if per_file_timestamps: | ||
1922 | 67 | mtime = tree.get_file_mtime(ie.file_id, dp) | ||
1923 | 68 | else: | ||
1924 | 69 | mtime = now | ||
1925 | 65 | filename = osutils.pathjoin(root, dp).encode('utf8') | 70 | filename = osutils.pathjoin(root, dp).encode('utf8') |
1926 | 66 | if ie.kind == "file": | 71 | if ie.kind == "file": |
1927 | 67 | zinfo = zipfile.ZipInfo( | 72 | zinfo = zipfile.ZipInfo( |
1928 | 68 | filename=filename, | 73 | filename=filename, |
1930 | 69 | date_time=now) | 74 | date_time=mtime) |
1931 | 70 | zinfo.compress_type = compression | 75 | zinfo.compress_type = compression |
1932 | 71 | zinfo.external_attr = _FILE_ATTR | 76 | zinfo.external_attr = _FILE_ATTR |
1933 | 72 | if filtered: | 77 | if filtered: |
1934 | @@ -84,14 +89,14 @@ | |||
1935 | 84 | # not just empty files. | 89 | # not just empty files. |
1936 | 85 | zinfo = zipfile.ZipInfo( | 90 | zinfo = zipfile.ZipInfo( |
1937 | 86 | filename=filename + '/', | 91 | filename=filename + '/', |
1939 | 87 | date_time=now) | 92 | date_time=mtime) |
1940 | 88 | zinfo.compress_type = compression | 93 | zinfo.compress_type = compression |
1941 | 89 | zinfo.external_attr = _DIR_ATTR | 94 | zinfo.external_attr = _DIR_ATTR |
1942 | 90 | zipf.writestr(zinfo,'') | 95 | zipf.writestr(zinfo,'') |
1943 | 91 | elif ie.kind == "symlink": | 96 | elif ie.kind == "symlink": |
1944 | 92 | zinfo = zipfile.ZipInfo( | 97 | zinfo = zipfile.ZipInfo( |
1945 | 93 | filename=(filename + '.lnk'), | 98 | filename=(filename + '.lnk'), |
1947 | 94 | date_time=now) | 99 | date_time=mtime) |
1948 | 95 | zinfo.compress_type = compression | 100 | zinfo.compress_type = compression |
1949 | 96 | zinfo.external_attr = _FILE_ATTR | 101 | zinfo.external_attr = _FILE_ATTR |
1950 | 97 | zipf.writestr(zinfo, ie.symlink_target) | 102 | zipf.writestr(zinfo, ie.symlink_target) |
1951 | 98 | 103 | ||
1952 | === modified file 'bzrlib/globbing.py' | |||
1953 | --- bzrlib/globbing.py 2010-01-11 16:44:02 +0000 | |||
1954 | +++ bzrlib/globbing.py 2010-04-06 07:24:41 +0000 | |||
1955 | @@ -1,4 +1,4 @@ | |||
1957 | 1 | # Copyright (C) 2006, 2008 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
1958 | 2 | 2 | ||
1959 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1960 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1961 | 5 | 5 | ||
1962 | === modified file 'bzrlib/graph.py' | |||
1963 | --- bzrlib/graph.py 2009-11-30 03:16:22 +0000 | |||
1964 | +++ bzrlib/graph.py 2010-04-06 07:24:41 +0000 | |||
1965 | @@ -1,4 +1,4 @@ | |||
1967 | 1 | # Copyright (C) 2007, 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
1968 | 2 | # | 2 | # |
1969 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1970 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1971 | 5 | 5 | ||
1972 | === modified file 'bzrlib/groupcompress.py' | |||
1973 | --- bzrlib/groupcompress.py 2009-12-01 03:35:25 +0000 | |||
1974 | +++ bzrlib/groupcompress.py 2010-04-06 07:24:41 +0000 | |||
1975 | @@ -1,4 +1,4 @@ | |||
1977 | 1 | # Copyright (C) 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
1978 | 2 | # | 2 | # |
1979 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1980 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1981 | 5 | 5 | ||
1982 | === modified file 'bzrlib/help.py' | |||
1983 | --- bzrlib/help.py 2009-12-02 15:24:34 +0000 | |||
1984 | +++ bzrlib/help.py 2010-04-06 07:24:41 +0000 | |||
1985 | @@ -1,4 +1,4 @@ | |||
1987 | 1 | # Copyright (C) 2004, 2005, 2006 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
1988 | 2 | # | 2 | # |
1989 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
1990 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
1991 | 5 | 5 | ||
1992 | === modified file 'bzrlib/help_topics/en/authentication.txt' | |||
1993 | --- bzrlib/help_topics/en/authentication.txt 2010-01-03 03:33:10 +0000 | |||
1994 | +++ bzrlib/help_topics/en/authentication.txt 2010-04-06 07:24:41 +0000 | |||
1995 | @@ -58,10 +58,10 @@ | |||
1996 | 58 | against a host. But, by using ``.htaccess`` files, for example, it is possible | 58 | against a host. But, by using ``.htaccess`` files, for example, it is possible |
1997 | 59 | to define several (``user, realm, password``) for a given ``host``. So what is | 59 | to define several (``user, realm, password``) for a given ``host``. So what is |
1998 | 60 | really needed is (``user``, ``password``, ``host``, ``path``). The ``realm`` is | 60 | really needed is (``user``, ``password``, ``host``, ``path``). The ``realm`` is |
2001 | 61 | not taken into account in the defitions, but will displayed if bzr prompts you | 61 | not taken into account in the definitions, but will displayed if bzr prompts |
2002 | 62 | for a password. | 62 | you for a password. |
2003 | 63 | 63 | ||
2005 | 64 | ``HTTP proxy`` can be handled as ``HTTP`` (or ``HTTPS``) by explicitely | 64 | ``HTTP proxy`` can be handled as ``HTTP`` (or ``HTTPS``) by explicitly |
2006 | 65 | specifying the appropriate port. | 65 | specifying the appropriate port. |
2007 | 66 | 66 | ||
2008 | 67 | To take all schemes into account, the password will be deduced from a set of | 67 | To take all schemes into account, the password will be deduced from a set of |
2009 | @@ -165,7 +165,7 @@ | |||
2010 | 165 | Source hosting provider | 165 | Source hosting provider |
2011 | 166 | ~~~~~~~~~~~~~~~~~~~~~~~ | 166 | ~~~~~~~~~~~~~~~~~~~~~~~ |
2012 | 167 | 167 | ||
2014 | 168 | In the shp.net (fictious) domain, each project has its own site:: | 168 | In the shp.net (fictitious) domain, each project has its own site:: |
2015 | 169 | 169 | ||
2016 | 170 | [shpnet domain] | 170 | [shpnet domain] |
2017 | 171 | # we use sftp, but ssh is the scheme used for authentication | 171 | # we use sftp, but ssh is the scheme used for authentication |
2018 | 172 | 172 | ||
2019 | === modified file 'bzrlib/help_topics/en/configuration.txt' | |||
2020 | --- bzrlib/help_topics/en/configuration.txt 2010-01-03 03:33:10 +0000 | |||
2021 | +++ bzrlib/help_topics/en/configuration.txt 2010-04-06 07:24:41 +0000 | |||
2022 | @@ -116,7 +116,49 @@ | |||
2023 | 116 | Overriding the default site plugin directory: | 116 | Overriding the default site plugin directory: |
2024 | 117 | ``BZR_PLUGIN_PATH='/path/to/my/site/plugins:-site':+user`` | 117 | ``BZR_PLUGIN_PATH='/path/to/my/site/plugins:-site':+user`` |
2025 | 118 | 118 | ||
2027 | 119 | 119 | BZR_DISABLE_PLUGINS | |
2028 | 120 | ~~~~~~~~~~~~~~~~~~~ | ||
2029 | 121 | |||
2030 | 122 | Under special circumstances (mostly when trying to diagnose a | ||
2031 | 123 | bug), it's better to disable a plugin (or several) rather than | ||
2032 | 124 | uninstalling them completely. Such plugins can be specified in | ||
2033 | 125 | the ``BZR_DISABLE_PLUGINS`` environment variable. | ||
2034 | 126 | |||
2035 | 127 | In that case, ``bzr`` will stop loading the specified plugins and | ||
2036 | 128 | will raise an import error if you try to import them explicitly. | ||
2037 | 129 | |||
2038 | 130 | Example: | ||
2039 | 131 | ~~~~~~~~ | ||
2040 | 132 | |||
2041 | 133 | Disabling ``myplugin`` and ``yourplugin``: | ||
2042 | 134 | ``BZR_DISABLE_PLUGINS='myplugin:yourplugin'`` | ||
2043 | 135 | |||
2044 | 136 | BZR_PLUGINS_AT | ||
2045 | 137 | ~~~~~~~~~~~~~~ | ||
2046 | 138 | |||
2047 | 139 | When adding a new feature or working on a bug in a plugin, | ||
2048 | 140 | developers often need to use a specific version of a given | ||
2049 | 141 | plugin. Since python requires that the directory containing the | ||
2050 | 142 | code is named like the plugin itself this make it impossible to | ||
2051 | 143 | use arbitrary directory names (using a two-level directory scheme | ||
2052 | 144 | is inconvenient). ``BZR_PLUGINS_AT`` allows such directories even | ||
2053 | 145 | if they don't appear in ``BZR_PLUGIN_PATH`` . | ||
2054 | 146 | |||
2055 | 147 | Plugins specified in this environment variable takes precedence | ||
2056 | 148 | over the ones in ``BZR_PLUGIN_PATH``. | ||
2057 | 149 | |||
2058 | 150 | The variable specified a list of ``plugin_name@plugin path``, | ||
2059 | 151 | ``plugin_name`` being the name of the plugin as it appears in | ||
2060 | 152 | python module paths, ``plugin_path`` being the path to the | ||
2061 | 153 | directory containing the plugin code itself | ||
2062 | 154 | (i.e. ``plugins/myplugin`` not ``plugins``). Use ':' as the list | ||
2063 | 155 | separator, use ';' on windows. | ||
2064 | 156 | |||
2065 | 157 | Example: | ||
2066 | 158 | ~~~~~~~~ | ||
2067 | 159 | |||
2068 | 160 | Using a specific version of ``myplugin``: | ||
2069 | 161 | ``BZR_PLUGINS_AT='myplugin@/home/me/bugfixes/123456-myplugin`` | ||
2070 | 120 | 162 | ||
2071 | 121 | BZRPATH | 163 | BZRPATH |
2072 | 122 | ~~~~~~~ | 164 | ~~~~~~~ |
2073 | 123 | 165 | ||
2074 | === modified file 'bzrlib/hooks.py' | |||
2075 | --- bzrlib/hooks.py 2010-01-15 03:58:20 +0000 | |||
2076 | +++ bzrlib/hooks.py 2010-04-06 07:24:41 +0000 | |||
2077 | @@ -1,4 +1,4 @@ | |||
2079 | 1 | # Copyright (C) 2007, 2008 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
2080 | 2 | # | 2 | # |
2081 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2082 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2083 | 5 | 5 | ||
2084 | === modified file 'bzrlib/index.py' | |||
2085 | --- bzrlib/index.py 2009-12-02 17:59:15 +0000 | |||
2086 | +++ bzrlib/index.py 2010-04-06 07:24:41 +0000 | |||
2087 | @@ -1,4 +1,4 @@ | |||
2089 | 1 | # Copyright (C) 2007, 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
2090 | 2 | # | 2 | # |
2091 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2092 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2093 | 5 | 5 | ||
2094 | === modified file 'bzrlib/info.py' | |||
2095 | --- bzrlib/info.py 2009-11-03 09:32:17 +0000 | |||
2096 | +++ bzrlib/info.py 2010-04-06 07:24:41 +0000 | |||
2097 | @@ -1,4 +1,4 @@ | |||
2099 | 1 | # Copyright (C) 2005, 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
2100 | 2 | # | 2 | # |
2101 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2102 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2103 | 5 | 5 | ||
2104 | === modified file 'bzrlib/inventory.py' | |||
2105 | --- bzrlib/inventory.py 2009-11-13 19:19:11 +0000 | |||
2106 | +++ bzrlib/inventory.py 2010-04-06 07:24:41 +0000 | |||
2107 | @@ -1,4 +1,4 @@ | |||
2109 | 1 | # Copyright (C) 2005, 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
2110 | 2 | # | 2 | # |
2111 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2112 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2113 | 5 | 5 | ||
2114 | === modified file 'bzrlib/lockdir.py' | |||
2115 | --- bzrlib/lockdir.py 2010-01-15 02:27:31 +0000 | |||
2116 | +++ bzrlib/lockdir.py 2010-04-06 07:24:41 +0000 | |||
2117 | @@ -1,4 +1,4 @@ | |||
2119 | 1 | # Copyright (C) 2006, 2007, 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
2120 | 2 | # | 2 | # |
2121 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2122 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2123 | @@ -252,7 +252,7 @@ | |||
2124 | 252 | if info is None: | 252 | if info is None: |
2125 | 253 | raise LockFailed(self, "lock was renamed into place, but " | 253 | raise LockFailed(self, "lock was renamed into place, but " |
2126 | 254 | "now is missing!") | 254 | "now is missing!") |
2128 | 255 | if info['nonce'] != self.nonce: | 255 | if info.get('nonce') != self.nonce: |
2129 | 256 | self._trace("rename succeeded, " | 256 | self._trace("rename succeeded, " |
2130 | 257 | "but lock is still held by someone else") | 257 | "but lock is still held by someone else") |
2131 | 258 | raise LockContention(self) | 258 | raise LockContention(self) |
2132 | @@ -430,7 +430,7 @@ | |||
2133 | 430 | def peek(self): | 430 | def peek(self): |
2134 | 431 | """Check if the lock is held by anyone. | 431 | """Check if the lock is held by anyone. |
2135 | 432 | 432 | ||
2137 | 433 | If it is held, this returns the lock info structure as a rio Stanza, | 433 | If it is held, this returns the lock info structure as a dict |
2138 | 434 | which contains some information about the current lock holder. | 434 | which contains some information about the current lock holder. |
2139 | 435 | Otherwise returns None. | 435 | Otherwise returns None. |
2140 | 436 | """ | 436 | """ |
2141 | @@ -459,8 +459,14 @@ | |||
2142 | 459 | return s.to_string() | 459 | return s.to_string() |
2143 | 460 | 460 | ||
2144 | 461 | def _parse_info(self, info_bytes): | 461 | def _parse_info(self, info_bytes): |
2147 | 462 | # TODO: Handle if info_bytes is empty | 462 | stanza = rio.read_stanza(osutils.split_lines(info_bytes)) |
2148 | 463 | return rio.read_stanza(osutils.split_lines(info_bytes)).as_dict() | 463 | if stanza is None: |
2149 | 464 | # see bug 185013; we fairly often end up with the info file being | ||
2150 | 465 | # empty after an interruption; we could log a message here but | ||
2151 | 466 | # there may not be much we can say | ||
2152 | 467 | return {} | ||
2153 | 468 | else: | ||
2154 | 469 | return stanza.as_dict() | ||
2155 | 464 | 470 | ||
2156 | 465 | def attempt_lock(self): | 471 | def attempt_lock(self): |
2157 | 466 | """Take the lock; fail if it's already held. | 472 | """Take the lock; fail if it's already held. |
2158 | @@ -611,11 +617,16 @@ | |||
2159 | 611 | def _format_lock_info(self, info): | 617 | def _format_lock_info(self, info): |
2160 | 612 | """Turn the contents of peek() into something for the user""" | 618 | """Turn the contents of peek() into something for the user""" |
2161 | 613 | lock_url = self.transport.abspath(self.path) | 619 | lock_url = self.transport.abspath(self.path) |
2163 | 614 | delta = time.time() - int(info['start_time']) | 620 | start_time = info.get('start_time') |
2164 | 621 | if start_time is None: | ||
2165 | 622 | time_ago = '(unknown)' | ||
2166 | 623 | else: | ||
2167 | 624 | time_ago = format_delta(time.time() - int(info['start_time'])) | ||
2168 | 615 | return [ | 625 | return [ |
2169 | 616 | 'lock %s' % (lock_url,), | 626 | 'lock %s' % (lock_url,), |
2172 | 617 | 'held by %(user)s on host %(hostname)s [process #%(pid)s]' % info, | 627 | 'held by %s on host %s [process #%s]' % |
2173 | 618 | 'locked %s' % (format_delta(delta),), | 628 | tuple([info.get(x, '<unknown>') for x in ['user', 'hostname', 'pid']]), |
2174 | 629 | 'locked %s' % (time_ago,), | ||
2175 | 619 | ] | 630 | ] |
2176 | 620 | 631 | ||
2177 | 621 | def validate_token(self, token): | 632 | def validate_token(self, token): |
2178 | 622 | 633 | ||
2179 | === modified file 'bzrlib/merge.py' | |||
2180 | --- bzrlib/merge.py 2010-02-12 12:22:11 +0000 | |||
2181 | +++ bzrlib/merge.py 2010-04-06 07:24:41 +0000 | |||
2182 | @@ -130,7 +130,7 @@ | |||
2183 | 130 | """ | 130 | """ |
2184 | 131 | affected_files = self.affected_files | 131 | affected_files = self.affected_files |
2185 | 132 | if affected_files is None: | 132 | if affected_files is None: |
2187 | 133 | config = self.merger.this_tree.branch.get_config() | 133 | config = self.merger.this_branch.get_config() |
2188 | 134 | # Until bzr provides a better policy for caching the config, we | 134 | # Until bzr provides a better policy for caching the config, we |
2189 | 135 | # just add the part we're interested in to the params to avoid | 135 | # just add the part we're interested in to the params to avoid |
2190 | 136 | # reading the config files repeatedly (bazaar.conf, location.conf, | 136 | # reading the config files repeatedly (bazaar.conf, location.conf, |
2191 | @@ -1173,6 +1173,7 @@ | |||
2192 | 1173 | return 'conflict' | 1173 | return 'conflict' |
2193 | 1174 | 1174 | ||
2194 | 1175 | @staticmethod | 1175 | @staticmethod |
2195 | 1176 | @deprecated_method(deprecated_in((2, 2, 0))) | ||
2196 | 1176 | def scalar_three_way(this_tree, base_tree, other_tree, file_id, key): | 1177 | def scalar_three_way(this_tree, base_tree, other_tree, file_id, key): |
2197 | 1177 | """Do a three-way test on a scalar. | 1178 | """Do a three-way test on a scalar. |
2198 | 1178 | Return "this", "other" or "conflict", depending whether a value wins. | 1179 | Return "this", "other" or "conflict", depending whether a value wins. |
2199 | 1179 | 1180 | ||
2200 | === modified file 'bzrlib/merge_directive.py' | |||
2201 | --- bzrlib/merge_directive.py 2009-11-28 00:48:03 +0000 | |||
2202 | +++ bzrlib/merge_directive.py 2010-04-06 07:24:41 +0000 | |||
2203 | @@ -1,4 +1,4 @@ | |||
2205 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
2206 | 2 | # | 2 | # |
2207 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2208 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2209 | 5 | 5 | ||
2210 | === modified file 'bzrlib/msgeditor.py' | |||
2211 | --- bzrlib/msgeditor.py 2010-01-12 04:31:02 +0000 | |||
2212 | +++ bzrlib/msgeditor.py 2010-04-06 07:24:41 +0000 | |||
2213 | @@ -1,4 +1,4 @@ | |||
2215 | 1 | # Copyright (C) 2005, 2006, 2009 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
2216 | 2 | # | 2 | # |
2217 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2218 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2219 | 5 | 5 | ||
2220 | === modified file 'bzrlib/osutils.py' | |||
2221 | --- bzrlib/osutils.py 2010-02-11 16:32:32 +0000 | |||
2222 | +++ bzrlib/osutils.py 2010-04-06 07:24:41 +0000 | |||
2223 | @@ -21,11 +21,11 @@ | |||
2224 | 21 | S_ISCHR, S_ISBLK, S_ISFIFO, S_ISSOCK) | 21 | S_ISCHR, S_ISBLK, S_ISFIFO, S_ISSOCK) |
2225 | 22 | import sys | 22 | import sys |
2226 | 23 | import time | 23 | import time |
2227 | 24 | import codecs | ||
2228 | 24 | import warnings | 25 | import warnings |
2229 | 25 | 26 | ||
2230 | 26 | from bzrlib.lazy_import import lazy_import | 27 | from bzrlib.lazy_import import lazy_import |
2231 | 27 | lazy_import(globals(), """ | 28 | lazy_import(globals(), """ |
2232 | 28 | import codecs | ||
2233 | 29 | from datetime import datetime | 29 | from datetime import datetime |
2234 | 30 | import errno | 30 | import errno |
2235 | 31 | from ntpath import (abspath as _nt_abspath, | 31 | from ntpath import (abspath as _nt_abspath, |
2236 | @@ -85,8 +85,11 @@ | |||
2237 | 85 | # be opened in binary mode, rather than text mode. | 85 | # be opened in binary mode, rather than text mode. |
2238 | 86 | # On other platforms, O_BINARY doesn't exist, because | 86 | # On other platforms, O_BINARY doesn't exist, because |
2239 | 87 | # they always open in binary mode, so it is okay to | 87 | # they always open in binary mode, so it is okay to |
2241 | 88 | # OR with 0 on those platforms | 88 | # OR with 0 on those platforms. |
2242 | 89 | # O_NOINHERIT and O_TEXT exists only on win32 too. | ||
2243 | 89 | O_BINARY = getattr(os, 'O_BINARY', 0) | 90 | O_BINARY = getattr(os, 'O_BINARY', 0) |
2244 | 91 | O_TEXT = getattr(os, 'O_TEXT', 0) | ||
2245 | 92 | O_NOINHERIT = getattr(os, 'O_NOINHERIT', 0) | ||
2246 | 90 | 93 | ||
2247 | 91 | 94 | ||
2248 | 92 | def get_unicode_argv(): | 95 | def get_unicode_argv(): |
2249 | @@ -663,7 +666,7 @@ | |||
2250 | 663 | def sha_file_by_name(fname): | 666 | def sha_file_by_name(fname): |
2251 | 664 | """Calculate the SHA1 of a file by reading the full text""" | 667 | """Calculate the SHA1 of a file by reading the full text""" |
2252 | 665 | s = sha() | 668 | s = sha() |
2254 | 666 | f = os.open(fname, os.O_RDONLY | O_BINARY) | 669 | f = os.open(fname, os.O_RDONLY | O_BINARY | O_NOINHERIT) |
2255 | 667 | try: | 670 | try: |
2256 | 668 | while True: | 671 | while True: |
2257 | 669 | b = os.read(f, 1<<16) | 672 | b = os.read(f, 1<<16) |
2258 | @@ -1346,6 +1349,27 @@ | |||
2259 | 1346 | normalized_filename = _inaccessible_normalized_filename | 1349 | normalized_filename = _inaccessible_normalized_filename |
2260 | 1347 | 1350 | ||
2261 | 1348 | 1351 | ||
2262 | 1352 | def set_signal_handler(signum, handler, restart_syscall=True): | ||
2263 | 1353 | """A wrapper for signal.signal that also calls siginterrupt(signum, False) | ||
2264 | 1354 | on platforms that support that. | ||
2265 | 1355 | |||
2266 | 1356 | :param restart_syscall: if set, allow syscalls interrupted by a signal to | ||
2267 | 1357 | automatically restart (by calling `signal.siginterrupt(signum, | ||
2268 | 1358 | False)`). May be ignored if the feature is not available on this | ||
2269 | 1359 | platform or Python version. | ||
2270 | 1360 | """ | ||
2271 | 1361 | old_handler = signal.signal(signum, handler) | ||
2272 | 1362 | if restart_syscall: | ||
2273 | 1363 | try: | ||
2274 | 1364 | siginterrupt = signal.siginterrupt | ||
2275 | 1365 | except AttributeError: # siginterrupt doesn't exist on this platform, or for this version of | ||
2276 | 1366 | # Python. | ||
2277 | 1367 | pass | ||
2278 | 1368 | else: | ||
2279 | 1369 | siginterrupt(signum, False) | ||
2280 | 1370 | return old_handler | ||
2281 | 1371 | |||
2282 | 1372 | |||
2283 | 1349 | default_terminal_width = 80 | 1373 | default_terminal_width = 80 |
2284 | 1350 | """The default terminal width for ttys. | 1374 | """The default terminal width for ttys. |
2285 | 1351 | 1375 | ||
2286 | @@ -1440,12 +1464,21 @@ | |||
2287 | 1440 | if width is not None: | 1464 | if width is not None: |
2288 | 1441 | os.environ['COLUMNS'] = str(width) | 1465 | os.environ['COLUMNS'] = str(width) |
2289 | 1442 | 1466 | ||
2296 | 1443 | if sys.platform == 'win32': | 1467 | |
2297 | 1444 | # Martin (gz) mentioned WINDOW_BUFFER_SIZE_RECORD from ReadConsoleInput but | 1468 | _registered_sigwinch = False |
2298 | 1445 | # I've no idea how to plug that in the current design -- vila 20091216 | 1469 | |
2299 | 1446 | pass | 1470 | def watch_sigwinch(): |
2300 | 1447 | else: | 1471 | """Register for SIGWINCH, once and only once.""" |
2301 | 1448 | signal.signal(signal.SIGWINCH, _terminal_size_changed) | 1472 | global _registered_sigwinch |
2302 | 1473 | if not _registered_sigwinch: | ||
2303 | 1474 | if sys.platform == 'win32': | ||
2304 | 1475 | # Martin (gz) mentioned WINDOW_BUFFER_SIZE_RECORD from | ||
2305 | 1476 | # ReadConsoleInput but I've no idea how to plug that in | ||
2306 | 1477 | # the current design -- vila 20091216 | ||
2307 | 1478 | pass | ||
2308 | 1479 | else: | ||
2309 | 1480 | set_signal_handler(signal.SIGWINCH, _terminal_size_changed) | ||
2310 | 1481 | _registered_sigwinch = True | ||
2311 | 1449 | 1482 | ||
2312 | 1450 | 1483 | ||
2313 | 1451 | def supports_executable(): | 1484 | def supports_executable(): |
2314 | @@ -2108,3 +2141,46 @@ | |||
2315 | 2108 | else: | 2141 | else: |
2316 | 2109 | data, _ = self.encode(object, self.errors) | 2142 | data, _ = self.encode(object, self.errors) |
2317 | 2110 | self.stream.write(data) | 2143 | self.stream.write(data) |
2318 | 2144 | |||
2319 | 2145 | if sys.platform == 'win32': | ||
2320 | 2146 | def open_file(filename, mode='r', bufsize=-1): | ||
2321 | 2147 | """This function is used to override the ``open`` builtin. | ||
2322 | 2148 | |||
2323 | 2149 | But it uses O_NOINHERIT flag so the file handle is not inherited by | ||
2324 | 2150 | child processes. Deleting or renaming a closed file opened with this | ||
2325 | 2151 | function is not blocking child processes. | ||
2326 | 2152 | """ | ||
2327 | 2153 | writing = 'w' in mode | ||
2328 | 2154 | appending = 'a' in mode | ||
2329 | 2155 | updating = '+' in mode | ||
2330 | 2156 | binary = 'b' in mode | ||
2331 | 2157 | |||
2332 | 2158 | flags = O_NOINHERIT | ||
2333 | 2159 | # see http://msdn.microsoft.com/en-us/library/yeby3zcb%28VS.71%29.aspx | ||
2334 | 2160 | # for flags for each modes. | ||
2335 | 2161 | if binary: | ||
2336 | 2162 | flags |= O_BINARY | ||
2337 | 2163 | else: | ||
2338 | 2164 | flags |= O_TEXT | ||
2339 | 2165 | |||
2340 | 2166 | if writing: | ||
2341 | 2167 | if updating: | ||
2342 | 2168 | flags |= os.O_RDWR | ||
2343 | 2169 | else: | ||
2344 | 2170 | flags |= os.O_WRONLY | ||
2345 | 2171 | flags |= os.O_CREAT | os.O_TRUNC | ||
2346 | 2172 | elif appending: | ||
2347 | 2173 | if updating: | ||
2348 | 2174 | flags |= os.O_RDWR | ||
2349 | 2175 | else: | ||
2350 | 2176 | flags |= os.O_WRONLY | ||
2351 | 2177 | flags |= os.O_CREAT | os.O_APPEND | ||
2352 | 2178 | else: #reading | ||
2353 | 2179 | if updating: | ||
2354 | 2180 | flags |= os.O_RDWR | ||
2355 | 2181 | else: | ||
2356 | 2182 | flags |= os.O_RDONLY | ||
2357 | 2183 | |||
2358 | 2184 | return os.fdopen(os.open(filename, flags), mode, bufsize) | ||
2359 | 2185 | else: | ||
2360 | 2186 | open_file = open | ||
2361 | 2111 | 2187 | ||
2362 | === modified file 'bzrlib/patches.py' | |||
2363 | --- bzrlib/patches.py 2009-11-03 15:45:56 +0000 | |||
2364 | +++ bzrlib/patches.py 2010-04-06 07:24:41 +0000 | |||
2365 | @@ -1,4 +1,4 @@ | |||
2367 | 1 | # Copyright (C) 2004 - 2006, 2008 Aaron Bentley, Canonical Ltd | 1 | # Copyright (C) 2005-2010 Aaron Bentley, Canonical Ltd |
2368 | 2 | # <aaron.bentley@utoronto.ca> | 2 | # <aaron.bentley@utoronto.ca> |
2369 | 3 | # | 3 | # |
2370 | 4 | # This program is free software; you can redistribute it and/or modify | 4 | # This program is free software; you can redistribute it and/or modify |
2371 | @@ -250,7 +250,13 @@ | |||
2372 | 250 | return shift | 250 | return shift |
2373 | 251 | 251 | ||
2374 | 252 | 252 | ||
2376 | 253 | def iter_hunks(iter_lines): | 253 | def iter_hunks(iter_lines, allow_dirty=False): |
2377 | 254 | ''' | ||
2378 | 255 | :arg iter_lines: iterable of lines to parse for hunks | ||
2379 | 256 | :kwarg allow_dirty: If True, when we encounter something that is not | ||
2380 | 257 | a hunk header when we're looking for one, assume the rest of the lines | ||
2381 | 258 | are not part of the patch (comments or other junk). Default False | ||
2382 | 259 | ''' | ||
2383 | 254 | hunk = None | 260 | hunk = None |
2384 | 255 | for line in iter_lines: | 261 | for line in iter_lines: |
2385 | 256 | if line == "\n": | 262 | if line == "\n": |
2386 | @@ -260,7 +266,15 @@ | |||
2387 | 260 | continue | 266 | continue |
2388 | 261 | if hunk is not None: | 267 | if hunk is not None: |
2389 | 262 | yield hunk | 268 | yield hunk |
2391 | 263 | hunk = hunk_from_header(line) | 269 | try: |
2392 | 270 | hunk = hunk_from_header(line) | ||
2393 | 271 | except MalformedHunkHeader: | ||
2394 | 272 | if allow_dirty: | ||
2395 | 273 | # If the line isn't a hunk header, then we've reached the end | ||
2396 | 274 | # of this patch and there's "junk" at the end. Ignore the | ||
2397 | 275 | # rest of this patch. | ||
2398 | 276 | return | ||
2399 | 277 | raise | ||
2400 | 264 | orig_size = 0 | 278 | orig_size = 0 |
2401 | 265 | mod_size = 0 | 279 | mod_size = 0 |
2402 | 266 | while orig_size < hunk.orig_range or mod_size < hunk.mod_range: | 280 | while orig_size < hunk.orig_range or mod_size < hunk.mod_range: |
2403 | @@ -339,7 +353,12 @@ | |||
2404 | 339 | pos += 1 | 353 | pos += 1 |
2405 | 340 | 354 | ||
2406 | 341 | 355 | ||
2408 | 342 | def parse_patch(iter_lines): | 356 | def parse_patch(iter_lines, allow_dirty=False): |
2409 | 357 | ''' | ||
2410 | 358 | :arg iter_lines: iterable of lines to parse | ||
2411 | 359 | :kwarg allow_dirty: If True, allow the patch to have trailing junk. | ||
2412 | 360 | Default False | ||
2413 | 361 | ''' | ||
2414 | 343 | iter_lines = iter_lines_handle_nl(iter_lines) | 362 | iter_lines = iter_lines_handle_nl(iter_lines) |
2415 | 344 | try: | 363 | try: |
2416 | 345 | (orig_name, mod_name) = get_patch_names(iter_lines) | 364 | (orig_name, mod_name) = get_patch_names(iter_lines) |
2417 | @@ -347,15 +366,29 @@ | |||
2418 | 347 | return BinaryPatch(e.orig_name, e.mod_name) | 366 | return BinaryPatch(e.orig_name, e.mod_name) |
2419 | 348 | else: | 367 | else: |
2420 | 349 | patch = Patch(orig_name, mod_name) | 368 | patch = Patch(orig_name, mod_name) |
2422 | 350 | for hunk in iter_hunks(iter_lines): | 369 | for hunk in iter_hunks(iter_lines, allow_dirty): |
2423 | 351 | patch.hunks.append(hunk) | 370 | patch.hunks.append(hunk) |
2424 | 352 | return patch | 371 | return patch |
2425 | 353 | 372 | ||
2426 | 354 | 373 | ||
2428 | 355 | def iter_file_patch(iter_lines): | 374 | def iter_file_patch(iter_lines, allow_dirty=False): |
2429 | 375 | ''' | ||
2430 | 376 | :arg iter_lines: iterable of lines to parse for patches | ||
2431 | 377 | :kwarg allow_dirty: If True, allow comments and other non-patch text | ||
2432 | 378 | before the first patch. Note that the algorithm here can only find | ||
2433 | 379 | such text before any patches have been found. Comments after the | ||
2434 | 380 | first patch are stripped away in iter_hunks() if it is also passed | ||
2435 | 381 | allow_dirty=True. Default False. | ||
2436 | 382 | ''' | ||
2437 | 383 | ### FIXME: Docstring is not quite true. We allow certain comments no | ||
2438 | 384 | # matter what, If they startwith '===', '***', or '#' Someone should | ||
2439 | 385 | # reexamine this logic and decide if we should include those in | ||
2440 | 386 | # allow_dirty or restrict those to only being before the patch is found | ||
2441 | 387 | # (as allow_dirty does). | ||
2442 | 356 | regex = re.compile(binary_files_re) | 388 | regex = re.compile(binary_files_re) |
2443 | 357 | saved_lines = [] | 389 | saved_lines = [] |
2444 | 358 | orig_range = 0 | 390 | orig_range = 0 |
2445 | 391 | beginning = True | ||
2446 | 359 | for line in iter_lines: | 392 | for line in iter_lines: |
2447 | 360 | if line.startswith('=== ') or line.startswith('*** '): | 393 | if line.startswith('=== ') or line.startswith('*** '): |
2448 | 361 | continue | 394 | continue |
2449 | @@ -365,7 +398,12 @@ | |||
2450 | 365 | if line.startswith('-') or line.startswith(' '): | 398 | if line.startswith('-') or line.startswith(' '): |
2451 | 366 | orig_range -= 1 | 399 | orig_range -= 1 |
2452 | 367 | elif line.startswith('--- ') or regex.match(line): | 400 | elif line.startswith('--- ') or regex.match(line): |
2454 | 368 | if len(saved_lines) > 0: | 401 | if allow_dirty and beginning: |
2455 | 402 | # Patches can have "junk" at the beginning | ||
2456 | 403 | # Stripping junk from the end of patches is handled when we | ||
2457 | 404 | # parse the patch | ||
2458 | 405 | beginning = False | ||
2459 | 406 | elif len(saved_lines) > 0: | ||
2460 | 369 | yield saved_lines | 407 | yield saved_lines |
2461 | 370 | saved_lines = [] | 408 | saved_lines = [] |
2462 | 371 | elif line.startswith('@@'): | 409 | elif line.startswith('@@'): |
2463 | @@ -397,8 +435,15 @@ | |||
2464 | 397 | yield last_line | 435 | yield last_line |
2465 | 398 | 436 | ||
2466 | 399 | 437 | ||
2469 | 400 | def parse_patches(iter_lines): | 438 | def parse_patches(iter_lines, allow_dirty=False): |
2470 | 401 | return [parse_patch(f.__iter__()) for f in iter_file_patch(iter_lines)] | 439 | ''' |
2471 | 440 | :arg iter_lines: iterable of lines to parse for patches | ||
2472 | 441 | :kwarg allow_dirty: If True, allow text that's not part of the patch at | ||
2473 | 442 | selected places. This includes comments before and after a patch | ||
2474 | 443 | for instance. Default False. | ||
2475 | 444 | ''' | ||
2476 | 445 | return [parse_patch(f.__iter__(), allow_dirty) for f in | ||
2477 | 446 | iter_file_patch(iter_lines, allow_dirty)] | ||
2478 | 402 | 447 | ||
2479 | 403 | 448 | ||
2480 | 404 | def difference_index(atext, btext): | 449 | def difference_index(atext, btext): |
2481 | 405 | 450 | ||
2482 | === modified file 'bzrlib/plugin.py' | |||
2483 | --- bzrlib/plugin.py 2010-02-10 02:03:20 +0000 | |||
2484 | +++ bzrlib/plugin.py 2010-04-06 07:24:41 +0000 | |||
2485 | @@ -1,4 +1,4 @@ | |||
2487 | 1 | # Copyright (C) 2004, 2005, 2007, 2008, 2010 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
2488 | 2 | # | 2 | # |
2489 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2490 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2491 | @@ -67,15 +67,6 @@ | |||
2492 | 67 | return _plugins_disabled | 67 | return _plugins_disabled |
2493 | 68 | 68 | ||
2494 | 69 | 69 | ||
2495 | 70 | @deprecated_function(deprecated_in((2, 0, 0))) | ||
2496 | 71 | def get_default_plugin_path(): | ||
2497 | 72 | """Get the DEFAULT_PLUGIN_PATH""" | ||
2498 | 73 | global DEFAULT_PLUGIN_PATH | ||
2499 | 74 | if DEFAULT_PLUGIN_PATH is None: | ||
2500 | 75 | DEFAULT_PLUGIN_PATH = osutils.pathjoin(config.config_dir(), 'plugins') | ||
2501 | 76 | return DEFAULT_PLUGIN_PATH | ||
2502 | 77 | |||
2503 | 78 | |||
2504 | 79 | def disable_plugins(): | 70 | def disable_plugins(): |
2505 | 80 | """Disable loading plugins. | 71 | """Disable loading plugins. |
2506 | 81 | 72 | ||
2507 | @@ -100,6 +91,19 @@ | |||
2508 | 100 | if path is None: | 91 | if path is None: |
2509 | 101 | path = get_standard_plugins_path() | 92 | path = get_standard_plugins_path() |
2510 | 102 | _mod_plugins.__path__ = path | 93 | _mod_plugins.__path__ = path |
2511 | 94 | PluginImporter.reset() | ||
2512 | 95 | # Set up a blacklist for disabled plugins | ||
2513 | 96 | disabled_plugins = os.environ.get('BZR_DISABLE_PLUGINS', None) | ||
2514 | 97 | if disabled_plugins is not None: | ||
2515 | 98 | for name in disabled_plugins.split(os.pathsep): | ||
2516 | 99 | PluginImporter.blacklist.add('bzrlib.plugins.' + name) | ||
2517 | 100 | # Set up a the specific paths for plugins | ||
2518 | 101 | specific_plugins = os.environ.get('BZR_PLUGINS_AT', None) | ||
2519 | 102 | if specific_plugins is not None: | ||
2520 | 103 | for spec in specific_plugins.split(os.pathsep): | ||
2521 | 104 | plugin_name, plugin_path = spec.split('@') | ||
2522 | 105 | PluginImporter.specific_paths[ | ||
2523 | 106 | 'bzrlib.plugins.%s' % plugin_name] = plugin_path | ||
2524 | 103 | return path | 107 | return path |
2525 | 104 | 108 | ||
2526 | 105 | 109 | ||
2527 | @@ -188,12 +192,12 @@ | |||
2528 | 188 | paths = [] | 192 | paths = [] |
2529 | 189 | for p in env_paths + defaults: | 193 | for p in env_paths + defaults: |
2530 | 190 | if p.startswith('+'): | 194 | if p.startswith('+'): |
2532 | 191 | # Resolve reference if they are known | 195 | # Resolve references if they are known |
2533 | 192 | try: | 196 | try: |
2534 | 193 | p = refs[p[1:]] | 197 | p = refs[p[1:]] |
2535 | 194 | except KeyError: | 198 | except KeyError: |
2538 | 195 | # Leave them untouched otherwise, user may have paths starting | 199 | # Leave them untouched so user can still use paths starting |
2539 | 196 | # with '+'... | 200 | # with '+' |
2540 | 197 | pass | 201 | pass |
2541 | 198 | _append_new_path(paths, p) | 202 | _append_new_path(paths, p) |
2542 | 199 | 203 | ||
2543 | @@ -211,7 +215,7 @@ | |||
2544 | 211 | files (and whatever other extensions are used in the platform, | 215 | files (and whatever other extensions are used in the platform, |
2545 | 212 | such as *.pyd). | 216 | such as *.pyd). |
2546 | 213 | 217 | ||
2548 | 214 | load_from_dirs() provides the underlying mechanism and is called with | 218 | load_from_path() provides the underlying mechanism and is called with |
2549 | 215 | the default directory list to provide the normal behaviour. | 219 | the default directory list to provide the normal behaviour. |
2550 | 216 | 220 | ||
2551 | 217 | :param path: The list of paths to search for plugins. By default, | 221 | :param path: The list of paths to search for plugins. By default, |
2552 | @@ -240,6 +244,11 @@ | |||
2553 | 240 | 244 | ||
2554 | 241 | The python module path for bzrlib.plugins will be modified to be 'dirs'. | 245 | The python module path for bzrlib.plugins will be modified to be 'dirs'. |
2555 | 242 | """ | 246 | """ |
2556 | 247 | # Explicitly load the plugins with a specific path | ||
2557 | 248 | for fullname, path in PluginImporter.specific_paths.iteritems(): | ||
2558 | 249 | name = fullname[len('bzrlib.plugins.'):] | ||
2559 | 250 | _load_plugin_module(name, path) | ||
2560 | 251 | |||
2561 | 243 | # We need to strip the trailing separators here as well as in the | 252 | # We need to strip the trailing separators here as well as in the |
2562 | 244 | # set_plugins_path function because calling code can pass anything in to | 253 | # set_plugins_path function because calling code can pass anything in to |
2563 | 245 | # this function, and since it sets plugins.__path__, it should set it to | 254 | # this function, and since it sets plugins.__path__, it should set it to |
2564 | @@ -259,70 +268,99 @@ | |||
2565 | 259 | load_from_dirs = load_from_path | 268 | load_from_dirs = load_from_path |
2566 | 260 | 269 | ||
2567 | 261 | 270 | ||
2568 | 271 | def _find_plugin_module(dir, name): | ||
2569 | 272 | """Check if there is a valid python module that can be loaded as a plugin. | ||
2570 | 273 | |||
2571 | 274 | :param dir: The directory where the search is performed. | ||
2572 | 275 | :param path: An existing file path, either a python file or a package | ||
2573 | 276 | directory. | ||
2574 | 277 | |||
2575 | 278 | :return: (name, path, description) name is the module name, path is the | ||
2576 | 279 | file to load and description is the tuple returned by | ||
2577 | 280 | imp.get_suffixes(). | ||
2578 | 281 | """ | ||
2579 | 282 | path = osutils.pathjoin(dir, name) | ||
2580 | 283 | if os.path.isdir(path): | ||
2581 | 284 | # Check for a valid __init__.py file, valid suffixes depends on -O and | ||
2582 | 285 | # can be .py, .pyc and .pyo | ||
2583 | 286 | for suffix, mode, kind in imp.get_suffixes(): | ||
2584 | 287 | if kind not in (imp.PY_SOURCE, imp.PY_COMPILED): | ||
2585 | 288 | # We don't recognize compiled modules (.so, .dll, etc) | ||
2586 | 289 | continue | ||
2587 | 290 | init_path = osutils.pathjoin(path, '__init__' + suffix) | ||
2588 | 291 | if os.path.isfile(init_path): | ||
2589 | 292 | return name, init_path, (suffix, mode, kind) | ||
2590 | 293 | else: | ||
2591 | 294 | for suffix, mode, kind in imp.get_suffixes(): | ||
2592 | 295 | if name.endswith(suffix): | ||
2593 | 296 | # Clean up the module name | ||
2594 | 297 | name = name[:-len(suffix)] | ||
2595 | 298 | if kind == imp.C_EXTENSION and name.endswith('module'): | ||
2596 | 299 | name = name[:-len('module')] | ||
2597 | 300 | return name, path, (suffix, mode, kind) | ||
2598 | 301 | # There is no python module here | ||
2599 | 302 | return None, None, (None, None, None) | ||
2600 | 303 | |||
2601 | 304 | |||
2602 | 305 | def _load_plugin_module(name, dir): | ||
2603 | 306 | """Load plugin name from dir. | ||
2604 | 307 | |||
2605 | 308 | :param name: The plugin name in the bzrlib.plugins namespace. | ||
2606 | 309 | :param dir: The directory the plugin is loaded from for error messages. | ||
2607 | 310 | """ | ||
2608 | 311 | if ('bzrlib.plugins.%s' % name) in PluginImporter.blacklist: | ||
2609 | 312 | return | ||
2610 | 313 | try: | ||
2611 | 314 | exec "import bzrlib.plugins.%s" % name in {} | ||
2612 | 315 | except KeyboardInterrupt: | ||
2613 | 316 | raise | ||
2614 | 317 | except errors.IncompatibleAPI, e: | ||
2615 | 318 | trace.warning("Unable to load plugin %r. It requested API version " | ||
2616 | 319 | "%s of module %s but the minimum exported version is %s, and " | ||
2617 | 320 | "the maximum is %s" % | ||
2618 | 321 | (name, e.wanted, e.api, e.minimum, e.current)) | ||
2619 | 322 | except Exception, e: | ||
2620 | 323 | trace.warning("%s" % e) | ||
2621 | 324 | if re.search('\.|-| ', name): | ||
2622 | 325 | sanitised_name = re.sub('[-. ]', '_', name) | ||
2623 | 326 | if sanitised_name.startswith('bzr_'): | ||
2624 | 327 | sanitised_name = sanitised_name[len('bzr_'):] | ||
2625 | 328 | trace.warning("Unable to load %r in %r as a plugin because the " | ||
2626 | 329 | "file path isn't a valid module name; try renaming " | ||
2627 | 330 | "it to %r." % (name, dir, sanitised_name)) | ||
2628 | 331 | else: | ||
2629 | 332 | trace.warning('Unable to load plugin %r from %r' % (name, dir)) | ||
2630 | 333 | trace.log_exception_quietly() | ||
2631 | 334 | if 'error' in debug.debug_flags: | ||
2632 | 335 | trace.print_exception(sys.exc_info(), sys.stderr) | ||
2633 | 336 | |||
2634 | 337 | |||
2635 | 262 | def load_from_dir(d): | 338 | def load_from_dir(d): |
2636 | 263 | """Load the plugins in directory d. | 339 | """Load the plugins in directory d. |
2637 | 264 | 340 | ||
2638 | 265 | d must be in the plugins module path already. | 341 | d must be in the plugins module path already. |
2639 | 342 | This function is called once for each directory in the module path. | ||
2640 | 266 | """ | 343 | """ |
2641 | 267 | # Get the list of valid python suffixes for __init__.py? | ||
2642 | 268 | # this includes .py, .pyc, and .pyo (depending on if we are running -O) | ||
2643 | 269 | # but it doesn't include compiled modules (.so, .dll, etc) | ||
2644 | 270 | valid_suffixes = [suffix for suffix, mod_type, flags in imp.get_suffixes() | ||
2645 | 271 | if flags in (imp.PY_SOURCE, imp.PY_COMPILED)] | ||
2646 | 272 | package_entries = ['__init__'+suffix for suffix in valid_suffixes] | ||
2647 | 273 | plugin_names = set() | 344 | plugin_names = set() |
2665 | 274 | for f in os.listdir(d): | 345 | for p in os.listdir(d): |
2666 | 275 | path = osutils.pathjoin(d, f) | 346 | name, path, desc = _find_plugin_module(d, p) |
2667 | 276 | if os.path.isdir(path): | 347 | if name is not None: |
2668 | 277 | for entry in package_entries: | 348 | if name == '__init__': |
2669 | 278 | # This directory should be a package, and thus added to | 349 | # We do nothing with the __init__.py file in directories from |
2670 | 279 | # the list | 350 | # the bzrlib.plugins module path, we may want to, one day |
2671 | 280 | if os.path.isfile(osutils.pathjoin(path, entry)): | 351 | # -- vila 20100316. |
2672 | 281 | break | 352 | continue # We don't load __init__.py in the plugins dirs |
2673 | 282 | else: # This directory is not a package | 353 | elif getattr(_mod_plugins, name, None) is not None: |
2674 | 283 | continue | 354 | # The module has already been loaded from another directory |
2675 | 284 | else: | 355 | # during a previous call. |
2676 | 285 | for suffix_info in imp.get_suffixes(): | 356 | # FIXME: There should be a better way to report masked plugins |
2677 | 286 | if f.endswith(suffix_info[0]): | 357 | # -- vila 20100316 |
2678 | 287 | f = f[:-len(suffix_info[0])] | 358 | trace.mutter('Plugin name %s already loaded', name) |
2662 | 288 | if suffix_info[2] == imp.C_EXTENSION and f.endswith('module'): | ||
2663 | 289 | f = f[:-len('module')] | ||
2664 | 290 | break | ||
2679 | 291 | else: | 359 | else: |
2688 | 292 | continue | 360 | plugin_names.add(name) |
2681 | 293 | if f == '__init__': | ||
2682 | 294 | continue # We don't load __init__.py again in the plugin dir | ||
2683 | 295 | elif getattr(_mod_plugins, f, None): | ||
2684 | 296 | trace.mutter('Plugin name %s already loaded', f) | ||
2685 | 297 | else: | ||
2686 | 298 | # trace.mutter('add plugin name %s', f) | ||
2687 | 299 | plugin_names.add(f) | ||
2689 | 300 | 361 | ||
2690 | 301 | for name in plugin_names: | 362 | for name in plugin_names: |
2715 | 302 | try: | 363 | _load_plugin_module(name, d) |
2692 | 303 | exec "import bzrlib.plugins.%s" % name in {} | ||
2693 | 304 | except KeyboardInterrupt: | ||
2694 | 305 | raise | ||
2695 | 306 | except errors.IncompatibleAPI, e: | ||
2696 | 307 | trace.warning("Unable to load plugin %r. It requested API version " | ||
2697 | 308 | "%s of module %s but the minimum exported version is %s, and " | ||
2698 | 309 | "the maximum is %s" % | ||
2699 | 310 | (name, e.wanted, e.api, e.minimum, e.current)) | ||
2700 | 311 | except Exception, e: | ||
2701 | 312 | trace.warning("%s" % e) | ||
2702 | 313 | ## import pdb; pdb.set_trace() | ||
2703 | 314 | if re.search('\.|-| ', name): | ||
2704 | 315 | sanitised_name = re.sub('[-. ]', '_', name) | ||
2705 | 316 | if sanitised_name.startswith('bzr_'): | ||
2706 | 317 | sanitised_name = sanitised_name[len('bzr_'):] | ||
2707 | 318 | trace.warning("Unable to load %r in %r as a plugin because the " | ||
2708 | 319 | "file path isn't a valid module name; try renaming " | ||
2709 | 320 | "it to %r." % (name, d, sanitised_name)) | ||
2710 | 321 | else: | ||
2711 | 322 | trace.warning('Unable to load plugin %r from %r' % (name, d)) | ||
2712 | 323 | trace.log_exception_quietly() | ||
2713 | 324 | if 'error' in debug.debug_flags: | ||
2714 | 325 | trace.print_exception(sys.exc_info(), sys.stderr) | ||
2716 | 326 | 364 | ||
2717 | 327 | 365 | ||
2718 | 328 | def plugins(): | 366 | def plugins(): |
2719 | @@ -485,3 +523,77 @@ | |||
2720 | 485 | return version_string | 523 | return version_string |
2721 | 486 | 524 | ||
2722 | 487 | __version__ = property(_get__version__) | 525 | __version__ = property(_get__version__) |
2723 | 526 | |||
2724 | 527 | |||
2725 | 528 | class _PluginImporter(object): | ||
2726 | 529 | """An importer tailored to bzr specific needs. | ||
2727 | 530 | |||
2728 | 531 | This is a singleton that takes care of: | ||
2729 | 532 | - disabled plugins specified in 'blacklist', | ||
2730 | 533 | - plugins that needs to be loaded from specific directories. | ||
2731 | 534 | """ | ||
2732 | 535 | |||
2733 | 536 | def __init__(self): | ||
2734 | 537 | self.reset() | ||
2735 | 538 | |||
2736 | 539 | def reset(self): | ||
2737 | 540 | self.blacklist = set() | ||
2738 | 541 | self.specific_paths = {} | ||
2739 | 542 | |||
2740 | 543 | def find_module(self, fullname, parent_path=None): | ||
2741 | 544 | """Search a plugin module. | ||
2742 | 545 | |||
2743 | 546 | Disabled plugins raise an import error, plugins with specific paths | ||
2744 | 547 | returns a specific loader. | ||
2745 | 548 | |||
2746 | 549 | :return: None if the plugin doesn't need special handling, self | ||
2747 | 550 | otherwise. | ||
2748 | 551 | """ | ||
2749 | 552 | if not fullname.startswith('bzrlib.plugins.'): | ||
2750 | 553 | return None | ||
2751 | 554 | if fullname in self.blacklist: | ||
2752 | 555 | raise ImportError('%s is disabled' % fullname) | ||
2753 | 556 | if fullname in self.specific_paths: | ||
2754 | 557 | return self | ||
2755 | 558 | return None | ||
2756 | 559 | |||
2757 | 560 | def load_module(self, fullname): | ||
2758 | 561 | """Load a plugin from a specific directory.""" | ||
2759 | 562 | # We are called only for specific paths | ||
2760 | 563 | plugin_path = self.specific_paths[fullname] | ||
2761 | 564 | loading_path = None | ||
2762 | 565 | package = False | ||
2763 | 566 | if os.path.isdir(plugin_path): | ||
2764 | 567 | for suffix, mode, kind in imp.get_suffixes(): | ||
2765 | 568 | if kind not in (imp.PY_SOURCE, imp.PY_COMPILED): | ||
2766 | 569 | # We don't recognize compiled modules (.so, .dll, etc) | ||
2767 | 570 | continue | ||
2768 | 571 | init_path = osutils.pathjoin(plugin_path, '__init__' + suffix) | ||
2769 | 572 | if os.path.isfile(init_path): | ||
2770 | 573 | loading_path = init_path | ||
2771 | 574 | package = True | ||
2772 | 575 | break | ||
2773 | 576 | else: | ||
2774 | 577 | for suffix, mode, kind in imp.get_suffixes(): | ||
2775 | 578 | if plugin_path.endswith(suffix): | ||
2776 | 579 | loading_path = plugin_path | ||
2777 | 580 | break | ||
2778 | 581 | if loading_path is None: | ||
2779 | 582 | raise ImportError('%s cannot be loaded from %s' | ||
2780 | 583 | % (fullname, plugin_path)) | ||
2781 | 584 | f = open(loading_path, mode) | ||
2782 | 585 | try: | ||
2783 | 586 | mod = imp.load_module(fullname, f, loading_path, | ||
2784 | 587 | (suffix, mode, kind)) | ||
2785 | 588 | if package: | ||
2786 | 589 | # The plugin can contain modules, so be ready | ||
2787 | 590 | mod.__path__ = [plugin_path] | ||
2788 | 591 | mod.__package__ = fullname | ||
2789 | 592 | return mod | ||
2790 | 593 | finally: | ||
2791 | 594 | f.close() | ||
2792 | 595 | |||
2793 | 596 | |||
2794 | 597 | # Install a dedicated importer for plugins requiring special handling | ||
2795 | 598 | PluginImporter = _PluginImporter() | ||
2796 | 599 | sys.meta_path.append(PluginImporter) | ||
2797 | 488 | 600 | ||
2798 | === modified file 'bzrlib/plugins/launchpad/__init__.py' | |||
2799 | --- bzrlib/plugins/launchpad/__init__.py 2010-02-18 04:10:53 +0000 | |||
2800 | +++ bzrlib/plugins/launchpad/__init__.py 2010-04-06 07:24:41 +0000 | |||
2801 | @@ -1,4 +1,4 @@ | |||
2803 | 1 | # Copyright (C) 2006 - 2010 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
2804 | 2 | # | 2 | # |
2805 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2806 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2807 | @@ -17,7 +17,7 @@ | |||
2808 | 17 | """Launchpad.net integration plugin for Bazaar.""" | 17 | """Launchpad.net integration plugin for Bazaar.""" |
2809 | 18 | 18 | ||
2810 | 19 | # The XMLRPC server address can be overridden by setting the environment | 19 | # The XMLRPC server address can be overridden by setting the environment |
2812 | 20 | # variable $BZR_LP_XMLRPL_URL | 20 | # variable $BZR_LP_XMLRPC_URL |
2813 | 21 | 21 | ||
2814 | 22 | # see http://bazaar-vcs.org/Specs/BranchRegistrationTool | 22 | # see http://bazaar-vcs.org/Specs/BranchRegistrationTool |
2815 | 23 | 23 | ||
2816 | 24 | 24 | ||
2817 | === modified file 'bzrlib/plugins/launchpad/lp_api.py' | |||
2818 | --- bzrlib/plugins/launchpad/lp_api.py 2010-02-18 03:44:44 +0000 | |||
2819 | +++ bzrlib/plugins/launchpad/lp_api.py 2010-04-06 07:24:41 +0000 | |||
2820 | @@ -1,4 +1,4 @@ | |||
2822 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
2823 | 2 | # | 2 | # |
2824 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2825 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2826 | 5 | 5 | ||
2827 | === modified file 'bzrlib/plugins/launchpad/lp_directory.py' | |||
2828 | --- bzrlib/plugins/launchpad/lp_directory.py 2009-07-03 14:24:23 +0000 | |||
2829 | +++ bzrlib/plugins/launchpad/lp_directory.py 2010-04-06 07:24:41 +0000 | |||
2830 | @@ -1,4 +1,4 @@ | |||
2832 | 1 | # Copyright (C) 2007, 2008 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
2833 | 2 | # | 2 | # |
2834 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2835 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2836 | 5 | 5 | ||
2837 | === modified file 'bzrlib/plugins/launchpad/test_lp_api.py' | |||
2838 | --- bzrlib/plugins/launchpad/test_lp_api.py 2010-01-25 17:48:22 +0000 | |||
2839 | +++ bzrlib/plugins/launchpad/test_lp_api.py 2010-04-06 07:24:41 +0000 | |||
2840 | @@ -1,4 +1,4 @@ | |||
2842 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
2843 | 2 | # | 2 | # |
2844 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2845 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2846 | 5 | 5 | ||
2847 | === modified file 'bzrlib/plugins/launchpad/test_lp_directory.py' | |||
2848 | --- bzrlib/plugins/launchpad/test_lp_directory.py 2010-01-25 15:55:48 +0000 | |||
2849 | +++ bzrlib/plugins/launchpad/test_lp_directory.py 2010-04-06 07:24:41 +0000 | |||
2850 | @@ -1,4 +1,4 @@ | |||
2852 | 1 | # Copyright (C) 2007, 2008 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
2853 | 2 | # | 2 | # |
2854 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2855 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2856 | 5 | 5 | ||
2857 | === modified file 'bzrlib/plugins/launchpad/test_lp_open.py' | |||
2858 | --- bzrlib/plugins/launchpad/test_lp_open.py 2009-12-08 10:04:18 +0000 | |||
2859 | +++ bzrlib/plugins/launchpad/test_lp_open.py 2010-04-06 07:24:41 +0000 | |||
2860 | @@ -1,4 +1,4 @@ | |||
2862 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
2863 | 2 | # | 2 | # |
2864 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2865 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2866 | 5 | 5 | ||
2867 | === modified file 'bzrlib/progress.py' | |||
2868 | --- bzrlib/progress.py 2010-02-10 17:52:08 +0000 | |||
2869 | +++ bzrlib/progress.py 2010-04-06 07:24:41 +0000 | |||
2870 | @@ -316,8 +316,3 @@ | |||
2871 | 316 | else: | 316 | else: |
2872 | 317 | self.cur_phase += 1 | 317 | self.cur_phase += 1 |
2873 | 318 | self.pb.update(self.message, self.cur_phase, self.total) | 318 | self.pb.update(self.message, self.cur_phase, self.total) |
2874 | 319 | |||
2875 | 320 | |||
2876 | 321 | _progress_bar_types = {} | ||
2877 | 322 | _progress_bar_types['dummy'] = DummyProgress | ||
2878 | 323 | _progress_bar_types['none'] = DummyProgress | ||
2879 | 324 | 319 | ||
2880 | === modified file 'bzrlib/reconcile.py' | |||
2881 | --- bzrlib/reconcile.py 2010-01-07 01:30:20 +0000 | |||
2882 | +++ bzrlib/reconcile.py 2010-04-06 07:24:41 +0000 | |||
2883 | @@ -1,4 +1,4 @@ | |||
2885 | 1 | # Copyright (C) 2005, 2006 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
2886 | 2 | # | 2 | # |
2887 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
2888 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
2889 | 5 | 5 | ||
2890 | === modified file 'bzrlib/reconfigure.py' | |||
2891 | --- bzrlib/reconfigure.py 2009-10-06 14:40:37 +0000 | |||
2892 | +++ bzrlib/reconfigure.py 2010-04-06 07:24:41 +0000 | |||
2893 | @@ -368,7 +368,7 @@ | |||
2894 | 368 | local_branch = self.local_branch | 368 | local_branch = self.local_branch |
2895 | 369 | if self._create_reference: | 369 | if self._create_reference: |
2896 | 370 | format = branch.BranchReferenceFormat().initialize(self.bzrdir, | 370 | format = branch.BranchReferenceFormat().initialize(self.bzrdir, |
2898 | 371 | reference_branch) | 371 | target_branch=reference_branch) |
2899 | 372 | if self._destroy_tree: | 372 | if self._destroy_tree: |
2900 | 373 | self.bzrdir.destroy_workingtree() | 373 | self.bzrdir.destroy_workingtree() |
2901 | 374 | if self._create_tree: | 374 | if self._create_tree: |
2902 | 375 | 375 | ||
2903 | === modified file 'bzrlib/remote.py' | |||
2904 | --- bzrlib/remote.py 2010-02-13 02:15:58 +0000 | |||
2905 | +++ bzrlib/remote.py 2010-04-06 07:24:41 +0000 | |||
2906 | @@ -242,12 +242,14 @@ | |||
2907 | 242 | self._ensure_real() | 242 | self._ensure_real() |
2908 | 243 | self._real_bzrdir.destroy_repository() | 243 | self._real_bzrdir.destroy_repository() |
2909 | 244 | 244 | ||
2911 | 245 | def create_branch(self): | 245 | def create_branch(self, name=None): |
2912 | 246 | # as per meta1 formats - just delegate to the format object which may | 246 | # as per meta1 formats - just delegate to the format object which may |
2913 | 247 | # be parameterised. | 247 | # be parameterised. |
2915 | 248 | real_branch = self._format.get_branch_format().initialize(self) | 248 | real_branch = self._format.get_branch_format().initialize(self, |
2916 | 249 | name=name) | ||
2917 | 249 | if not isinstance(real_branch, RemoteBranch): | 250 | if not isinstance(real_branch, RemoteBranch): |
2919 | 250 | result = RemoteBranch(self, self.find_repository(), real_branch) | 251 | result = RemoteBranch(self, self.find_repository(), real_branch, |
2920 | 252 | name=name) | ||
2921 | 251 | else: | 253 | else: |
2922 | 252 | result = real_branch | 254 | result = real_branch |
2923 | 253 | # BzrDir.clone_on_transport() uses the result of create_branch but does | 255 | # BzrDir.clone_on_transport() uses the result of create_branch but does |
2924 | @@ -259,10 +261,10 @@ | |||
2925 | 259 | self._next_open_branch_result = result | 261 | self._next_open_branch_result = result |
2926 | 260 | return result | 262 | return result |
2927 | 261 | 263 | ||
2929 | 262 | def destroy_branch(self): | 264 | def destroy_branch(self, name=None): |
2930 | 263 | """See BzrDir.destroy_branch""" | 265 | """See BzrDir.destroy_branch""" |
2931 | 264 | self._ensure_real() | 266 | self._ensure_real() |
2933 | 265 | self._real_bzrdir.destroy_branch() | 267 | self._real_bzrdir.destroy_branch(name=name) |
2934 | 266 | self._next_open_branch_result = None | 268 | self._next_open_branch_result = None |
2935 | 267 | 269 | ||
2936 | 268 | def create_workingtree(self, revision_id=None, from_branch=None): | 270 | def create_workingtree(self, revision_id=None, from_branch=None): |
2937 | @@ -318,8 +320,9 @@ | |||
2938 | 318 | """See BzrDir._get_tree_branch().""" | 320 | """See BzrDir._get_tree_branch().""" |
2939 | 319 | return None, self.open_branch() | 321 | return None, self.open_branch() |
2940 | 320 | 322 | ||
2943 | 321 | def open_branch(self, _unsupported=False, ignore_fallbacks=False): | 323 | def open_branch(self, name=None, unsupported=False, |
2944 | 322 | if _unsupported: | 324 | ignore_fallbacks=False): |
2945 | 325 | if unsupported: | ||
2946 | 323 | raise NotImplementedError('unsupported flag support not implemented yet.') | 326 | raise NotImplementedError('unsupported flag support not implemented yet.') |
2947 | 324 | if self._next_open_branch_result is not None: | 327 | if self._next_open_branch_result is not None: |
2948 | 325 | # See create_branch for details. | 328 | # See create_branch for details. |
2949 | @@ -330,14 +333,14 @@ | |||
2950 | 330 | if response[0] == 'ref': | 333 | if response[0] == 'ref': |
2951 | 331 | # a branch reference, use the existing BranchReference logic. | 334 | # a branch reference, use the existing BranchReference logic. |
2952 | 332 | format = BranchReferenceFormat() | 335 | format = BranchReferenceFormat() |
2955 | 333 | return format.open(self, _found=True, location=response[1], | 336 | return format.open(self, name=name, _found=True, |
2956 | 334 | ignore_fallbacks=ignore_fallbacks) | 337 | location=response[1], ignore_fallbacks=ignore_fallbacks) |
2957 | 335 | branch_format_name = response[1] | 338 | branch_format_name = response[1] |
2958 | 336 | if not branch_format_name: | 339 | if not branch_format_name: |
2959 | 337 | branch_format_name = None | 340 | branch_format_name = None |
2960 | 338 | format = RemoteBranchFormat(network_name=branch_format_name) | 341 | format = RemoteBranchFormat(network_name=branch_format_name) |
2961 | 339 | return RemoteBranch(self, self.find_repository(), format=format, | 342 | return RemoteBranch(self, self.find_repository(), format=format, |
2963 | 340 | setup_stacking=not ignore_fallbacks) | 343 | setup_stacking=not ignore_fallbacks, name=name) |
2964 | 341 | 344 | ||
2965 | 342 | def _open_repo_v1(self, path): | 345 | def _open_repo_v1(self, path): |
2966 | 343 | verb = 'BzrDir.find_repository' | 346 | verb = 'BzrDir.find_repository' |
2967 | @@ -420,9 +423,9 @@ | |||
2968 | 420 | """Return the path to be used for this bzrdir in a remote call.""" | 423 | """Return the path to be used for this bzrdir in a remote call.""" |
2969 | 421 | return client.remote_path_from_transport(self.root_transport) | 424 | return client.remote_path_from_transport(self.root_transport) |
2970 | 422 | 425 | ||
2972 | 423 | def get_branch_transport(self, branch_format): | 426 | def get_branch_transport(self, branch_format, name=None): |
2973 | 424 | self._ensure_real() | 427 | self._ensure_real() |
2975 | 425 | return self._real_bzrdir.get_branch_transport(branch_format) | 428 | return self._real_bzrdir.get_branch_transport(branch_format, name=name) |
2976 | 426 | 429 | ||
2977 | 427 | def get_repository_transport(self, repository_format): | 430 | def get_repository_transport(self, repository_format): |
2978 | 428 | self._ensure_real() | 431 | self._ensure_real() |
2979 | @@ -1229,10 +1232,11 @@ | |||
2980 | 1229 | return self._real_repository.add_inventory(revid, inv, parents) | 1232 | return self._real_repository.add_inventory(revid, inv, parents) |
2981 | 1230 | 1233 | ||
2982 | 1231 | def add_inventory_by_delta(self, basis_revision_id, delta, new_revision_id, | 1234 | def add_inventory_by_delta(self, basis_revision_id, delta, new_revision_id, |
2984 | 1232 | parents): | 1235 | parents, basis_inv=None, propagate_caches=False): |
2985 | 1233 | self._ensure_real() | 1236 | self._ensure_real() |
2986 | 1234 | return self._real_repository.add_inventory_by_delta(basis_revision_id, | 1237 | return self._real_repository.add_inventory_by_delta(basis_revision_id, |
2988 | 1235 | delta, new_revision_id, parents) | 1238 | delta, new_revision_id, parents, basis_inv=basis_inv, |
2989 | 1239 | propagate_caches=propagate_caches) | ||
2990 | 1236 | 1240 | ||
2991 | 1237 | def add_revision(self, rev_id, rev, inv=None, config=None): | 1241 | def add_revision(self, rev_id, rev, inv=None, config=None): |
2992 | 1238 | self._ensure_real() | 1242 | self._ensure_real() |
2993 | @@ -2021,26 +2025,29 @@ | |||
2994 | 2021 | def network_name(self): | 2025 | def network_name(self): |
2995 | 2022 | return self._network_name | 2026 | return self._network_name |
2996 | 2023 | 2027 | ||
2999 | 2024 | def open(self, a_bzrdir, ignore_fallbacks=False): | 2028 | def open(self, a_bzrdir, name=None, ignore_fallbacks=False): |
3000 | 2025 | return a_bzrdir.open_branch(ignore_fallbacks=ignore_fallbacks) | 2029 | return a_bzrdir.open_branch(name=name, |
3001 | 2030 | ignore_fallbacks=ignore_fallbacks) | ||
3002 | 2026 | 2031 | ||
3004 | 2027 | def _vfs_initialize(self, a_bzrdir): | 2032 | def _vfs_initialize(self, a_bzrdir, name): |
3005 | 2028 | # Initialisation when using a local bzrdir object, or a non-vfs init | 2033 | # Initialisation when using a local bzrdir object, or a non-vfs init |
3006 | 2029 | # method is not available on the server. | 2034 | # method is not available on the server. |
3007 | 2030 | # self._custom_format is always set - the start of initialize ensures | 2035 | # self._custom_format is always set - the start of initialize ensures |
3008 | 2031 | # that. | 2036 | # that. |
3009 | 2032 | if isinstance(a_bzrdir, RemoteBzrDir): | 2037 | if isinstance(a_bzrdir, RemoteBzrDir): |
3010 | 2033 | a_bzrdir._ensure_real() | 2038 | a_bzrdir._ensure_real() |
3012 | 2034 | result = self._custom_format.initialize(a_bzrdir._real_bzrdir) | 2039 | result = self._custom_format.initialize(a_bzrdir._real_bzrdir, |
3013 | 2040 | name) | ||
3014 | 2035 | else: | 2041 | else: |
3015 | 2036 | # We assume the bzrdir is parameterised; it may not be. | 2042 | # We assume the bzrdir is parameterised; it may not be. |
3017 | 2037 | result = self._custom_format.initialize(a_bzrdir) | 2043 | result = self._custom_format.initialize(a_bzrdir, name) |
3018 | 2038 | if (isinstance(a_bzrdir, RemoteBzrDir) and | 2044 | if (isinstance(a_bzrdir, RemoteBzrDir) and |
3019 | 2039 | not isinstance(result, RemoteBranch)): | 2045 | not isinstance(result, RemoteBranch)): |
3021 | 2040 | result = RemoteBranch(a_bzrdir, a_bzrdir.find_repository(), result) | 2046 | result = RemoteBranch(a_bzrdir, a_bzrdir.find_repository(), result, |
3022 | 2047 | name=name) | ||
3023 | 2041 | return result | 2048 | return result |
3024 | 2042 | 2049 | ||
3026 | 2043 | def initialize(self, a_bzrdir): | 2050 | def initialize(self, a_bzrdir, name=None): |
3027 | 2044 | # 1) get the network name to use. | 2051 | # 1) get the network name to use. |
3028 | 2045 | if self._custom_format: | 2052 | if self._custom_format: |
3029 | 2046 | network_name = self._custom_format.network_name() | 2053 | network_name = self._custom_format.network_name() |
3030 | @@ -2052,20 +2059,23 @@ | |||
3031 | 2052 | network_name = reference_format.network_name() | 2059 | network_name = reference_format.network_name() |
3032 | 2053 | # Being asked to create on a non RemoteBzrDir: | 2060 | # Being asked to create on a non RemoteBzrDir: |
3033 | 2054 | if not isinstance(a_bzrdir, RemoteBzrDir): | 2061 | if not isinstance(a_bzrdir, RemoteBzrDir): |
3035 | 2055 | return self._vfs_initialize(a_bzrdir) | 2062 | return self._vfs_initialize(a_bzrdir, name=name) |
3036 | 2056 | medium = a_bzrdir._client._medium | 2063 | medium = a_bzrdir._client._medium |
3037 | 2057 | if medium._is_remote_before((1, 13)): | 2064 | if medium._is_remote_before((1, 13)): |
3039 | 2058 | return self._vfs_initialize(a_bzrdir) | 2065 | return self._vfs_initialize(a_bzrdir, name=name) |
3040 | 2059 | # Creating on a remote bzr dir. | 2066 | # Creating on a remote bzr dir. |
3041 | 2060 | # 2) try direct creation via RPC | 2067 | # 2) try direct creation via RPC |
3042 | 2061 | path = a_bzrdir._path_for_remote_call(a_bzrdir._client) | 2068 | path = a_bzrdir._path_for_remote_call(a_bzrdir._client) |
3043 | 2069 | if name is not None: | ||
3044 | 2070 | # XXX JRV20100304: Support creating colocated branches | ||
3045 | 2071 | raise errors.NoColocatedBranchSupport(self) | ||
3046 | 2062 | verb = 'BzrDir.create_branch' | 2072 | verb = 'BzrDir.create_branch' |
3047 | 2063 | try: | 2073 | try: |
3048 | 2064 | response = a_bzrdir._call(verb, path, network_name) | 2074 | response = a_bzrdir._call(verb, path, network_name) |
3049 | 2065 | except errors.UnknownSmartMethod: | 2075 | except errors.UnknownSmartMethod: |
3050 | 2066 | # Fallback - use vfs methods | 2076 | # Fallback - use vfs methods |
3051 | 2067 | medium._remember_remote_is_before((1, 13)) | 2077 | medium._remember_remote_is_before((1, 13)) |
3053 | 2068 | return self._vfs_initialize(a_bzrdir) | 2078 | return self._vfs_initialize(a_bzrdir, name=name) |
3054 | 2069 | if response[0] != 'ok': | 2079 | if response[0] != 'ok': |
3055 | 2070 | raise errors.UnexpectedSmartServerResponse(response) | 2080 | raise errors.UnexpectedSmartServerResponse(response) |
3056 | 2071 | # Turn the response into a RemoteRepository object. | 2081 | # Turn the response into a RemoteRepository object. |
3057 | @@ -2079,7 +2089,7 @@ | |||
3058 | 2079 | a_bzrdir._client) | 2089 | a_bzrdir._client) |
3059 | 2080 | remote_repo = RemoteRepository(repo_bzrdir, repo_format) | 2090 | remote_repo = RemoteRepository(repo_bzrdir, repo_format) |
3060 | 2081 | remote_branch = RemoteBranch(a_bzrdir, remote_repo, | 2091 | remote_branch = RemoteBranch(a_bzrdir, remote_repo, |
3062 | 2082 | format=format, setup_stacking=False) | 2092 | format=format, setup_stacking=False, name=name) |
3063 | 2083 | # XXX: We know this is a new branch, so it must have revno 0, revid | 2093 | # XXX: We know this is a new branch, so it must have revno 0, revid |
3064 | 2084 | # NULL_REVISION. Creating the branch locked would make this be unable | 2094 | # NULL_REVISION. Creating the branch locked would make this be unable |
3065 | 2085 | # to be wrong; here its simply very unlikely to be wrong. RBC 20090225 | 2095 | # to be wrong; here its simply very unlikely to be wrong. RBC 20090225 |
3066 | @@ -2112,7 +2122,7 @@ | |||
3067 | 2112 | """ | 2122 | """ |
3068 | 2113 | 2123 | ||
3069 | 2114 | def __init__(self, remote_bzrdir, remote_repository, real_branch=None, | 2124 | def __init__(self, remote_bzrdir, remote_repository, real_branch=None, |
3071 | 2115 | _client=None, format=None, setup_stacking=True): | 2125 | _client=None, format=None, setup_stacking=True, name=None): |
3072 | 2116 | """Create a RemoteBranch instance. | 2126 | """Create a RemoteBranch instance. |
3073 | 2117 | 2127 | ||
3074 | 2118 | :param real_branch: An optional local implementation of the branch | 2128 | :param real_branch: An optional local implementation of the branch |
3075 | @@ -2124,6 +2134,7 @@ | |||
3076 | 2124 | :param setup_stacking: If True make an RPC call to determine the | 2134 | :param setup_stacking: If True make an RPC call to determine the |
3077 | 2125 | stacked (or not) status of the branch. If False assume the branch | 2135 | stacked (or not) status of the branch. If False assume the branch |
3078 | 2126 | is not stacked. | 2136 | is not stacked. |
3079 | 2137 | :param name: Colocated branch name | ||
3080 | 2127 | """ | 2138 | """ |
3081 | 2128 | # We intentionally don't call the parent class's __init__, because it | 2139 | # We intentionally don't call the parent class's __init__, because it |
3082 | 2129 | # will try to assign to self.tags, which is a property in this subclass. | 2140 | # will try to assign to self.tags, which is a property in this subclass. |
3083 | @@ -2149,6 +2160,7 @@ | |||
3084 | 2149 | # Fill out expected attributes of branch for bzrlib API users. | 2160 | # Fill out expected attributes of branch for bzrlib API users. |
3085 | 2150 | self._clear_cached_state() | 2161 | self._clear_cached_state() |
3086 | 2151 | self.base = self.bzrdir.root_transport.base | 2162 | self.base = self.bzrdir.root_transport.base |
3087 | 2163 | self._name = name | ||
3088 | 2152 | self._control_files = None | 2164 | self._control_files = None |
3089 | 2153 | self._lock_mode = None | 2165 | self._lock_mode = None |
3090 | 2154 | self._lock_token = None | 2166 | self._lock_token = None |
3091 | @@ -2219,7 +2231,7 @@ | |||
3092 | 2219 | 'to use vfs implementation') | 2231 | 'to use vfs implementation') |
3093 | 2220 | self.bzrdir._ensure_real() | 2232 | self.bzrdir._ensure_real() |
3094 | 2221 | self._real_branch = self.bzrdir._real_bzrdir.open_branch( | 2233 | self._real_branch = self.bzrdir._real_bzrdir.open_branch( |
3096 | 2222 | ignore_fallbacks=self._real_ignore_fallbacks) | 2234 | ignore_fallbacks=self._real_ignore_fallbacks, name=self._name) |
3097 | 2223 | if self.repository._real_repository is None: | 2235 | if self.repository._real_repository is None: |
3098 | 2224 | # Give the remote repository the matching real repo. | 2236 | # Give the remote repository the matching real repo. |
3099 | 2225 | real_repo = self._real_branch.repository | 2237 | real_repo = self._real_branch.repository |
3100 | 2226 | 2238 | ||
3101 | === modified file 'bzrlib/revisionspec.py' | |||
3102 | --- bzrlib/revisionspec.py 2009-10-27 14:04:29 +0000 | |||
3103 | +++ bzrlib/revisionspec.py 2010-04-06 07:24:41 +0000 | |||
3104 | @@ -1,4 +1,4 @@ | |||
3106 | 1 | # Copyright (C) 2005, 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
3107 | 2 | # | 2 | # |
3108 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3109 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3110 | 5 | 5 | ||
3111 | === modified file 'bzrlib/revisiontree.py' | |||
3112 | --- bzrlib/revisiontree.py 2010-01-20 23:21:35 +0000 | |||
3113 | +++ bzrlib/revisiontree.py 2010-04-06 07:24:41 +0000 | |||
3114 | @@ -1,4 +1,4 @@ | |||
3116 | 1 | # Copyright (C) 2005, 2007 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3117 | 2 | # | 2 | # |
3118 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3119 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3120 | 5 | 5 | ||
3121 | === modified file 'bzrlib/serializer.py' | |||
3122 | --- bzrlib/serializer.py 2009-12-03 04:55:02 +0000 | |||
3123 | +++ bzrlib/serializer.py 2010-04-06 07:24:41 +0000 | |||
3124 | @@ -1,4 +1,4 @@ | |||
3126 | 1 | # Copyright (C) 2005, 2006, 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
3127 | 2 | # | 2 | # |
3128 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3129 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3130 | 5 | 5 | ||
3131 | === modified file 'bzrlib/shellcomplete.py' | |||
3132 | --- bzrlib/shellcomplete.py 2009-11-02 22:24:29 +0000 | |||
3133 | +++ bzrlib/shellcomplete.py 2010-04-06 07:24:41 +0000 | |||
3134 | @@ -1,4 +1,4 @@ | |||
3136 | 1 | # Copyright (C) 2005, 2006 Canonical Ltd | 1 | # Copyright (C) 2005, 2006, 2007, 2009, 2010 Canonical Ltd |
3137 | 2 | # | 2 | # |
3138 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3139 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3140 | 5 | 5 | ||
3141 | === modified file 'bzrlib/smart/bzrdir.py' | |||
3142 | --- bzrlib/smart/bzrdir.py 2010-01-12 01:10:03 +0000 | |||
3143 | +++ bzrlib/smart/bzrdir.py 2010-04-06 07:24:41 +0000 | |||
3144 | @@ -1,4 +1,4 @@ | |||
3146 | 1 | # Copyright (C) 2006 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3147 | 2 | # | 2 | # |
3148 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3149 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3150 | 5 | 5 | ||
3151 | === modified file 'bzrlib/smart/client.py' | |||
3152 | --- bzrlib/smart/client.py 2010-01-15 06:55:33 +0000 | |||
3153 | +++ bzrlib/smart/client.py 2010-04-06 07:24:41 +0000 | |||
3154 | @@ -1,4 +1,4 @@ | |||
3156 | 1 | # Copyright (C) 2006-2008 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3157 | 2 | # | 2 | # |
3158 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3159 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3160 | 5 | 5 | ||
3161 | === modified file 'bzrlib/smart/medium.py' | |||
3162 | --- bzrlib/smart/medium.py 2010-01-15 07:26:46 +0000 | |||
3163 | +++ bzrlib/smart/medium.py 2010-04-06 07:24:41 +0000 | |||
3164 | @@ -1,4 +1,4 @@ | |||
3166 | 1 | # Copyright (C) 2006 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3167 | 2 | # | 2 | # |
3168 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3169 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3170 | 5 | 5 | ||
3171 | === modified file 'bzrlib/smart/protocol.py' | |||
3172 | --- bzrlib/smart/protocol.py 2009-12-21 17:00:29 +0000 | |||
3173 | +++ bzrlib/smart/protocol.py 2010-04-06 07:24:41 +0000 | |||
3174 | @@ -1,4 +1,4 @@ | |||
3176 | 1 | # Copyright (C) 2006, 2007, 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3177 | 2 | # | 2 | # |
3178 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3179 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3180 | 5 | 5 | ||
3181 | === modified file 'bzrlib/smart/repository.py' | |||
3182 | --- bzrlib/smart/repository.py 2010-02-10 02:17:15 +0000 | |||
3183 | +++ bzrlib/smart/repository.py 2010-04-06 07:24:41 +0000 | |||
3184 | @@ -1,4 +1,4 @@ | |||
3186 | 1 | # Copyright (C) 2006, 2007, 2010 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3187 | 2 | # | 2 | # |
3188 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3189 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3190 | 5 | 5 | ||
3191 | === modified file 'bzrlib/smart/request.py' | |||
3192 | --- bzrlib/smart/request.py 2010-01-11 05:58:22 +0000 | |||
3193 | +++ bzrlib/smart/request.py 2010-04-06 07:24:41 +0000 | |||
3194 | @@ -1,4 +1,4 @@ | |||
3196 | 1 | # Copyright (C) 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3197 | 2 | # | 2 | # |
3198 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3199 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3200 | 5 | 5 | ||
3201 | === modified file 'bzrlib/smart/server.py' | |||
3202 | --- bzrlib/smart/server.py 2010-02-09 20:28:26 +0000 | |||
3203 | +++ bzrlib/smart/server.py 2010-04-06 07:24:41 +0000 | |||
3204 | @@ -1,4 +1,4 @@ | |||
3206 | 1 | # Copyright (C) 2006, 2007, 2008 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3207 | 2 | # | 2 | # |
3208 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3209 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3210 | 5 | 5 | ||
3211 | === modified file 'bzrlib/smart/vfs.py' | |||
3212 | --- bzrlib/smart/vfs.py 2009-10-23 04:22:05 +0000 | |||
3213 | +++ bzrlib/smart/vfs.py 2010-04-06 07:24:41 +0000 | |||
3214 | @@ -1,4 +1,4 @@ | |||
3216 | 1 | # Copyright (C) 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3217 | 2 | # | 2 | # |
3218 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3219 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3220 | 5 | 5 | ||
3221 | === modified file 'bzrlib/static_tuple.py' | |||
3222 | --- bzrlib/static_tuple.py 2009-11-28 21:54:08 +0000 | |||
3223 | +++ bzrlib/static_tuple.py 2010-04-06 07:24:41 +0000 | |||
3224 | @@ -1,4 +1,4 @@ | |||
3226 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
3227 | 2 | # | 2 | # |
3228 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3229 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3230 | 5 | 5 | ||
3231 | === modified file 'bzrlib/status.py' | |||
3232 | --- bzrlib/status.py 2009-12-02 15:24:34 +0000 | |||
3233 | +++ bzrlib/status.py 2010-04-06 07:24:41 +0000 | |||
3234 | @@ -1,4 +1,4 @@ | |||
3236 | 1 | # Copyright (C) 2005, 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
3237 | 2 | # | 2 | # |
3238 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3239 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3240 | 5 | 5 | ||
3241 | === modified file 'bzrlib/switch.py' | |||
3242 | --- bzrlib/switch.py 2010-01-12 03:53:21 +0000 | |||
3243 | +++ bzrlib/switch.py 2010-04-06 07:24:41 +0000 | |||
3244 | @@ -1,4 +1,4 @@ | |||
3246 | 1 | # Copyright (C) 2006, 2007 Canonical Ltd. | 1 | # Copyright (C) 2007, 2009, 2010 Canonical Ltd. |
3247 | 2 | # | 2 | # |
3248 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3249 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3250 | 5 | 5 | ||
3251 | === modified file 'bzrlib/tests/TestUtil.py' | |||
3252 | --- bzrlib/tests/TestUtil.py 2009-12-05 09:04:19 +0000 | |||
3253 | +++ bzrlib/tests/TestUtil.py 2010-04-06 07:24:41 +0000 | |||
3254 | @@ -1,4 +1,4 @@ | |||
3256 | 1 | # Copyright (C) 2004, 2005, 2006 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
3257 | 2 | # Author: Robert Collins <robert.collins@canonical.com> | 2 | # Author: Robert Collins <robert.collins@canonical.com> |
3258 | 3 | # | 3 | # |
3259 | 4 | # This program is free software; you can redistribute it and/or modify | 4 | # This program is free software; you can redistribute it and/or modify |
3260 | 5 | 5 | ||
3261 | === modified file 'bzrlib/tests/__init__.py' | |||
3262 | --- bzrlib/tests/__init__.py 2010-02-18 02:15:48 +0000 | |||
3263 | +++ bzrlib/tests/__init__.py 2010-04-06 07:24:41 +0000 | |||
3264 | @@ -1519,6 +1519,8 @@ | |||
3265 | 1519 | 'BZR_PROGRESS_BAR': None, | 1519 | 'BZR_PROGRESS_BAR': None, |
3266 | 1520 | 'BZR_LOG': None, | 1520 | 'BZR_LOG': None, |
3267 | 1521 | 'BZR_PLUGIN_PATH': None, | 1521 | 'BZR_PLUGIN_PATH': None, |
3268 | 1522 | 'BZR_DISABLE_PLUGINS': None, | ||
3269 | 1523 | 'BZR_PLUGINS_AT': None, | ||
3270 | 1522 | 'BZR_CONCURRENCY': None, | 1524 | 'BZR_CONCURRENCY': None, |
3271 | 1523 | # Make sure that any text ui tests are consistent regardless of | 1525 | # Make sure that any text ui tests are consistent regardless of |
3272 | 1524 | # the environment the test case is run in; you may want tests that | 1526 | # the environment the test case is run in; you may want tests that |
3273 | @@ -1671,7 +1673,33 @@ | |||
3274 | 1671 | unicodestr = log_contents.decode('utf8', 'replace') | 1673 | unicodestr = log_contents.decode('utf8', 'replace') |
3275 | 1672 | log_contents = unicodestr.encode('utf8') | 1674 | log_contents = unicodestr.encode('utf8') |
3276 | 1673 | if not keep_log_file: | 1675 | if not keep_log_file: |
3278 | 1674 | self._log_file.close() | 1676 | close_attempts = 0 |
3279 | 1677 | max_close_attempts = 100 | ||
3280 | 1678 | first_close_error = None | ||
3281 | 1679 | while close_attempts < max_close_attempts: | ||
3282 | 1680 | close_attempts += 1 | ||
3283 | 1681 | try: | ||
3284 | 1682 | self._log_file.close() | ||
3285 | 1683 | except IOError, ioe: | ||
3286 | 1684 | if ioe.errno is None: | ||
3287 | 1685 | # No errno implies 'close() called during | ||
3288 | 1686 | # concurrent operation on the same file object', so | ||
3289 | 1687 | # retry. Probably a thread is trying to write to | ||
3290 | 1688 | # the log file. | ||
3291 | 1689 | if first_close_error is None: | ||
3292 | 1690 | first_close_error = ioe | ||
3293 | 1691 | continue | ||
3294 | 1692 | raise | ||
3295 | 1693 | else: | ||
3296 | 1694 | break | ||
3297 | 1695 | if close_attempts > 1: | ||
3298 | 1696 | sys.stderr.write( | ||
3299 | 1697 | 'Unable to close log file on first attempt, ' | ||
3300 | 1698 | 'will retry: %s\n' % (first_close_error,)) | ||
3301 | 1699 | if close_attempts == max_close_attempts: | ||
3302 | 1700 | sys.stderr.write( | ||
3303 | 1701 | 'Unable to close log file after %d attempts.\n' | ||
3304 | 1702 | % (max_close_attempts,)) | ||
3305 | 1675 | self._log_file = None | 1703 | self._log_file = None |
3306 | 1676 | # Permit multiple calls to get_log until we clean it up in | 1704 | # Permit multiple calls to get_log until we clean it up in |
3307 | 1677 | # finishLogFile | 1705 | # finishLogFile |
3308 | 1678 | 1706 | ||
3309 | === modified file 'bzrlib/tests/blackbox/test_annotate.py' | |||
3310 | --- bzrlib/tests/blackbox/test_annotate.py 2010-01-07 12:32:37 +0000 | |||
3311 | +++ bzrlib/tests/blackbox/test_annotate.py 2010-04-06 07:24:41 +0000 | |||
3312 | @@ -1,4 +1,4 @@ | |||
3314 | 1 | # Copyright (C) 2005 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
3315 | 2 | # -*- coding: utf-8 -*- | 2 | # -*- coding: utf-8 -*- |
3316 | 3 | # | 3 | # |
3317 | 4 | # This program is free software; you can redistribute it and/or modify | 4 | # This program is free software; you can redistribute it and/or modify |
3318 | 5 | 5 | ||
3319 | === modified file 'bzrlib/tests/blackbox/test_branch.py' | |||
3320 | --- bzrlib/tests/blackbox/test_branch.py 2010-02-09 21:29:20 +0000 | |||
3321 | +++ bzrlib/tests/blackbox/test_branch.py 2010-04-06 07:24:41 +0000 | |||
3322 | @@ -1,4 +1,4 @@ | |||
3324 | 1 | # Copyright (C) 2005, 2006, 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3325 | 2 | # | 2 | # |
3326 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3327 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3328 | 5 | 5 | ||
3329 | === modified file 'bzrlib/tests/blackbox/test_break_lock.py' | |||
3330 | --- bzrlib/tests/blackbox/test_break_lock.py 2009-03-23 14:59:43 +0000 | |||
3331 | +++ bzrlib/tests/blackbox/test_break_lock.py 2010-04-06 07:24:41 +0000 | |||
3332 | @@ -60,7 +60,7 @@ | |||
3333 | 60 | local_branch.bind(self.master_branch) | 60 | local_branch.bind(self.master_branch) |
3334 | 61 | checkoutdir = bzrlib.bzrdir.BzrDir.create('checkout') | 61 | checkoutdir = bzrlib.bzrdir.BzrDir.create('checkout') |
3335 | 62 | bzrlib.branch.BranchReferenceFormat().initialize( | 62 | bzrlib.branch.BranchReferenceFormat().initialize( |
3337 | 63 | checkoutdir, local_branch) | 63 | checkoutdir, target_branch=local_branch) |
3338 | 64 | self.wt = checkoutdir.create_workingtree() | 64 | self.wt = checkoutdir.create_workingtree() |
3339 | 65 | 65 | ||
3340 | 66 | def test_break_lock_help(self): | 66 | def test_break_lock_help(self): |
3341 | 67 | 67 | ||
3342 | === modified file 'bzrlib/tests/blackbox/test_cat.py' | |||
3343 | --- bzrlib/tests/blackbox/test_cat.py 2010-02-11 09:21:45 +0000 | |||
3344 | +++ bzrlib/tests/blackbox/test_cat.py 2010-04-06 07:24:41 +0000 | |||
3345 | @@ -1,4 +1,4 @@ | |||
3347 | 1 | # Copyright (C) 2005 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
3348 | 2 | # -*- coding: utf-8 -*- | 2 | # -*- coding: utf-8 -*- |
3349 | 3 | # | 3 | # |
3350 | 4 | # This program is free software; you can redistribute it and/or modify | 4 | # This program is free software; you can redistribute it and/or modify |
3351 | 5 | 5 | ||
3352 | === modified file 'bzrlib/tests/blackbox/test_checkout.py' | |||
3353 | --- bzrlib/tests/blackbox/test_checkout.py 2009-12-01 06:07:41 +0000 | |||
3354 | +++ bzrlib/tests/blackbox/test_checkout.py 2010-04-06 07:24:41 +0000 | |||
3355 | @@ -1,4 +1,4 @@ | |||
3357 | 1 | # Copyright (C) 2005, 2006, 2009 Canonical Ltd | 1 | # Copyright (C) 2006, 2007, 2009, 2010 Canonical Ltd |
3358 | 2 | # | 2 | # |
3359 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3360 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3361 | 5 | 5 | ||
3362 | === modified file 'bzrlib/tests/blackbox/test_debug.py' | |||
3363 | --- bzrlib/tests/blackbox/test_debug.py 2009-12-16 22:29:31 +0000 | |||
3364 | +++ bzrlib/tests/blackbox/test_debug.py 2010-04-06 07:24:41 +0000 | |||
3365 | @@ -1,4 +1,4 @@ | |||
3367 | 1 | # Copyright (C) 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2006, 2007, 2009, 2010 Canonical Ltd |
3368 | 2 | # | 2 | # |
3369 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3370 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3371 | 5 | 5 | ||
3372 | === modified file 'bzrlib/tests/blackbox/test_exceptions.py' | |||
3373 | --- bzrlib/tests/blackbox/test_exceptions.py 2009-12-22 23:09:50 +0000 | |||
3374 | +++ bzrlib/tests/blackbox/test_exceptions.py 2010-04-06 07:24:41 +0000 | |||
3375 | @@ -1,4 +1,4 @@ | |||
3377 | 1 | # Copyright (C) 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2006, 2007, 2009, 2010 Canonical Ltd |
3378 | 2 | # | 2 | # |
3379 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3380 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3381 | 5 | 5 | ||
3382 | === modified file 'bzrlib/tests/blackbox/test_export.py' | |||
3383 | --- bzrlib/tests/blackbox/test_export.py 2009-11-25 00:14:05 +0000 | |||
3384 | +++ bzrlib/tests/blackbox/test_export.py 2010-04-06 07:24:41 +0000 | |||
3385 | @@ -1,4 +1,4 @@ | |||
3387 | 1 | # Copyright (C) 2005, 2006, 2008 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
3388 | 2 | # | 2 | # |
3389 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3390 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3391 | @@ -293,3 +293,13 @@ | |||
3392 | 293 | tree.commit('more setup') | 293 | tree.commit('more setup') |
3393 | 294 | out, err = self.run_bzr('export exported branch/subdir') | 294 | out, err = self.run_bzr('export exported branch/subdir') |
3394 | 295 | self.assertEqual(['foo.txt'], os.listdir('exported')) | 295 | self.assertEqual(['foo.txt'], os.listdir('exported')) |
3395 | 296 | |||
3396 | 297 | def test_dir_export_per_file_timestamps(self): | ||
3397 | 298 | tree = self.example_branch() | ||
3398 | 299 | self.build_tree_contents([('branch/har', 'foo')]) | ||
3399 | 300 | tree.add('har') | ||
3400 | 301 | tree.commit('setup', timestamp=42) | ||
3401 | 302 | self.run_bzr('export --per-file-timestamps t branch') | ||
3402 | 303 | har_st = os.stat('t/har') | ||
3403 | 304 | self.assertEquals(42, har_st.st_mtime) | ||
3404 | 305 | |||
3405 | 296 | 306 | ||
3406 | === modified file 'bzrlib/tests/blackbox/test_filtered_view_ops.py' | |||
3407 | --- bzrlib/tests/blackbox/test_filtered_view_ops.py 2009-12-14 15:51:36 +0000 | |||
3408 | +++ bzrlib/tests/blackbox/test_filtered_view_ops.py 2010-04-06 07:24:41 +0000 | |||
3409 | @@ -1,4 +1,4 @@ | |||
3411 | 1 | # Copyright (C) 2008 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
3412 | 2 | # | 2 | # |
3413 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3414 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3415 | 5 | 5 | ||
3416 | === modified file 'bzrlib/tests/blackbox/test_help.py' | |||
3417 | --- bzrlib/tests/blackbox/test_help.py 2010-01-14 16:41:04 +0000 | |||
3418 | +++ bzrlib/tests/blackbox/test_help.py 2010-04-06 07:24:41 +0000 | |||
3419 | @@ -1,4 +1,4 @@ | |||
3421 | 1 | # Copyright (C) 2005, 2006 Canonical Ltd | 1 | # Copyright (C) 2006, 2007, 2009, 2010 Canonical Ltd |
3422 | 2 | # | 2 | # |
3423 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3424 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3425 | 5 | 5 | ||
3426 | === modified file 'bzrlib/tests/blackbox/test_ignore.py' | |||
3427 | --- bzrlib/tests/blackbox/test_ignore.py 2009-10-23 10:41:15 +0000 | |||
3428 | +++ bzrlib/tests/blackbox/test_ignore.py 2010-04-06 07:24:41 +0000 | |||
3429 | @@ -1,4 +1,4 @@ | |||
3431 | 1 | # Copyright (C) 2005, 2006 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3432 | 2 | # | 2 | # |
3433 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3434 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3435 | 5 | 5 | ||
3436 | === modified file 'bzrlib/tests/blackbox/test_info.py' | |||
3437 | --- bzrlib/tests/blackbox/test_info.py 2010-02-18 02:39:23 +0000 | |||
3438 | +++ bzrlib/tests/blackbox/test_info.py 2010-04-06 07:24:41 +0000 | |||
3439 | @@ -1228,7 +1228,8 @@ | |||
3440 | 1228 | # Do a light checkout of the heavy one | 1228 | # Do a light checkout of the heavy one |
3441 | 1229 | transport.mkdir('tree/lightcheckout') | 1229 | transport.mkdir('tree/lightcheckout') |
3442 | 1230 | lco_dir = bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout') | 1230 | lco_dir = bzrdir.BzrDirMetaFormat1().initialize('tree/lightcheckout') |
3444 | 1231 | branch.BranchReferenceFormat().initialize(lco_dir, co_branch) | 1231 | branch.BranchReferenceFormat().initialize(lco_dir, |
3445 | 1232 | target_branch=co_branch) | ||
3446 | 1232 | lco_dir.create_workingtree() | 1233 | lco_dir.create_workingtree() |
3447 | 1233 | lco_tree = lco_dir.open_workingtree() | 1234 | lco_tree = lco_dir.open_workingtree() |
3448 | 1234 | 1235 | ||
3449 | 1235 | 1236 | ||
3450 | === modified file 'bzrlib/tests/blackbox/test_init.py' | |||
3451 | --- bzrlib/tests/blackbox/test_init.py 2009-11-08 02:23:13 +0000 | |||
3452 | +++ bzrlib/tests/blackbox/test_init.py 2010-04-06 07:24:41 +0000 | |||
3453 | @@ -1,4 +1,4 @@ | |||
3455 | 1 | # Copyright (C) 2006, 2007, 2009 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3456 | 2 | # | 2 | # |
3457 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3458 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3459 | 5 | 5 | ||
3460 | === modified file 'bzrlib/tests/blackbox/test_ls.py' | |||
3461 | --- bzrlib/tests/blackbox/test_ls.py 2009-11-30 00:33:52 +0000 | |||
3462 | +++ bzrlib/tests/blackbox/test_ls.py 2010-04-06 07:24:41 +0000 | |||
3463 | @@ -1,4 +1,4 @@ | |||
3465 | 1 | # Copyright (C) 2006 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3466 | 2 | # | 2 | # |
3467 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3468 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3469 | 5 | 5 | ||
3470 | === modified file 'bzrlib/tests/blackbox/test_merge.py' | |||
3471 | --- bzrlib/tests/blackbox/test_merge.py 2009-12-10 17:16:19 +0000 | |||
3472 | +++ bzrlib/tests/blackbox/test_merge.py 2010-04-06 07:24:41 +0000 | |||
3473 | @@ -1,4 +1,4 @@ | |||
3475 | 1 | # Copyright (C) 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3476 | 2 | # | 2 | # |
3477 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3478 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3479 | 5 | 5 | ||
3480 | === modified file 'bzrlib/tests/blackbox/test_mv.py' | |||
3481 | --- bzrlib/tests/blackbox/test_mv.py 2009-11-17 01:08:08 +0000 | |||
3482 | +++ bzrlib/tests/blackbox/test_mv.py 2010-04-06 07:24:41 +0000 | |||
3483 | @@ -1,4 +1,4 @@ | |||
3485 | 1 | # Copyright (C) 2006 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3486 | 2 | # | 2 | # |
3487 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3488 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3489 | 5 | 5 | ||
3490 | === modified file 'bzrlib/tests/blackbox/test_nick.py' | |||
3491 | --- bzrlib/tests/blackbox/test_nick.py 2009-03-23 14:59:43 +0000 | |||
3492 | +++ bzrlib/tests/blackbox/test_nick.py 2010-04-06 07:24:41 +0000 | |||
3493 | @@ -30,11 +30,11 @@ | |||
3494 | 30 | self.make_branch_and_tree('me.dev') | 30 | self.make_branch_and_tree('me.dev') |
3495 | 31 | os.chdir('me.dev') | 31 | os.chdir('me.dev') |
3496 | 32 | nick = self.run_bzr('nick')[0] | 32 | nick = self.run_bzr('nick')[0] |
3498 | 33 | self.assertEqual(nick, 'me.dev\n') | 33 | self.assertEqual('me.dev\n', nick) |
3499 | 34 | # set the nickname | 34 | # set the nickname |
3500 | 35 | self.run_bzr("nick moo") | 35 | self.run_bzr("nick moo") |
3501 | 36 | nick = self.run_bzr('nick')[0] | 36 | nick = self.run_bzr('nick')[0] |
3503 | 37 | self.assertEqual(nick, 'moo\n') | 37 | self.assertEqual('moo\n', nick) |
3504 | 38 | 38 | ||
3505 | 39 | def test_autonick_urlencoded(self): | 39 | def test_autonick_urlencoded(self): |
3506 | 40 | # https://bugs.launchpad.net/bzr/+bug/66857 -- nick was printed | 40 | # https://bugs.launchpad.net/bzr/+bug/66857 -- nick was printed |
3507 | @@ -42,30 +42,30 @@ | |||
3508 | 42 | self.make_branch_and_tree('!repo') | 42 | self.make_branch_and_tree('!repo') |
3509 | 43 | os.chdir('!repo') | 43 | os.chdir('!repo') |
3510 | 44 | nick = self.run_bzr('nick')[0] | 44 | nick = self.run_bzr('nick')[0] |
3512 | 45 | self.assertEqual(nick, '!repo\n') | 45 | self.assertEqual('!repo\n', nick) |
3513 | 46 | 46 | ||
3514 | 47 | def test_bound_nick(self): | 47 | def test_bound_nick(self): |
3515 | 48 | """Check that nick works well for checkouts.""" | 48 | """Check that nick works well for checkouts.""" |
3516 | 49 | base = self.make_branch_and_tree('base') | 49 | base = self.make_branch_and_tree('base') |
3517 | 50 | child = self.make_branch_and_tree('child') | 50 | child = self.make_branch_and_tree('child') |
3518 | 51 | os.chdir('child') | 51 | os.chdir('child') |
3522 | 52 | self.assertEqual(self.run_bzr('nick')[0][:-1], 'child') | 52 | self.assertEqual('child', self.run_bzr('nick')[0][:-1]) |
3523 | 53 | self.assertEqual(child.branch.get_config().has_explicit_nickname(), | 53 | self.assertEqual(False, |
3524 | 54 | False) | 54 | child.branch.get_config().has_explicit_nickname()) |
3525 | 55 | self.run_bzr('bind ../base') | 55 | self.run_bzr('bind ../base') |
3529 | 56 | self.assertEqual(self.run_bzr('nick')[0][:-1], base.branch.nick) | 56 | self.assertEqual(base.branch.nick, self.run_bzr('nick')[0][:-1]) |
3530 | 57 | self.assertEqual(child.branch.get_config().has_explicit_nickname(), | 57 | self.assertEqual(False, |
3531 | 58 | False) | 58 | child.branch.get_config().has_explicit_nickname()) |
3532 | 59 | 59 | ||
3533 | 60 | self.run_bzr('unbind') | 60 | self.run_bzr('unbind') |
3534 | 61 | self.run_bzr("nick explicit_nick") | 61 | self.run_bzr("nick explicit_nick") |
3538 | 62 | self.assertEqual(self.run_bzr('nick')[0][:-1], "explicit_nick") | 62 | self.assertEqual("explicit_nick", self.run_bzr('nick')[0][:-1]) |
3539 | 63 | self.assertEqual(child.branch.get_config()._get_explicit_nickname(), | 63 | self.assertEqual("explicit_nick", |
3540 | 64 | "explicit_nick") | 64 | child.branch.get_config()._get_explicit_nickname()) |
3541 | 65 | self.run_bzr('bind ../base') | 65 | self.run_bzr('bind ../base') |
3545 | 66 | self.assertEqual(self.run_bzr('nick')[0][:-1], base.branch.nick) | 66 | self.assertEqual(base.branch.nick, self.run_bzr('nick')[0][:-1]) |
3546 | 67 | self.assertEqual(child.branch.get_config()._get_explicit_nickname(), | 67 | self.assertEqual(base.branch.nick, |
3547 | 68 | base.branch.nick) | 68 | child.branch.get_config()._get_explicit_nickname()) |
3548 | 69 | 69 | ||
3549 | 70 | def test_boundless_nick(self): | 70 | def test_boundless_nick(self): |
3550 | 71 | """Nick defaults to implicit local nick when bound branch is AWOL""" | 71 | """Nick defaults to implicit local nick when bound branch is AWOL""" |
3551 | @@ -73,8 +73,8 @@ | |||
3552 | 73 | child = self.make_branch_and_tree('child') | 73 | child = self.make_branch_and_tree('child') |
3553 | 74 | os.chdir('child') | 74 | os.chdir('child') |
3554 | 75 | self.run_bzr('bind ../base') | 75 | self.run_bzr('bind ../base') |
3558 | 76 | self.assertEqual(self.run_bzr('nick')[0][:-1], base.branch.nick) | 76 | self.assertEqual(base.branch.nick, self.run_bzr('nick')[0][:-1]) |
3559 | 77 | self.assertEqual(child.branch.get_config().has_explicit_nickname(), | 77 | self.assertEqual(False, |
3560 | 78 | False) | 78 | child.branch.get_config().has_explicit_nickname()) |
3561 | 79 | osutils.rmtree('../base') | 79 | osutils.rmtree('../base') |
3563 | 80 | self.assertEqual(self.run_bzr('nick')[0][:-1], 'child') | 80 | self.assertEqual('child', self.run_bzr('nick')[0][:-1]) |
3564 | 81 | 81 | ||
3565 | === modified file 'bzrlib/tests/blackbox/test_non_ascii.py' | |||
3566 | --- bzrlib/tests/blackbox/test_non_ascii.py 2010-01-25 17:48:22 +0000 | |||
3567 | +++ bzrlib/tests/blackbox/test_non_ascii.py 2010-04-06 07:24:41 +0000 | |||
3568 | @@ -1,4 +1,4 @@ | |||
3570 | 1 | # Copyright (C) 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3571 | 2 | # | 2 | # |
3572 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3573 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3574 | 5 | 5 | ||
3575 | === modified file 'bzrlib/tests/blackbox/test_pull.py' | |||
3576 | --- bzrlib/tests/blackbox/test_pull.py 2010-01-29 11:17:16 +0000 | |||
3577 | +++ bzrlib/tests/blackbox/test_pull.py 2010-04-06 07:24:41 +0000 | |||
3578 | @@ -1,4 +1,4 @@ | |||
3580 | 1 | # Copyright (C) 2005, 2006, 2010 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
3581 | 2 | # | 2 | # |
3582 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3583 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3584 | 5 | 5 | ||
3585 | === modified file 'bzrlib/tests/blackbox/test_push.py' | |||
3586 | --- bzrlib/tests/blackbox/test_push.py 2010-02-11 09:21:45 +0000 | |||
3587 | +++ bzrlib/tests/blackbox/test_push.py 2010-04-06 07:24:41 +0000 | |||
3588 | @@ -1,4 +1,4 @@ | |||
3590 | 1 | # Copyright (C) 2005, 2007, 2008 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3591 | 2 | # | 2 | # |
3592 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3593 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3594 | 5 | 5 | ||
3595 | === modified file 'bzrlib/tests/blackbox/test_remerge.py' | |||
3596 | --- bzrlib/tests/blackbox/test_remerge.py 2009-12-10 23:11:35 +0000 | |||
3597 | +++ bzrlib/tests/blackbox/test_remerge.py 2010-04-06 07:24:41 +0000 | |||
3598 | @@ -1,4 +1,4 @@ | |||
3600 | 1 | # Copyright (C) 2005, 2006 Canonical Ltd | 1 | # Copyright (C) 2006, 2007, 2009, 2010 Canonical Ltd |
3601 | 2 | # | 2 | # |
3602 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3603 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3604 | 5 | 5 | ||
3605 | === modified file 'bzrlib/tests/blackbox/test_send.py' | |||
3606 | --- bzrlib/tests/blackbox/test_send.py 2010-02-11 09:21:45 +0000 | |||
3607 | +++ bzrlib/tests/blackbox/test_send.py 2010-04-06 07:24:41 +0000 | |||
3608 | @@ -1,4 +1,4 @@ | |||
3610 | 1 | # Copyright (C) 2006, 2007, 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3611 | 2 | # Authors: Aaron Bentley | 2 | # Authors: Aaron Bentley |
3612 | 3 | # | 3 | # |
3613 | 4 | # This program is free software; you can redistribute it and/or modify | 4 | # This program is free software; you can redistribute it and/or modify |
3614 | 5 | 5 | ||
3615 | === modified file 'bzrlib/tests/blackbox/test_serve.py' | |||
3616 | --- bzrlib/tests/blackbox/test_serve.py 2010-01-07 03:03:01 +0000 | |||
3617 | +++ bzrlib/tests/blackbox/test_serve.py 2010-04-06 07:24:41 +0000 | |||
3618 | @@ -1,4 +1,4 @@ | |||
3620 | 1 | # Copyright (C) 2006 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3621 | 2 | # | 2 | # |
3622 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3623 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3624 | 5 | 5 | ||
3625 | === modified file 'bzrlib/tests/blackbox/test_shared_repository.py' | |||
3626 | --- bzrlib/tests/blackbox/test_shared_repository.py 2010-01-12 01:10:03 +0000 | |||
3627 | +++ bzrlib/tests/blackbox/test_shared_repository.py 2010-04-06 07:24:41 +0000 | |||
3628 | @@ -1,4 +1,4 @@ | |||
3630 | 1 | # Copyright (C) 2005, 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3631 | 2 | # | 2 | # |
3632 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3633 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3634 | 5 | 5 | ||
3635 | === modified file 'bzrlib/tests/blackbox/test_shelve.py' | |||
3636 | --- bzrlib/tests/blackbox/test_shelve.py 2009-12-11 05:48:21 +0000 | |||
3637 | +++ bzrlib/tests/blackbox/test_shelve.py 2010-04-06 07:24:41 +0000 | |||
3638 | @@ -1,4 +1,4 @@ | |||
3640 | 1 | # Copyright (C) 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
3641 | 2 | # | 2 | # |
3642 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3643 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3644 | 5 | 5 | ||
3645 | === modified file 'bzrlib/tests/blackbox/test_status.py' | |||
3646 | --- bzrlib/tests/blackbox/test_status.py 2009-07-08 14:37:25 +0000 | |||
3647 | +++ bzrlib/tests/blackbox/test_status.py 2010-04-06 07:24:41 +0000 | |||
3648 | @@ -498,7 +498,8 @@ | |||
3649 | 498 | def make_branch_and_tree(self, relpath): | 498 | def make_branch_and_tree(self, relpath): |
3650 | 499 | source = self.make_branch(pathjoin('..', relpath)) | 499 | source = self.make_branch(pathjoin('..', relpath)) |
3651 | 500 | checkout = bzrdir.BzrDirMetaFormat1().initialize(relpath) | 500 | checkout = bzrdir.BzrDirMetaFormat1().initialize(relpath) |
3653 | 501 | bzrlib.branch.BranchReferenceFormat().initialize(checkout, source) | 501 | bzrlib.branch.BranchReferenceFormat().initialize(checkout, |
3654 | 502 | target_branch=source) | ||
3655 | 502 | return checkout.create_workingtree() | 503 | return checkout.create_workingtree() |
3656 | 503 | 504 | ||
3657 | 504 | 505 | ||
3658 | 505 | 506 | ||
3659 | === modified file 'bzrlib/tests/blackbox/test_switch.py' | |||
3660 | --- bzrlib/tests/blackbox/test_switch.py 2010-01-12 03:53:21 +0000 | |||
3661 | +++ bzrlib/tests/blackbox/test_switch.py 2010-04-06 07:24:41 +0000 | |||
3662 | @@ -1,4 +1,4 @@ | |||
3664 | 1 | # Copyright (C) 2007, 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
3665 | 2 | # -*- coding: utf-8 -*- | 2 | # -*- coding: utf-8 -*- |
3666 | 3 | # | 3 | # |
3667 | 4 | # This program is free software; you can redistribute it and/or modify | 4 | # This program is free software; you can redistribute it and/or modify |
3668 | 5 | 5 | ||
3669 | === modified file 'bzrlib/tests/blackbox/test_too_much.py' | |||
3670 | --- bzrlib/tests/blackbox/test_too_much.py 2009-12-02 15:24:34 +0000 | |||
3671 | +++ bzrlib/tests/blackbox/test_too_much.py 2010-04-06 07:24:41 +0000 | |||
3672 | @@ -1,4 +1,4 @@ | |||
3674 | 1 | # Copyright (C) 2005, 2007 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
3675 | 2 | # | 2 | # |
3676 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3677 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3678 | 5 | 5 | ||
3679 | === modified file 'bzrlib/tests/blackbox/test_uncommit.py' | |||
3680 | --- bzrlib/tests/blackbox/test_uncommit.py 2010-02-10 17:52:08 +0000 | |||
3681 | +++ bzrlib/tests/blackbox/test_uncommit.py 2010-04-06 07:24:41 +0000 | |||
3682 | @@ -216,7 +216,7 @@ | |||
3683 | 216 | 216 | ||
3684 | 217 | def test_uncommit_shows_log_with_revision_id(self): | 217 | def test_uncommit_shows_log_with_revision_id(self): |
3685 | 218 | wt = self.create_simple_tree() | 218 | wt = self.create_simple_tree() |
3687 | 219 | 219 | ||
3688 | 220 | script = ScriptRunner() | 220 | script = ScriptRunner() |
3689 | 221 | script.run_script(self, """ | 221 | script.run_script(self, """ |
3690 | 222 | $ cd tree | 222 | $ cd tree |
3691 | 223 | 223 | ||
3692 | === modified file 'bzrlib/tests/blackbox/test_update.py' | |||
3693 | --- bzrlib/tests/blackbox/test_update.py 2010-02-10 17:52:08 +0000 | |||
3694 | +++ bzrlib/tests/blackbox/test_update.py 2010-04-06 07:24:41 +0000 | |||
3695 | @@ -1,5 +1,4 @@ | |||
3696 | 1 | # Copyright (C) 2006-2010 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3697 | 2 | # -*- coding: utf-8 -*- | ||
3698 | 3 | # | 2 | # |
3699 | 4 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3700 | 5 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3701 | @@ -196,7 +195,8 @@ | |||
3702 | 196 | 195 | ||
3703 | 197 | self.build_tree(['checkout1/']) | 196 | self.build_tree(['checkout1/']) |
3704 | 198 | checkout_dir = bzrdir.BzrDirMetaFormat1().initialize('checkout1') | 197 | checkout_dir = bzrdir.BzrDirMetaFormat1().initialize('checkout1') |
3706 | 199 | branch.BranchReferenceFormat().initialize(checkout_dir, master.branch) | 198 | branch.BranchReferenceFormat().initialize(checkout_dir, |
3707 | 199 | target_branch=master.branch) | ||
3708 | 200 | checkout1 = checkout_dir.create_workingtree('m1') | 200 | checkout1 = checkout_dir.create_workingtree('m1') |
3709 | 201 | 201 | ||
3710 | 202 | # Create a second branch, with an extra commit | 202 | # Create a second branch, with an extra commit |
3711 | @@ -341,6 +341,7 @@ | |||
3712 | 341 | # now update (and get conflicts) | 341 | # now update (and get conflicts) |
3713 | 342 | out, err = self.run_bzr('update lightweight', retcode=1) | 342 | out, err = self.run_bzr('update lightweight', retcode=1) |
3714 | 343 | self.assertEqual('', out) | 343 | self.assertEqual('', out) |
3715 | 344 | # NB: these conflicts are actually in the source code | ||
3716 | 344 | self.assertFileEqual('''\ | 345 | self.assertFileEqual('''\ |
3717 | 345 | <<<<<<< TREE | 346 | <<<<<<< TREE |
3718 | 346 | lightweight local changes | 347 | lightweight local changes |
3719 | @@ -358,6 +359,7 @@ | |||
3720 | 358 | # check we get the second conflict | 359 | # check we get the second conflict |
3721 | 359 | out, err = self.run_bzr('update lightweight', retcode=1) | 360 | out, err = self.run_bzr('update lightweight', retcode=1) |
3722 | 360 | self.assertEqual('', out) | 361 | self.assertEqual('', out) |
3723 | 362 | # NB: these conflicts are actually in the source code | ||
3724 | 361 | self.assertFileEqual('''\ | 363 | self.assertFileEqual('''\ |
3725 | 362 | <<<<<<< TREE | 364 | <<<<<<< TREE |
3726 | 363 | lightweight+checkout | 365 | lightweight+checkout |
3727 | @@ -366,4 +368,3 @@ | |||
3728 | 366 | >>>>>>> MERGE-SOURCE | 368 | >>>>>>> MERGE-SOURCE |
3729 | 367 | ''', | 369 | ''', |
3730 | 368 | 'lightweight/file') | 370 | 'lightweight/file') |
3731 | 369 | |||
3732 | 370 | 371 | ||
3733 | === modified file 'bzrlib/tests/blackbox/test_versioning.py' | |||
3734 | --- bzrlib/tests/blackbox/test_versioning.py 2009-08-28 05:00:33 +0000 | |||
3735 | +++ bzrlib/tests/blackbox/test_versioning.py 2010-04-06 07:24:41 +0000 | |||
3736 | @@ -1,4 +1,4 @@ | |||
3738 | 1 | # Copyright (C) 2005 Canonical Ltd | 1 | # Copyright (C) 2005, 2006, 2007, 2009, 2010 Canonical Ltd |
3739 | 2 | # | 2 | # |
3740 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3741 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3742 | @@ -29,16 +29,29 @@ | |||
3743 | 29 | from bzrlib.workingtree import WorkingTree | 29 | from bzrlib.workingtree import WorkingTree |
3744 | 30 | 30 | ||
3745 | 31 | 31 | ||
3746 | 32 | class TestMkdir(TestCaseWithTransport): | ||
3747 | 33 | |||
3748 | 34 | def test_mkdir_fails_cleanly(self): | ||
3749 | 35 | """'mkdir' fails cleanly when no working tree is available. | ||
3750 | 36 | https://bugs.edge.launchpad.net/bzr/+bug/138600 | ||
3751 | 37 | """ | ||
3752 | 38 | # Since there is a safety working tree above us, we create a bare repo | ||
3753 | 39 | # here locally. | ||
3754 | 40 | shared_repo = self.make_repository('.') | ||
3755 | 41 | self.run_bzr(['mkdir', 'abc'], retcode=3) | ||
3756 | 42 | self.failIfExists('abc') | ||
3757 | 43 | |||
3758 | 44 | |||
3759 | 32 | class TestVersioning(TestCaseInTempDir): | 45 | class TestVersioning(TestCaseInTempDir): |
3760 | 33 | 46 | ||
3761 | 34 | def test_mkdir(self): | 47 | def test_mkdir(self): |
3762 | 35 | """Basic 'bzr mkdir' operation""" | 48 | """Basic 'bzr mkdir' operation""" |
3763 | 36 | 49 | ||
3764 | 37 | self.run_bzr('init') | 50 | self.run_bzr('init') |
3766 | 38 | self.run_bzr('mkdir foo') | 51 | self.run_bzr(['mkdir', 'foo']) |
3767 | 39 | self.assert_(os.path.isdir('foo')) | 52 | self.assert_(os.path.isdir('foo')) |
3768 | 40 | 53 | ||
3770 | 41 | self.run_bzr('mkdir foo', retcode=3) | 54 | self.run_bzr(['mkdir', 'foo'], retcode=3) |
3771 | 42 | 55 | ||
3772 | 43 | wt = WorkingTree.open('.') | 56 | wt = WorkingTree.open('.') |
3773 | 44 | 57 | ||
3774 | @@ -54,12 +67,12 @@ | |||
3775 | 54 | """'bzr mkdir' operation in subdirectory""" | 67 | """'bzr mkdir' operation in subdirectory""" |
3776 | 55 | 68 | ||
3777 | 56 | self.run_bzr('init') | 69 | self.run_bzr('init') |
3779 | 57 | self.run_bzr('mkdir dir') | 70 | self.run_bzr(['mkdir', 'dir']) |
3780 | 58 | self.assert_(os.path.isdir('dir')) | 71 | self.assert_(os.path.isdir('dir')) |
3781 | 59 | 72 | ||
3782 | 60 | os.chdir('dir') | 73 | os.chdir('dir') |
3783 | 61 | self.log('Run mkdir in subdir') | 74 | self.log('Run mkdir in subdir') |
3785 | 62 | self.run_bzr('mkdir subdir') | 75 | self.run_bzr(['mkdir', 'subdir']) |
3786 | 63 | self.assert_(os.path.isdir('subdir')) | 76 | self.assert_(os.path.isdir('subdir')) |
3787 | 64 | os.chdir('..') | 77 | os.chdir('..') |
3788 | 65 | 78 | ||
3789 | @@ -86,7 +99,7 @@ | |||
3790 | 86 | self.run_bzr('init') | 99 | self.run_bzr('init') |
3791 | 87 | os.chdir('../..') | 100 | os.chdir('../..') |
3792 | 88 | 101 | ||
3794 | 89 | self.run_bzr('mkdir dir a/dir a/b/dir') | 102 | self.run_bzr(['mkdir', 'dir', 'a/dir', 'a/b/dir']) |
3795 | 90 | self.failUnless(os.path.isdir('dir')) | 103 | self.failUnless(os.path.isdir('dir')) |
3796 | 91 | self.failUnless(os.path.isdir('a/dir')) | 104 | self.failUnless(os.path.isdir('a/dir')) |
3797 | 92 | self.failUnless(os.path.isdir('a/b/dir')) | 105 | self.failUnless(os.path.isdir('a/b/dir')) |
3798 | 93 | 106 | ||
3799 | === modified file 'bzrlib/tests/commands/test_branch.py' | |||
3800 | --- bzrlib/tests/commands/test_branch.py 2010-01-11 12:37:53 +0000 | |||
3801 | +++ bzrlib/tests/commands/test_branch.py 2010-04-06 07:24:41 +0000 | |||
3802 | @@ -1,4 +1,4 @@ | |||
3804 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007, 2009, 2010 Canonical Ltd |
3805 | 2 | # | 2 | # |
3806 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3807 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3808 | 5 | 5 | ||
3809 | === modified file 'bzrlib/tests/commands/test_cat.py' | |||
3810 | --- bzrlib/tests/commands/test_cat.py 2010-01-25 17:48:22 +0000 | |||
3811 | +++ bzrlib/tests/commands/test_cat.py 2010-04-06 07:24:41 +0000 | |||
3812 | @@ -1,4 +1,4 @@ | |||
3814 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007, 2009, 2010 Canonical Ltd |
3815 | 2 | # | 2 | # |
3816 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3817 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3818 | 5 | 5 | ||
3819 | === modified file 'bzrlib/tests/commands/test_checkout.py' | |||
3820 | --- bzrlib/tests/commands/test_checkout.py 2010-01-11 12:37:53 +0000 | |||
3821 | +++ bzrlib/tests/commands/test_checkout.py 2010-04-06 07:24:41 +0000 | |||
3822 | @@ -1,4 +1,4 @@ | |||
3824 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007, 2009, 2010 Canonical Ltd |
3825 | 2 | # | 2 | # |
3826 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3827 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3828 | 5 | 5 | ||
3829 | === modified file 'bzrlib/tests/commands/test_commit.py' | |||
3830 | --- bzrlib/tests/commands/test_commit.py 2010-01-11 12:37:53 +0000 | |||
3831 | +++ bzrlib/tests/commands/test_commit.py 2010-04-06 07:24:41 +0000 | |||
3832 | @@ -1,4 +1,4 @@ | |||
3834 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
3835 | 2 | # | 2 | # |
3836 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3837 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3838 | @@ -53,8 +53,7 @@ | |||
3839 | 53 | # commit do not provide a directory parameter, we have to change dir | 53 | # commit do not provide a directory parameter, we have to change dir |
3840 | 54 | # manually | 54 | # manually |
3841 | 55 | os.chdir('local') | 55 | os.chdir('local') |
3844 | 56 | # cmd_commit translates BoundBranchOutOfDate into BzrCommandError | 56 | self.assertRaises(errors.BoundBranchOutOfDate, commit.run, |
3843 | 57 | self.assertRaises(errors.BzrCommandError, commit.run, | ||
3845 | 58 | message=u'empty commit', unchanged=True) | 57 | message=u'empty commit', unchanged=True) |
3846 | 59 | self.assertEquals(1, len(self.connections)) | 58 | self.assertEquals(1, len(self.connections)) |
3847 | 60 | 59 | ||
3848 | 61 | 60 | ||
3849 | === modified file 'bzrlib/tests/commands/test_init.py' | |||
3850 | --- bzrlib/tests/commands/test_init.py 2010-01-11 12:37:53 +0000 | |||
3851 | +++ bzrlib/tests/commands/test_init.py 2010-04-06 07:24:41 +0000 | |||
3852 | @@ -1,4 +1,4 @@ | |||
3854 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
3855 | 2 | # | 2 | # |
3856 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3857 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3858 | 5 | 5 | ||
3859 | === modified file 'bzrlib/tests/commands/test_init_repository.py' | |||
3860 | --- bzrlib/tests/commands/test_init_repository.py 2010-01-11 12:37:53 +0000 | |||
3861 | +++ bzrlib/tests/commands/test_init_repository.py 2010-04-06 07:24:41 +0000 | |||
3862 | @@ -1,4 +1,4 @@ | |||
3864 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
3865 | 2 | # | 2 | # |
3866 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3867 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3868 | 5 | 5 | ||
3869 | === modified file 'bzrlib/tests/commands/test_merge.py' | |||
3870 | --- bzrlib/tests/commands/test_merge.py 2010-01-11 12:37:53 +0000 | |||
3871 | +++ bzrlib/tests/commands/test_merge.py 2010-04-06 07:24:41 +0000 | |||
3872 | @@ -1,4 +1,4 @@ | |||
3874 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007, 2009, 2010 Canonical Ltd |
3875 | 2 | # | 2 | # |
3876 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3877 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3878 | 5 | 5 | ||
3879 | === modified file 'bzrlib/tests/commands/test_missing.py' | |||
3880 | --- bzrlib/tests/commands/test_missing.py 2010-01-11 12:37:53 +0000 | |||
3881 | +++ bzrlib/tests/commands/test_missing.py 2010-04-06 07:24:41 +0000 | |||
3882 | @@ -1,4 +1,4 @@ | |||
3884 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007, 2009, 2010 Canonical Ltd |
3885 | 2 | # | 2 | # |
3886 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3887 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3888 | 5 | 5 | ||
3889 | === modified file 'bzrlib/tests/commands/test_pull.py' | |||
3890 | --- bzrlib/tests/commands/test_pull.py 2010-01-11 12:37:53 +0000 | |||
3891 | +++ bzrlib/tests/commands/test_pull.py 2010-04-06 07:24:41 +0000 | |||
3892 | @@ -1,4 +1,4 @@ | |||
3894 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007, 2009, 2010 Canonical Ltd |
3895 | 2 | # | 2 | # |
3896 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3897 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3898 | 5 | 5 | ||
3899 | === modified file 'bzrlib/tests/commands/test_push.py' | |||
3900 | --- bzrlib/tests/commands/test_push.py 2010-01-11 12:37:53 +0000 | |||
3901 | +++ bzrlib/tests/commands/test_push.py 2010-04-06 07:24:41 +0000 | |||
3902 | @@ -1,4 +1,4 @@ | |||
3904 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
3905 | 2 | # | 2 | # |
3906 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3907 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3908 | 5 | 5 | ||
3909 | === modified file 'bzrlib/tests/commands/test_update.py' | |||
3910 | --- bzrlib/tests/commands/test_update.py 2010-01-11 12:37:53 +0000 | |||
3911 | +++ bzrlib/tests/commands/test_update.py 2010-04-06 07:24:41 +0000 | |||
3912 | @@ -1,4 +1,4 @@ | |||
3914 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007, 2009, 2010 Canonical Ltd |
3915 | 2 | # | 2 | # |
3916 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3917 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3918 | 5 | 5 | ||
3919 | === modified file 'bzrlib/tests/ftp_server/__init__.py' | |||
3920 | --- bzrlib/tests/ftp_server/__init__.py 2010-01-07 03:03:01 +0000 | |||
3921 | +++ bzrlib/tests/ftp_server/__init__.py 2010-04-06 07:24:41 +0000 | |||
3922 | @@ -1,4 +1,4 @@ | |||
3924 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
3925 | 2 | # | 2 | # |
3926 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3927 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3928 | 5 | 5 | ||
3929 | === modified file 'bzrlib/tests/ftp_server/medusa_based.py' | |||
3930 | --- bzrlib/tests/ftp_server/medusa_based.py 2010-02-09 17:35:07 +0000 | |||
3931 | +++ bzrlib/tests/ftp_server/medusa_based.py 2010-04-06 07:24:41 +0000 | |||
3932 | @@ -1,4 +1,4 @@ | |||
3934 | 1 | # Copyright (C) 2007, 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
3935 | 2 | # | 2 | # |
3936 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3937 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3938 | 5 | 5 | ||
3939 | === modified file 'bzrlib/tests/ftp_server/pyftpdlib_based.py' | |||
3940 | --- bzrlib/tests/ftp_server/pyftpdlib_based.py 2010-02-09 17:33:44 +0000 | |||
3941 | +++ bzrlib/tests/ftp_server/pyftpdlib_based.py 2010-04-06 07:24:41 +0000 | |||
3942 | @@ -1,4 +1,4 @@ | |||
3944 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
3945 | 2 | # | 2 | # |
3946 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3947 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3948 | 5 | 5 | ||
3949 | === modified file 'bzrlib/tests/http_server.py' | |||
3950 | --- bzrlib/tests/http_server.py 2010-02-09 20:49:50 +0000 | |||
3951 | +++ bzrlib/tests/http_server.py 2010-04-06 07:24:41 +0000 | |||
3952 | @@ -1,4 +1,4 @@ | |||
3954 | 1 | # Copyright (C) 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
3955 | 2 | # | 2 | # |
3956 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3957 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3958 | 5 | 5 | ||
3959 | === modified file 'bzrlib/tests/http_utils.py' | |||
3960 | --- bzrlib/tests/http_utils.py 2010-01-07 03:03:01 +0000 | |||
3961 | +++ bzrlib/tests/http_utils.py 2010-04-06 07:24:41 +0000 | |||
3962 | @@ -1,4 +1,4 @@ | |||
3964 | 1 | # Copyright (C) 2005 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
3965 | 2 | # | 2 | # |
3966 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
3967 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
3968 | 5 | 5 | ||
3969 | === modified file 'bzrlib/tests/per_branch/test_branch.py' | |||
3970 | --- bzrlib/tests/per_branch/test_branch.py 2010-02-11 09:27:55 +0000 | |||
3971 | +++ bzrlib/tests/per_branch/test_branch.py 2010-04-06 07:24:41 +0000 | |||
3972 | @@ -379,6 +379,23 @@ | |||
3973 | 379 | self.assertEqual(committed.properties["branch-nick"], | 379 | self.assertEqual(committed.properties["branch-nick"], |
3974 | 380 | "My happy branch") | 380 | "My happy branch") |
3975 | 381 | 381 | ||
3976 | 382 | def test_create_colocated(self): | ||
3977 | 383 | try: | ||
3978 | 384 | repo = self.make_repository('.', shared=True) | ||
3979 | 385 | except errors.IncompatibleFormat: | ||
3980 | 386 | return | ||
3981 | 387 | self.assertEquals(0, len(repo.bzrdir.list_branches())) | ||
3982 | 388 | try: | ||
3983 | 389 | child_branch1 = self.branch_format.initialize(repo.bzrdir, | ||
3984 | 390 | name='branch1') | ||
3985 | 391 | except (errors.UninitializableFormat, errors.NoColocatedBranchSupport): | ||
3986 | 392 | # branch references are not default init'able and | ||
3987 | 393 | # not all bzrdirs support colocated branches. | ||
3988 | 394 | return | ||
3989 | 395 | self.assertEquals(1, len(repo.bzrdir.list_branches())) | ||
3990 | 396 | self.branch_format.initialize(repo.bzrdir, name='branch2') | ||
3991 | 397 | self.assertEquals(2, len(repo.bzrdir.list_branches())) | ||
3992 | 398 | |||
3993 | 382 | def test_create_open_branch_uses_repository(self): | 399 | def test_create_open_branch_uses_repository(self): |
3994 | 383 | try: | 400 | try: |
3995 | 384 | repo = self.make_repository('.', shared=True) | 401 | repo = self.make_repository('.', shared=True) |
3996 | 385 | 402 | ||
3997 | === modified file 'bzrlib/tests/per_branch/test_iter_merge_sorted_revisions.py' | |||
3998 | --- bzrlib/tests/per_branch/test_iter_merge_sorted_revisions.py 2009-12-03 23:34:38 +0000 | |||
3999 | +++ bzrlib/tests/per_branch/test_iter_merge_sorted_revisions.py 2010-04-06 07:24:41 +0000 | |||
4000 | @@ -1,4 +1,4 @@ | |||
4002 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
4003 | 2 | # | 2 | # |
4004 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4005 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4006 | 5 | 5 | ||
4007 | === modified file 'bzrlib/tests/per_branch/test_parent.py' | |||
4008 | --- bzrlib/tests/per_branch/test_parent.py 2009-11-08 03:00:33 +0000 | |||
4009 | +++ bzrlib/tests/per_branch/test_parent.py 2010-04-06 07:24:41 +0000 | |||
4010 | @@ -1,4 +1,4 @@ | |||
4012 | 1 | # Copyright (C) 2004, 2005, 2006 Canonical Ltd | 1 | # Copyright (C) 2005, 2006, 2007, 2009, 2010 Canonical Ltd |
4013 | 2 | # | 2 | # |
4014 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4015 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4016 | 5 | 5 | ||
4017 | === modified file 'bzrlib/tests/per_bzrdir/test_bzrdir.py' | |||
4018 | --- bzrlib/tests/per_bzrdir/test_bzrdir.py 2010-02-15 22:58:59 +0000 | |||
4019 | +++ bzrlib/tests/per_bzrdir/test_bzrdir.py 2010-04-06 07:24:41 +0000 | |||
4020 | @@ -1,4 +1,4 @@ | |||
4022 | 1 | # Copyright (C) 2005, 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
4023 | 2 | # | 2 | # |
4024 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4025 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4026 | @@ -247,11 +247,22 @@ | |||
4027 | 247 | try: | 247 | try: |
4028 | 248 | bzrdir.destroy_branch() | 248 | bzrdir.destroy_branch() |
4029 | 249 | except (errors.UnsupportedOperation, errors.TransportNotPossible): | 249 | except (errors.UnsupportedOperation, errors.TransportNotPossible): |
4031 | 250 | raise TestNotApplicable('Format does not support destroying tree') | 250 | raise TestNotApplicable('Format does not support destroying branch') |
4032 | 251 | self.assertRaises(errors.NotBranchError, bzrdir.open_branch) | 251 | self.assertRaises(errors.NotBranchError, bzrdir.open_branch) |
4033 | 252 | bzrdir.create_branch() | 252 | bzrdir.create_branch() |
4034 | 253 | bzrdir.open_branch() | 253 | bzrdir.open_branch() |
4035 | 254 | 254 | ||
4036 | 255 | def test_destroy_colocated_branch(self): | ||
4037 | 256 | branch = self.make_branch('branch') | ||
4038 | 257 | bzrdir = branch.bzrdir | ||
4039 | 258 | try: | ||
4040 | 259 | colo_branch = bzrdir.create_branch('colo') | ||
4041 | 260 | except errors.NoColocatedBranchSupport: | ||
4042 | 261 | raise TestNotApplicable('BzrDir does not do colocated branches') | ||
4043 | 262 | bzrdir.destroy_branch("colo") | ||
4044 | 263 | self.assertRaises(errors.NotBranchError, bzrdir.open_branch, | ||
4045 | 264 | "colo") | ||
4046 | 265 | |||
4047 | 255 | def test_destroy_repository(self): | 266 | def test_destroy_repository(self): |
4048 | 256 | repo = self.make_repository('repository') | 267 | repo = self.make_repository('repository') |
4049 | 257 | bzrdir = repo.bzrdir | 268 | bzrdir = repo.bzrdir |
4050 | @@ -523,7 +534,7 @@ | |||
4051 | 523 | dir = self.make_bzrdir('source') | 534 | dir = self.make_bzrdir('source') |
4052 | 524 | try: | 535 | try: |
4053 | 525 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, | 536 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, |
4055 | 526 | referenced_branch) | 537 | target_branch=referenced_branch) |
4056 | 527 | except errors.IncompatibleFormat: | 538 | except errors.IncompatibleFormat: |
4057 | 528 | # this is ok too, not all formats have to support references. | 539 | # this is ok too, not all formats have to support references. |
4058 | 529 | return | 540 | return |
4059 | @@ -626,7 +637,7 @@ | |||
4060 | 626 | dir = self.make_bzrdir('source') | 637 | dir = self.make_bzrdir('source') |
4061 | 627 | try: | 638 | try: |
4062 | 628 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, | 639 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, |
4064 | 629 | referenced_branch) | 640 | target_branch=referenced_branch) |
4065 | 630 | except errors.IncompatibleFormat: | 641 | except errors.IncompatibleFormat: |
4066 | 631 | # this is ok too, not all formats have to support references. | 642 | # this is ok too, not all formats have to support references. |
4067 | 632 | return | 643 | return |
4068 | @@ -691,7 +702,7 @@ | |||
4069 | 691 | dir = self.make_bzrdir('source') | 702 | dir = self.make_bzrdir('source') |
4070 | 692 | try: | 703 | try: |
4071 | 693 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, | 704 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, |
4073 | 694 | referenced_branch) | 705 | target_branch=referenced_branch) |
4074 | 695 | except errors.IncompatibleFormat: | 706 | except errors.IncompatibleFormat: |
4075 | 696 | # this is ok too, not all formats have to support references. | 707 | # this is ok too, not all formats have to support references. |
4076 | 697 | return | 708 | return |
4077 | @@ -966,7 +977,7 @@ | |||
4078 | 966 | dir = self.make_bzrdir('source') | 977 | dir = self.make_bzrdir('source') |
4079 | 967 | try: | 978 | try: |
4080 | 968 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, | 979 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, |
4082 | 969 | referenced_branch) | 980 | target_branch=referenced_branch) |
4083 | 970 | except errors.IncompatibleFormat: | 981 | except errors.IncompatibleFormat: |
4084 | 971 | # this is ok too, not all formats have to support references. | 982 | # this is ok too, not all formats have to support references. |
4085 | 972 | return | 983 | return |
4086 | @@ -986,7 +997,7 @@ | |||
4087 | 986 | dir = self.make_bzrdir('source') | 997 | dir = self.make_bzrdir('source') |
4088 | 987 | try: | 998 | try: |
4089 | 988 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, | 999 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, |
4091 | 989 | referenced_tree.branch) | 1000 | target_branch=referenced_tree.branch) |
4092 | 990 | except errors.IncompatibleFormat: | 1001 | except errors.IncompatibleFormat: |
4093 | 991 | # this is ok too, not all formats have to support references. | 1002 | # this is ok too, not all formats have to support references. |
4094 | 992 | return | 1003 | return |
4095 | @@ -1012,7 +1023,7 @@ | |||
4096 | 1012 | dir = self.make_bzrdir('source') | 1023 | dir = self.make_bzrdir('source') |
4097 | 1013 | try: | 1024 | try: |
4098 | 1014 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, | 1025 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, |
4100 | 1015 | referenced_tree.branch) | 1026 | target_branch=referenced_tree.branch) |
4101 | 1016 | except errors.IncompatibleFormat: | 1027 | except errors.IncompatibleFormat: |
4102 | 1017 | # this is ok too, not all formats have to support references. | 1028 | # this is ok too, not all formats have to support references. |
4103 | 1018 | return | 1029 | return |
4104 | @@ -1077,7 +1088,7 @@ | |||
4105 | 1077 | dir = self.make_bzrdir('source') | 1088 | dir = self.make_bzrdir('source') |
4106 | 1078 | try: | 1089 | try: |
4107 | 1079 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, | 1090 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, |
4109 | 1080 | referenced_branch) | 1091 | target_branch=referenced_branch) |
4110 | 1081 | except errors.IncompatibleFormat: | 1092 | except errors.IncompatibleFormat: |
4111 | 1082 | # this is ok too, not all formats have to support references. | 1093 | # this is ok too, not all formats have to support references. |
4112 | 1083 | return | 1094 | return |
4113 | @@ -1103,7 +1114,7 @@ | |||
4114 | 1103 | dir = self.make_bzrdir('source') | 1114 | dir = self.make_bzrdir('source') |
4115 | 1104 | try: | 1115 | try: |
4116 | 1105 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, | 1116 | reference = bzrlib.branch.BranchReferenceFormat().initialize(dir, |
4118 | 1106 | referenced_branch) | 1117 | target_branch=referenced_branch) |
4119 | 1107 | except errors.IncompatibleFormat: | 1118 | except errors.IncompatibleFormat: |
4120 | 1108 | # this is ok too, not all formats have to support references. | 1119 | # this is ok too, not all formats have to support references. |
4121 | 1109 | return | 1120 | return |
4122 | @@ -1410,6 +1421,23 @@ | |||
4123 | 1410 | self.failUnless(isinstance(made_branch, bzrlib.branch.Branch)) | 1421 | self.failUnless(isinstance(made_branch, bzrlib.branch.Branch)) |
4124 | 1411 | self.assertEqual(made_control, made_branch.bzrdir) | 1422 | self.assertEqual(made_control, made_branch.bzrdir) |
4125 | 1412 | 1423 | ||
4126 | 1424 | def test_create_colo_branch(self): | ||
4127 | 1425 | # a bzrdir can construct a branch and repository for itself. | ||
4128 | 1426 | if not self.bzrdir_format.is_supported(): | ||
4129 | 1427 | # unsupported formats are not loopback testable | ||
4130 | 1428 | # because the default open will not open them and | ||
4131 | 1429 | # they may not be initializable. | ||
4132 | 1430 | raise TestNotApplicable('Control dir format not supported') | ||
4133 | 1431 | t = get_transport(self.get_url()) | ||
4134 | 1432 | made_control = self.bzrdir_format.initialize(t.base) | ||
4135 | 1433 | made_repo = made_control.create_repository() | ||
4136 | 1434 | try: | ||
4137 | 1435 | made_branch = made_control.create_branch("colo") | ||
4138 | 1436 | except errors.NoColocatedBranchSupport: | ||
4139 | 1437 | raise TestNotApplicable('Colocated branches not supported') | ||
4140 | 1438 | self.failUnless(isinstance(made_branch, bzrlib.branch.Branch)) | ||
4141 | 1439 | self.assertEqual(made_control, made_branch.bzrdir) | ||
4142 | 1440 | |||
4143 | 1413 | def test_open_branch(self): | 1441 | def test_open_branch(self): |
4144 | 1414 | if not self.bzrdir_format.is_supported(): | 1442 | if not self.bzrdir_format.is_supported(): |
4145 | 1415 | # unsupported formats are not loopback testable | 1443 | # unsupported formats are not loopback testable |
4146 | @@ -1858,7 +1886,7 @@ | |||
4147 | 1858 | thisdir = self.make_bzrdir('this') | 1886 | thisdir = self.make_bzrdir('this') |
4148 | 1859 | try: | 1887 | try: |
4149 | 1860 | bzrlib.branch.BranchReferenceFormat().initialize( | 1888 | bzrlib.branch.BranchReferenceFormat().initialize( |
4151 | 1861 | thisdir, master) | 1889 | thisdir, target_branch=master) |
4152 | 1862 | except errors.IncompatibleFormat: | 1890 | except errors.IncompatibleFormat: |
4153 | 1863 | return | 1891 | return |
4154 | 1864 | unused_repo = thisdir.create_repository() | 1892 | unused_repo = thisdir.create_repository() |
4155 | 1865 | 1893 | ||
4156 | === modified file 'bzrlib/tests/per_foreign_vcs/__init__.py' | |||
4157 | --- bzrlib/tests/per_foreign_vcs/__init__.py 2009-11-12 22:57:55 +0000 | |||
4158 | +++ bzrlib/tests/per_foreign_vcs/__init__.py 2010-04-06 07:24:41 +0000 | |||
4159 | @@ -1,4 +1,4 @@ | |||
4161 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
4162 | 2 | # | 2 | # |
4163 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4164 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4165 | 5 | 5 | ||
4166 | === modified file 'bzrlib/tests/per_foreign_vcs/test_repository.py' | |||
4167 | --- bzrlib/tests/per_foreign_vcs/test_repository.py 2009-11-27 03:25:07 +0000 | |||
4168 | +++ bzrlib/tests/per_foreign_vcs/test_repository.py 2010-04-06 07:24:41 +0000 | |||
4169 | @@ -1,4 +1,4 @@ | |||
4171 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
4172 | 2 | # | 2 | # |
4173 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4174 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4175 | 5 | 5 | ||
4176 | === modified file 'bzrlib/tests/per_interbranch/test_push.py' | |||
4177 | --- bzrlib/tests/per_interbranch/test_push.py 2010-02-09 21:31:52 +0000 | |||
4178 | +++ bzrlib/tests/per_interbranch/test_push.py 2010-04-06 07:24:41 +0000 | |||
4179 | @@ -1,4 +1,4 @@ | |||
4181 | 1 | # Copyright (C) 2004, 2005, 2007, 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
4182 | 2 | # | 2 | # |
4183 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4184 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4185 | 5 | 5 | ||
4186 | === modified file 'bzrlib/tests/per_intertree/__init__.py' | |||
4187 | --- bzrlib/tests/per_intertree/__init__.py 2009-11-12 23:10:43 +0000 | |||
4188 | +++ bzrlib/tests/per_intertree/__init__.py 2010-04-06 07:24:41 +0000 | |||
4189 | @@ -1,4 +1,4 @@ | |||
4191 | 1 | # Copyright (C) 2006, 2009 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
4192 | 2 | # | 2 | # |
4193 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4194 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4195 | 5 | 5 | ||
4196 | === modified file 'bzrlib/tests/per_pack_repository.py' | |||
4197 | --- bzrlib/tests/per_pack_repository.py 2010-02-11 09:21:45 +0000 | |||
4198 | +++ bzrlib/tests/per_pack_repository.py 2010-04-06 07:24:41 +0000 | |||
4199 | @@ -1,4 +1,4 @@ | |||
4201 | 1 | # Copyright (C) 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
4202 | 2 | # | 2 | # |
4203 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4204 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4205 | 5 | 5 | ||
4206 | === modified file 'bzrlib/tests/per_repository/test_check.py' | |||
4207 | --- bzrlib/tests/per_repository/test_check.py 2009-12-16 22:29:31 +0000 | |||
4208 | +++ bzrlib/tests/per_repository/test_check.py 2010-04-06 07:24:41 +0000 | |||
4209 | @@ -1,4 +1,4 @@ | |||
4211 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
4212 | 2 | # | 2 | # |
4213 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4214 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4215 | 5 | 5 | ||
4216 | === modified file 'bzrlib/tests/per_repository/test_check_reconcile.py' | |||
4217 | --- bzrlib/tests/per_repository/test_check_reconcile.py 2009-12-16 22:29:31 +0000 | |||
4218 | +++ bzrlib/tests/per_repository/test_check_reconcile.py 2010-04-06 07:24:41 +0000 | |||
4219 | @@ -1,4 +1,4 @@ | |||
4221 | 1 | # Copyright (C) 2007 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
4222 | 2 | # | 2 | # |
4223 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4224 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4225 | 5 | 5 | ||
4226 | === modified file 'bzrlib/tests/per_repository_reference/test_check.py' | |||
4227 | --- bzrlib/tests/per_repository_reference/test_check.py 2009-12-16 22:29:31 +0000 | |||
4228 | +++ bzrlib/tests/per_repository_reference/test_check.py 2010-04-06 07:24:41 +0000 | |||
4229 | @@ -1,4 +1,4 @@ | |||
4231 | 1 | # Copyright (C) 2008 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
4232 | 2 | # | 2 | # |
4233 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4234 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4235 | 5 | 5 | ||
4236 | === modified file 'bzrlib/tests/per_transport.py' | |||
4237 | --- bzrlib/tests/per_transport.py 2010-02-09 20:44:50 +0000 | |||
4238 | +++ bzrlib/tests/per_transport.py 2010-04-06 07:24:41 +0000 | |||
4239 | @@ -1,4 +1,4 @@ | |||
4241 | 1 | # Copyright (C) 2004, 2005, 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
4242 | 2 | # | 2 | # |
4243 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4244 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4245 | @@ -1083,6 +1083,52 @@ | |||
4246 | 1083 | subdir.stat('./file') | 1083 | subdir.stat('./file') |
4247 | 1084 | subdir.stat('.') | 1084 | subdir.stat('.') |
4248 | 1085 | 1085 | ||
4249 | 1086 | def test_hardlink(self): | ||
4250 | 1087 | from stat import ST_NLINK | ||
4251 | 1088 | |||
4252 | 1089 | t = self.get_transport() | ||
4253 | 1090 | |||
4254 | 1091 | source_name = "original_target" | ||
4255 | 1092 | link_name = "target_link" | ||
4256 | 1093 | |||
4257 | 1094 | self.build_tree([source_name], transport=t) | ||
4258 | 1095 | |||
4259 | 1096 | try: | ||
4260 | 1097 | t.hardlink(source_name, link_name) | ||
4261 | 1098 | |||
4262 | 1099 | self.failUnless(t.has(source_name)) | ||
4263 | 1100 | self.failUnless(t.has(link_name)) | ||
4264 | 1101 | |||
4265 | 1102 | st = t.stat(link_name) | ||
4266 | 1103 | self.failUnlessEqual(st[ST_NLINK], 2) | ||
4267 | 1104 | except TransportNotPossible: | ||
4268 | 1105 | raise TestSkipped("Transport %s does not support hardlinks." % | ||
4269 | 1106 | self._server.__class__) | ||
4270 | 1107 | |||
4271 | 1108 | def test_symlink(self): | ||
4272 | 1109 | from stat import S_ISLNK | ||
4273 | 1110 | |||
4274 | 1111 | t = self.get_transport() | ||
4275 | 1112 | |||
4276 | 1113 | source_name = "original_target" | ||
4277 | 1114 | link_name = "target_link" | ||
4278 | 1115 | |||
4279 | 1116 | self.build_tree([source_name], transport=t) | ||
4280 | 1117 | |||
4281 | 1118 | try: | ||
4282 | 1119 | t.symlink(source_name, link_name) | ||
4283 | 1120 | |||
4284 | 1121 | self.failUnless(t.has(source_name)) | ||
4285 | 1122 | self.failUnless(t.has(link_name)) | ||
4286 | 1123 | |||
4287 | 1124 | st = t.stat(link_name) | ||
4288 | 1125 | self.failUnless(S_ISLNK(st.st_mode)) | ||
4289 | 1126 | except TransportNotPossible: | ||
4290 | 1127 | raise TestSkipped("Transport %s does not support symlinks." % | ||
4291 | 1128 | self._server.__class__) | ||
4292 | 1129 | except IOError: | ||
4293 | 1130 | raise tests.KnownFailure("Paramiko fails to create symlinks during tests") | ||
4294 | 1131 | |||
4295 | 1086 | def test_list_dir(self): | 1132 | def test_list_dir(self): |
4296 | 1087 | # TODO: Test list_dir, just try once, and if it throws, stop testing | 1133 | # TODO: Test list_dir, just try once, and if it throws, stop testing |
4297 | 1088 | t = self.get_transport() | 1134 | t = self.get_transport() |
4298 | 1089 | 1135 | ||
4299 | === modified file 'bzrlib/tests/per_tree/test_get_file_with_stat.py' | |||
4300 | --- bzrlib/tests/per_tree/test_get_file_with_stat.py 2009-11-18 15:47:16 +0000 | |||
4301 | +++ bzrlib/tests/per_tree/test_get_file_with_stat.py 2010-04-06 07:24:41 +0000 | |||
4302 | @@ -1,4 +1,4 @@ | |||
4304 | 1 | # Copyright (C) 2008 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
4305 | 2 | # | 2 | # |
4306 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4307 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4308 | 5 | 5 | ||
4309 | === modified file 'bzrlib/tests/per_tree/test_iter_search_rules.py' | |||
4310 | --- bzrlib/tests/per_tree/test_iter_search_rules.py 2009-12-03 05:21:09 +0000 | |||
4311 | +++ bzrlib/tests/per_tree/test_iter_search_rules.py 2010-04-06 07:24:41 +0000 | |||
4312 | @@ -1,4 +1,4 @@ | |||
4314 | 1 | # Copyright (C) 2008 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
4315 | 2 | # | 2 | # |
4316 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4317 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4318 | 5 | 5 | ||
4319 | === modified file 'bzrlib/tests/per_tree/test_path_content_summary.py' | |||
4320 | --- bzrlib/tests/per_tree/test_path_content_summary.py 2009-11-10 19:38:37 +0000 | |||
4321 | +++ bzrlib/tests/per_tree/test_path_content_summary.py 2010-04-06 07:24:41 +0000 | |||
4322 | @@ -1,4 +1,4 @@ | |||
4324 | 1 | # Copyright (C) 2007, 2009 Canonical Ltd | 1 | # Copyright (C) 2007, 2009, 2010 Canonical Ltd |
4325 | 2 | # | 2 | # |
4326 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4327 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4328 | 5 | 5 | ||
4329 | === modified file 'bzrlib/tests/per_tree/test_revision_tree.py' | |||
4330 | --- bzrlib/tests/per_tree/test_revision_tree.py 2009-07-10 07:14:02 +0000 | |||
4331 | +++ bzrlib/tests/per_tree/test_revision_tree.py 2010-04-06 07:24:41 +0000 | |||
4332 | @@ -1,4 +1,4 @@ | |||
4334 | 1 | # Copyright (C) 2006 Canonical Ltd | 1 | # Copyright (C) 2006, 2007, 2009, 2010 Canonical Ltd |
4335 | 2 | # | 2 | # |
4336 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4337 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4338 | @@ -16,11 +16,14 @@ | |||
4339 | 16 | 16 | ||
4340 | 17 | """Tests for Tree.revision_tree.""" | 17 | """Tests for Tree.revision_tree.""" |
4341 | 18 | 18 | ||
4347 | 19 | from bzrlib import errors | 19 | from bzrlib import ( |
4348 | 20 | from bzrlib.tests.per_tree import TestCaseWithTree | 20 | errors, |
4349 | 21 | 21 | tests, | |
4350 | 22 | 22 | ) | |
4351 | 23 | class TestRevisionTree(TestCaseWithTree): | 23 | from bzrlib.tests import per_tree |
4352 | 24 | |||
4353 | 25 | |||
4354 | 26 | class TestRevisionTree(per_tree.TestCaseWithTree): | ||
4355 | 24 | 27 | ||
4356 | 25 | def create_tree_no_parents_no_content(self): | 28 | def create_tree_no_parents_no_content(self): |
4357 | 26 | tree = self.make_branch_and_tree('.') | 29 | tree = self.make_branch_and_tree('.') |
4358 | 27 | 30 | ||
4359 | === modified file 'bzrlib/tests/per_workingtree/test_content_filters.py' | |||
4360 | --- bzrlib/tests/per_workingtree/test_content_filters.py 2010-01-25 17:48:22 +0000 | |||
4361 | +++ bzrlib/tests/per_workingtree/test_content_filters.py 2010-04-06 07:24:41 +0000 | |||
4362 | @@ -1,4 +1,4 @@ | |||
4364 | 1 | # Copyright (C) 2008 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
4365 | 2 | # | 2 | # |
4366 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4367 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4368 | 5 | 5 | ||
4369 | === modified file 'bzrlib/tests/per_workingtree/test_is_ignored.py' | |||
4370 | --- bzrlib/tests/per_workingtree/test_is_ignored.py 2010-01-01 21:26:25 +0000 | |||
4371 | +++ bzrlib/tests/per_workingtree/test_is_ignored.py 2010-04-06 07:24:41 +0000 | |||
4372 | @@ -1,4 +1,4 @@ | |||
4374 | 1 | # Copyright (C) 2006 Canonical Ltd | 1 | # Copyright (C) 2006, 2007, 2009, 2010 Canonical Ltd |
4375 | 2 | # Authors: Robert Collins <robert.collins@canonical.com> | 2 | # Authors: Robert Collins <robert.collins@canonical.com> |
4376 | 3 | # | 3 | # |
4377 | 4 | # This program is free software; you can redistribute it and/or modify | 4 | # This program is free software; you can redistribute it and/or modify |
4378 | 5 | 5 | ||
4379 | === modified file 'bzrlib/tests/per_workingtree/test_revision_tree.py' | |||
4380 | --- bzrlib/tests/per_workingtree/test_revision_tree.py 2009-07-10 07:14:02 +0000 | |||
4381 | +++ bzrlib/tests/per_workingtree/test_revision_tree.py 2010-04-06 07:24:41 +0000 | |||
4382 | @@ -1,4 +1,4 @@ | |||
4384 | 1 | # Copyright (C) 2006 Canonical Ltd | 1 | # Copyright (C) 2006, 2007, 2009, 2010 Canonical Ltd |
4385 | 2 | # | 2 | # |
4386 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4387 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4388 | @@ -23,11 +23,15 @@ | |||
4389 | 23 | so these tests are testing that when there is a cache, it performs correctly. | 23 | so these tests are testing that when there is a cache, it performs correctly. |
4390 | 24 | """ | 24 | """ |
4391 | 25 | 25 | ||
4397 | 26 | from bzrlib import errors | 26 | from bzrlib import ( |
4398 | 27 | from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree | 27 | branchbuilder, |
4399 | 28 | 28 | errors, | |
4400 | 29 | 29 | tests, | |
4401 | 30 | class TestRevisionTree(TestCaseWithWorkingTree): | 30 | ) |
4402 | 31 | from bzrlib.tests import per_workingtree | ||
4403 | 32 | |||
4404 | 33 | |||
4405 | 34 | class TestRevisionTree(per_workingtree.TestCaseWithWorkingTree): | ||
4406 | 31 | 35 | ||
4407 | 32 | def test_get_zeroth_basis_tree_via_revision_tree(self): | 36 | def test_get_zeroth_basis_tree_via_revision_tree(self): |
4408 | 33 | tree = self.make_branch_and_tree('.') | 37 | tree = self.make_branch_and_tree('.') |
4409 | @@ -83,3 +87,50 @@ | |||
4410 | 83 | return | 87 | return |
4411 | 84 | repository_revision_tree = tree.branch.repository.revision_tree(rev1) | 88 | repository_revision_tree = tree.branch.repository.revision_tree(rev1) |
4412 | 85 | self.assertTreesEqual(repository_revision_tree, cached_revision_tree) | 89 | self.assertTreesEqual(repository_revision_tree, cached_revision_tree) |
4413 | 90 | |||
4414 | 91 | |||
4415 | 92 | class TestRevisionTreeKind(per_workingtree.TestCaseWithWorkingTree): | ||
4416 | 93 | |||
4417 | 94 | def make_branch_with_merged_deletions(self, relpath='tree'): | ||
4418 | 95 | tree = self.make_branch_and_tree(relpath) | ||
4419 | 96 | files = ['a', 'b/', 'b/c'] | ||
4420 | 97 | self.build_tree(files, line_endings='binary', | ||
4421 | 98 | transport=tree.bzrdir.root_transport) | ||
4422 | 99 | tree.set_root_id('root-id') | ||
4423 | 100 | tree.add(files, ['a-id', 'b-id', 'c-id']) | ||
4424 | 101 | tree.commit('a, b and b/c', rev_id='base') | ||
4425 | 102 | tree2 = tree.bzrdir.sprout(relpath + '2').open_workingtree() | ||
4426 | 103 | # Delete 'a' in tree | ||
4427 | 104 | tree.remove('a', keep_files=False) | ||
4428 | 105 | tree.commit('remove a', rev_id='this') | ||
4429 | 106 | # Delete 'c' in tree2 | ||
4430 | 107 | tree2.remove('b/c', keep_files=False) | ||
4431 | 108 | tree2.remove('b', keep_files=False) | ||
4432 | 109 | tree2.commit('remove b/c', rev_id='other') | ||
4433 | 110 | # Merge tree2 into tree | ||
4434 | 111 | tree.merge_from_branch(tree2.branch) | ||
4435 | 112 | return tree | ||
4436 | 113 | |||
4437 | 114 | def test_kind_parent_tree(self): | ||
4438 | 115 | tree = self.make_branch_with_merged_deletions() | ||
4439 | 116 | tree.lock_read() | ||
4440 | 117 | self.addCleanup(tree.unlock) | ||
4441 | 118 | parents = tree.get_parent_ids() | ||
4442 | 119 | self.assertEqual(['this', 'other'], parents) | ||
4443 | 120 | basis = tree.revision_tree(parents[0]) | ||
4444 | 121 | basis.lock_read() | ||
4445 | 122 | self.addCleanup(basis.unlock) | ||
4446 | 123 | self.assertRaises(errors.NoSuchId, basis.kind, 'a-id') | ||
4447 | 124 | self.assertEqual(['directory', 'file'], | ||
4448 | 125 | [basis.kind('b-id'), basis.kind('c-id')]) | ||
4449 | 126 | try: | ||
4450 | 127 | other = tree.revision_tree(parents[1]) | ||
4451 | 128 | except errors.NoSuchRevisionInTree: | ||
4452 | 129 | raise tests.TestNotApplicable( | ||
4453 | 130 | 'Tree type %s caches only the basis revision tree.' | ||
4454 | 131 | % type(tree)) | ||
4455 | 132 | other.lock_read() | ||
4456 | 133 | self.addCleanup(other.unlock) | ||
4457 | 134 | self.assertRaises(errors.NoSuchId, other.kind, 'b-id') | ||
4458 | 135 | self.assertRaises(errors.NoSuchId, other.kind, 'c-id') | ||
4459 | 136 | self.assertEqual('file', other.kind('a-id')) | ||
4460 | 86 | 137 | ||
4461 | === modified file 'bzrlib/tests/per_workingtree/test_workingtree.py' | |||
4462 | --- bzrlib/tests/per_workingtree/test_workingtree.py 2010-02-13 01:50:29 +0000 | |||
4463 | +++ bzrlib/tests/per_workingtree/test_workingtree.py 2010-04-06 07:24:41 +0000 | |||
4464 | @@ -423,7 +423,8 @@ | |||
4465 | 423 | made_control = self.bzrdir_format.initialize('new') | 423 | made_control = self.bzrdir_format.initialize('new') |
4466 | 424 | source.branch.repository.clone(made_control) | 424 | source.branch.repository.clone(made_control) |
4467 | 425 | source.branch.clone(made_control) | 425 | source.branch.clone(made_control) |
4469 | 426 | made_tree = self.workingtree_format.initialize(made_control, revision_id='a') | 426 | made_tree = self.workingtree_format.initialize(made_control, |
4470 | 427 | revision_id='a') | ||
4471 | 427 | self.assertEqual(['a'], made_tree.get_parent_ids()) | 428 | self.assertEqual(['a'], made_tree.get_parent_ids()) |
4472 | 428 | 429 | ||
4473 | 429 | def test_update_sets_last_revision(self): | 430 | def test_update_sets_last_revision(self): |
4474 | @@ -447,7 +448,8 @@ | |||
4475 | 447 | # current format | 448 | # current format |
4476 | 448 | self.build_tree(['checkout/', 'tree/file']) | 449 | self.build_tree(['checkout/', 'tree/file']) |
4477 | 449 | checkout = bzrdir.BzrDirMetaFormat1().initialize('checkout') | 450 | checkout = bzrdir.BzrDirMetaFormat1().initialize('checkout') |
4479 | 450 | branch.BranchReferenceFormat().initialize(checkout, main_branch) | 451 | branch.BranchReferenceFormat().initialize(checkout, |
4480 | 452 | target_branch=main_branch) | ||
4481 | 451 | old_tree = self.workingtree_format.initialize(checkout) | 453 | old_tree = self.workingtree_format.initialize(checkout) |
4482 | 452 | # now commit to 'tree' | 454 | # now commit to 'tree' |
4483 | 453 | wt.add('file') | 455 | wt.add('file') |
4484 | @@ -514,7 +516,8 @@ | |||
4485 | 514 | # current format | 516 | # current format |
4486 | 515 | self.build_tree(['checkout/', 'tree/file']) | 517 | self.build_tree(['checkout/', 'tree/file']) |
4487 | 516 | checkout = bzrdir.BzrDirMetaFormat1().initialize('checkout') | 518 | checkout = bzrdir.BzrDirMetaFormat1().initialize('checkout') |
4489 | 517 | branch.BranchReferenceFormat().initialize(checkout, main_branch) | 519 | branch.BranchReferenceFormat().initialize(checkout, |
4490 | 520 | target_branch=main_branch) | ||
4491 | 518 | old_tree = self.workingtree_format.initialize(checkout) | 521 | old_tree = self.workingtree_format.initialize(checkout) |
4492 | 519 | # now commit to 'tree' | 522 | # now commit to 'tree' |
4493 | 520 | wt.add('file') | 523 | wt.add('file') |
4494 | 521 | 524 | ||
4495 | === modified file 'bzrlib/tests/script.py' | |||
4496 | --- bzrlib/tests/script.py 2010-01-16 10:06:21 +0000 | |||
4497 | +++ bzrlib/tests/script.py 2010-04-06 07:24:41 +0000 | |||
4498 | @@ -1,4 +1,4 @@ | |||
4500 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
4501 | 2 | # | 2 | # |
4502 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4503 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4504 | 5 | 5 | ||
4505 | === modified file 'bzrlib/tests/stub_sftp.py' | |||
4506 | --- bzrlib/tests/stub_sftp.py 2010-02-11 09:27:55 +0000 | |||
4507 | +++ bzrlib/tests/stub_sftp.py 2010-04-06 07:24:41 +0000 | |||
4508 | @@ -297,14 +297,14 @@ | |||
4509 | 297 | threading.Thread(target=self._callback, args=(s,)).start() | 297 | threading.Thread(target=self._callback, args=(s,)).start() |
4510 | 298 | except socket.error, x: | 298 | except socket.error, x: |
4511 | 299 | sys.excepthook(*sys.exc_info()) | 299 | sys.excepthook(*sys.exc_info()) |
4514 | 300 | warning('Socket error during accept() within unit test server' | 300 | trace.warning('Socket error during accept() ' |
4515 | 301 | ' thread: %r' % x) | 301 | 'within unit test server thread: %r' % x) |
4516 | 302 | except Exception, x: | 302 | except Exception, x: |
4517 | 303 | # probably a failed test; unit test thread will log the | 303 | # probably a failed test; unit test thread will log the |
4518 | 304 | # failure/error | 304 | # failure/error |
4519 | 305 | sys.excepthook(*sys.exc_info()) | 305 | sys.excepthook(*sys.exc_info()) |
4522 | 306 | warning('Exception from within unit test server thread: %r' % | 306 | trace.warning( |
4523 | 307 | x) | 307 | 'Exception from within unit test server thread: %r' % x) |
4524 | 308 | 308 | ||
4525 | 309 | 309 | ||
4526 | 310 | class SocketDelay(object): | 310 | class SocketDelay(object): |
4527 | @@ -438,13 +438,15 @@ | |||
4528 | 438 | if not (backing_server is None or | 438 | if not (backing_server is None or |
4529 | 439 | isinstance(backing_server, test_server.LocalURLServer)): | 439 | isinstance(backing_server, test_server.LocalURLServer)): |
4530 | 440 | raise AssertionError( | 440 | raise AssertionError( |
4533 | 441 | "backing_server should not be %r, because this can only serve the " | 441 | 'backing_server should not be %r, because this can only serve ' |
4534 | 442 | "local current working directory." % (backing_server,)) | 442 | 'the local current working directory.' % (backing_server,)) |
4535 | 443 | self._original_vendor = ssh._ssh_vendor_manager._cached_ssh_vendor | 443 | self._original_vendor = ssh._ssh_vendor_manager._cached_ssh_vendor |
4536 | 444 | ssh._ssh_vendor_manager._cached_ssh_vendor = self._vendor | 444 | ssh._ssh_vendor_manager._cached_ssh_vendor = self._vendor |
4537 | 445 | # FIXME: the following block should certainly just be self._homedir = | ||
4538 | 446 | # osutils.getcwd() but that fails badly on Unix -- vila 20100224 | ||
4539 | 445 | if sys.platform == 'win32': | 447 | if sys.platform == 'win32': |
4540 | 446 | # Win32 needs to use the UNICODE api | 448 | # Win32 needs to use the UNICODE api |
4542 | 447 | self._homedir = getcwd() | 449 | self._homedir = os.getcwdu() |
4543 | 448 | else: | 450 | else: |
4544 | 449 | # But Linux SFTP servers should just deal in bytestreams | 451 | # But Linux SFTP servers should just deal in bytestreams |
4545 | 450 | self._homedir = os.getcwd() | 452 | self._homedir = os.getcwd() |
4546 | 451 | 453 | ||
4547 | === modified file 'bzrlib/tests/test__annotator.py' | |||
4548 | --- bzrlib/tests/test__annotator.py 2009-12-22 16:47:36 +0000 | |||
4549 | +++ bzrlib/tests/test__annotator.py 2010-04-06 07:24:41 +0000 | |||
4550 | @@ -1,4 +1,4 @@ | |||
4552 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
4553 | 2 | # | 2 | # |
4554 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4555 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4556 | 5 | 5 | ||
4557 | === modified file 'bzrlib/tests/test__bencode.py' | |||
4558 | --- bzrlib/tests/test__bencode.py 2009-12-23 04:19:34 +0000 | |||
4559 | +++ bzrlib/tests/test__bencode.py 2010-04-06 07:24:41 +0000 | |||
4560 | @@ -1,4 +1,4 @@ | |||
4562 | 1 | # Copyright (C) 2007, 2009 Canonical Ltd | 1 | # Copyright (C) 2007, 2009, 2010 Canonical Ltd |
4563 | 2 | # | 2 | # |
4564 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4565 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4566 | 5 | 5 | ||
4567 | === modified file 'bzrlib/tests/test__chk_map.py' | |||
4568 | --- bzrlib/tests/test__chk_map.py 2009-12-22 16:28:47 +0000 | |||
4569 | +++ bzrlib/tests/test__chk_map.py 2010-04-06 07:24:41 +0000 | |||
4570 | @@ -1,4 +1,4 @@ | |||
4572 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
4573 | 2 | # | 2 | # |
4574 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4575 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4576 | 5 | 5 | ||
4577 | === modified file 'bzrlib/tests/test__chunks_to_lines.py' | |||
4578 | --- bzrlib/tests/test__chunks_to_lines.py 2009-12-22 17:14:45 +0000 | |||
4579 | +++ bzrlib/tests/test__chunks_to_lines.py 2010-04-06 07:24:41 +0000 | |||
4580 | @@ -1,4 +1,4 @@ | |||
4582 | 1 | # Copyright (C) 2008 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
4583 | 2 | # | 2 | # |
4584 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4585 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4586 | 5 | 5 | ||
4587 | === modified file 'bzrlib/tests/test__dirstate_helpers.py' | |||
4588 | --- bzrlib/tests/test__dirstate_helpers.py 2010-01-25 17:48:22 +0000 | |||
4589 | +++ bzrlib/tests/test__dirstate_helpers.py 2010-04-06 07:24:41 +0000 | |||
4590 | @@ -1,4 +1,4 @@ | |||
4592 | 1 | # Copyright (C) 2007, 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2007-2010 Canonical Ltd |
4593 | 2 | # | 2 | # |
4594 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4595 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4596 | 5 | 5 | ||
4597 | === modified file 'bzrlib/tests/test__groupcompress.py' | |||
4598 | --- bzrlib/tests/test__groupcompress.py 2009-12-22 15:50:40 +0000 | |||
4599 | +++ bzrlib/tests/test__groupcompress.py 2010-04-06 07:24:41 +0000 | |||
4600 | @@ -1,4 +1,4 @@ | |||
4602 | 1 | # Copyright (C) 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
4603 | 2 | # | 2 | # |
4604 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4605 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4606 | 5 | 5 | ||
4607 | === modified file 'bzrlib/tests/test__known_graph.py' | |||
4608 | --- bzrlib/tests/test__known_graph.py 2009-12-22 15:50:40 +0000 | |||
4609 | +++ bzrlib/tests/test__known_graph.py 2010-04-06 07:24:41 +0000 | |||
4610 | @@ -1,4 +1,4 @@ | |||
4612 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
4613 | 2 | # | 2 | # |
4614 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4615 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4616 | 5 | 5 | ||
4617 | === modified file 'bzrlib/tests/test__rio.py' | |||
4618 | --- bzrlib/tests/test__rio.py 2009-12-22 16:28:47 +0000 | |||
4619 | +++ bzrlib/tests/test__rio.py 2010-04-06 07:24:41 +0000 | |||
4620 | @@ -1,4 +1,4 @@ | |||
4622 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
4623 | 2 | # | 2 | # |
4624 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4625 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4626 | 5 | 5 | ||
4627 | === modified file 'bzrlib/tests/test__simple_set.py' | |||
4628 | --- bzrlib/tests/test__simple_set.py 2009-12-22 15:50:40 +0000 | |||
4629 | +++ bzrlib/tests/test__simple_set.py 2010-04-06 07:24:41 +0000 | |||
4630 | @@ -1,4 +1,4 @@ | |||
4632 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
4633 | 2 | # | 2 | # |
4634 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4635 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4636 | 5 | 5 | ||
4637 | === modified file 'bzrlib/tests/test__static_tuple.py' | |||
4638 | --- bzrlib/tests/test__static_tuple.py 2010-02-18 01:10:16 +0000 | |||
4639 | +++ bzrlib/tests/test__static_tuple.py 2010-04-06 07:24:41 +0000 | |||
4640 | @@ -1,4 +1,4 @@ | |||
4642 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
4643 | 2 | # | 2 | # |
4644 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4645 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4646 | 5 | 5 | ||
4647 | === modified file 'bzrlib/tests/test__walkdirs_win32.py' | |||
4648 | --- bzrlib/tests/test__walkdirs_win32.py 2009-12-21 18:03:49 +0000 | |||
4649 | +++ bzrlib/tests/test__walkdirs_win32.py 2010-04-06 07:24:41 +0000 | |||
4650 | @@ -1,4 +1,4 @@ | |||
4652 | 1 | # Copyright (C) 2008 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
4653 | 2 | # | 2 | # |
4654 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4655 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4656 | 5 | 5 | ||
4657 | === modified file 'bzrlib/tests/test_branch.py' | |||
4658 | --- bzrlib/tests/test_branch.py 2010-02-10 17:52:08 +0000 | |||
4659 | +++ bzrlib/tests/test_branch.py 2010-04-06 07:24:41 +0000 | |||
4660 | @@ -123,16 +123,16 @@ | |||
4661 | 123 | """See BzrBranchFormat.get_format_string().""" | 123 | """See BzrBranchFormat.get_format_string().""" |
4662 | 124 | return "Sample branch format." | 124 | return "Sample branch format." |
4663 | 125 | 125 | ||
4665 | 126 | def initialize(self, a_bzrdir): | 126 | def initialize(self, a_bzrdir, name=None): |
4666 | 127 | """Format 4 branches cannot be created.""" | 127 | """Format 4 branches cannot be created.""" |
4668 | 128 | t = a_bzrdir.get_branch_transport(self) | 128 | t = a_bzrdir.get_branch_transport(self, name=name) |
4669 | 129 | t.put_bytes('format', self.get_format_string()) | 129 | t.put_bytes('format', self.get_format_string()) |
4670 | 130 | return 'A branch' | 130 | return 'A branch' |
4671 | 131 | 131 | ||
4672 | 132 | def is_supported(self): | 132 | def is_supported(self): |
4673 | 133 | return False | 133 | return False |
4674 | 134 | 134 | ||
4676 | 135 | def open(self, transport, _found=False, ignore_fallbacks=False): | 135 | def open(self, transport, name=None, _found=False, ignore_fallbacks=False): |
4677 | 136 | return "opened branch." | 136 | return "opened branch." |
4678 | 137 | 137 | ||
4679 | 138 | 138 | ||
4680 | @@ -438,7 +438,7 @@ | |||
4681 | 438 | t.mkdir('branch') | 438 | t.mkdir('branch') |
4682 | 439 | branch_dir = bzrdirformat.initialize(self.get_url('branch')) | 439 | branch_dir = bzrdirformat.initialize(self.get_url('branch')) |
4683 | 440 | made_branch = _mod_branch.BranchReferenceFormat().initialize( | 440 | made_branch = _mod_branch.BranchReferenceFormat().initialize( |
4685 | 441 | branch_dir, target_branch) | 441 | branch_dir, target_branch=target_branch) |
4686 | 442 | self.assertEqual(made_branch.base, target_branch.base) | 442 | self.assertEqual(made_branch.base, target_branch.base) |
4687 | 443 | opened_branch = branch_dir.open_branch() | 443 | opened_branch = branch_dir.open_branch() |
4688 | 444 | self.assertEqual(opened_branch.base, target_branch.base) | 444 | self.assertEqual(opened_branch.base, target_branch.base) |
4689 | 445 | 445 | ||
4690 | === modified file 'bzrlib/tests/test_branchbuilder.py' | |||
4691 | --- bzrlib/tests/test_branchbuilder.py 2009-05-07 05:08:46 +0000 | |||
4692 | +++ bzrlib/tests/test_branchbuilder.py 2010-04-06 07:24:41 +0000 | |||
4693 | @@ -171,6 +171,15 @@ | |||
4694 | 171 | rev = branch.repository.get_revision(rev_id) | 171 | rev = branch.repository.get_revision(rev_id) |
4695 | 172 | self.assertEqual(u'Foo', rev.message) | 172 | self.assertEqual(u'Foo', rev.message) |
4696 | 173 | 173 | ||
4697 | 174 | def test_commit_message_callback(self): | ||
4698 | 175 | builder = BranchBuilder(self.get_transport().clone('foo')) | ||
4699 | 176 | rev_id = builder.build_snapshot(None, None, | ||
4700 | 177 | [('add', (u'', None, 'directory', None))], | ||
4701 | 178 | message_callback=lambda x:u'Foo') | ||
4702 | 179 | branch = builder.get_branch() | ||
4703 | 180 | rev = branch.repository.get_revision(rev_id) | ||
4704 | 181 | self.assertEqual(u'Foo', rev.message) | ||
4705 | 182 | |||
4706 | 174 | def test_modify_file(self): | 183 | def test_modify_file(self): |
4707 | 175 | builder = self.build_a_rev() | 184 | builder = self.build_a_rev() |
4708 | 176 | rev_id2 = builder.build_snapshot('B-id', None, | 185 | rev_id2 = builder.build_snapshot('B-id', None, |
4709 | 177 | 186 | ||
4710 | === modified file 'bzrlib/tests/test_btree_index.py' | |||
4711 | --- bzrlib/tests/test_btree_index.py 2010-01-25 17:48:22 +0000 | |||
4712 | +++ bzrlib/tests/test_btree_index.py 2010-04-06 07:24:41 +0000 | |||
4713 | @@ -1,4 +1,4 @@ | |||
4715 | 1 | # Copyright (C) 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2008, 2009, 2010 Canonical Ltd |
4716 | 2 | # | 2 | # |
4717 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4718 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4719 | 5 | 5 | ||
4720 | === modified file 'bzrlib/tests/test_bzrdir.py' | |||
4721 | --- bzrlib/tests/test_bzrdir.py 2010-02-11 09:21:45 +0000 | |||
4722 | +++ bzrlib/tests/test_bzrdir.py 2010-04-06 07:24:41 +0000 | |||
4723 | @@ -1,4 +1,4 @@ | |||
4725 | 1 | # Copyright (C) 2005, 2006, 2007 Canonical Ltd | 1 | # Copyright (C) 2006-2010 Canonical Ltd |
4726 | 2 | # | 2 | # |
4727 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4728 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4729 | @@ -36,6 +36,7 @@ | |||
4730 | 36 | ) | 36 | ) |
4731 | 37 | import bzrlib.branch | 37 | import bzrlib.branch |
4732 | 38 | from bzrlib.errors import (NotBranchError, | 38 | from bzrlib.errors import (NotBranchError, |
4733 | 39 | NoColocatedBranchSupport, | ||
4734 | 39 | UnknownFormatError, | 40 | UnknownFormatError, |
4735 | 40 | UnsupportedFormatError, | 41 | UnsupportedFormatError, |
4736 | 41 | ) | 42 | ) |
4737 | @@ -206,8 +207,10 @@ | |||
4738 | 206 | """See BzrDir.open_repository.""" | 207 | """See BzrDir.open_repository.""" |
4739 | 207 | return SampleRepository(self) | 208 | return SampleRepository(self) |
4740 | 208 | 209 | ||
4742 | 209 | def create_branch(self): | 210 | def create_branch(self, name=None): |
4743 | 210 | """See BzrDir.create_branch.""" | 211 | """See BzrDir.create_branch.""" |
4744 | 212 | if name is not None: | ||
4745 | 213 | raise NoColocatedBranchSupport(self) | ||
4746 | 211 | return SampleBranch(self) | 214 | return SampleBranch(self) |
4747 | 212 | 215 | ||
4748 | 213 | def create_workingtree(self): | 216 | def create_workingtree(self): |
4749 | @@ -468,7 +471,8 @@ | |||
4750 | 468 | # Make stackable source branch with an unstackable repo format. | 471 | # Make stackable source branch with an unstackable repo format. |
4751 | 469 | source_bzrdir = self.make_bzrdir('source') | 472 | source_bzrdir = self.make_bzrdir('source') |
4752 | 470 | pack_repo.RepositoryFormatKnitPack1().initialize(source_bzrdir) | 473 | pack_repo.RepositoryFormatKnitPack1().initialize(source_bzrdir) |
4754 | 471 | source_branch = bzrlib.branch.BzrBranchFormat7().initialize(source_bzrdir) | 474 | source_branch = bzrlib.branch.BzrBranchFormat7().initialize( |
4755 | 475 | source_bzrdir) | ||
4756 | 472 | # Make a directory with a default stacking policy | 476 | # Make a directory with a default stacking policy |
4757 | 473 | parent_bzrdir = self.make_bzrdir('parent') | 477 | parent_bzrdir = self.make_bzrdir('parent') |
4758 | 474 | stacked_on = self.make_branch('parent/stacked-on', format='pack-0.92') | 478 | stacked_on = self.make_branch('parent/stacked-on', format='pack-0.92') |
4759 | 475 | 479 | ||
4760 | === modified file 'bzrlib/tests/test_cleanup.py' | |||
4761 | --- bzrlib/tests/test_cleanup.py 2009-12-16 22:29:31 +0000 | |||
4762 | +++ bzrlib/tests/test_cleanup.py 2010-04-06 07:24:41 +0000 | |||
4763 | @@ -1,4 +1,4 @@ | |||
4765 | 1 | # Copyright (C) 2009 Canonical Ltd | 1 | # Copyright (C) 2009, 2010 Canonical Ltd |
4766 | 2 | # | 2 | # |
4767 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4768 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4769 | 5 | 5 | ||
4770 | === modified file 'bzrlib/tests/test_cmdline.py' | |||
4771 | --- bzrlib/tests/test_cmdline.py 2010-02-18 02:15:48 +0000 | |||
4772 | +++ bzrlib/tests/test_cmdline.py 2010-04-06 07:24:41 +0000 | |||
4773 | @@ -85,7 +85,7 @@ | |||
4774 | 85 | def test_double_escape(self): | 85 | def test_double_escape(self): |
4775 | 86 | self.assertAsTokens([(True, u'foo\\\\bar')], u'"foo\\\\bar"') | 86 | self.assertAsTokens([(True, u'foo\\\\bar')], u'"foo\\\\bar"') |
4776 | 87 | self.assertAsTokens([(False, u'foo\\\\bar')], u"foo\\\\bar") | 87 | self.assertAsTokens([(False, u'foo\\\\bar')], u"foo\\\\bar") |
4778 | 88 | 88 | ||
4779 | 89 | def test_multiple_quoted_args(self): | 89 | def test_multiple_quoted_args(self): |
4780 | 90 | self.assertAsTokens([(True, u'x x'), (True, u'y y')], | 90 | self.assertAsTokens([(True, u'x x'), (True, u'y y')], |
4781 | 91 | u'"x x" "y y"') | 91 | u'"x x" "y y"') |
4782 | 92 | 92 | ||
4783 | === modified file 'bzrlib/tests/test_commands.py' | |||
4784 | --- bzrlib/tests/test_commands.py 2010-01-14 13:17:33 +0000 | |||
4785 | +++ bzrlib/tests/test_commands.py 2010-04-06 07:24:41 +0000 | |||
4786 | @@ -24,6 +24,7 @@ | |||
4787 | 24 | config, | 24 | config, |
4788 | 25 | errors, | 25 | errors, |
4789 | 26 | option, | 26 | option, |
4790 | 27 | symbol_versioning, | ||
4791 | 27 | tests, | 28 | tests, |
4792 | 28 | ) | 29 | ) |
4793 | 29 | from bzrlib.commands import display_command | 30 | from bzrlib.commands import display_command |
4794 | @@ -276,32 +277,45 @@ | |||
4795 | 276 | 277 | ||
4796 | 277 | class TestGetMissingCommandHook(tests.TestCase): | 278 | class TestGetMissingCommandHook(tests.TestCase): |
4797 | 278 | 279 | ||
4802 | 279 | def test_fires_on_get_cmd_object(self): | 280 | def hook_missing(self): |
4803 | 280 | # The get_missing_command(cmd) hook fires when commands are delivered to the | 281 | """Hook get_missing_command for testing.""" |
4804 | 281 | # ui. | 282 | self.hook_calls = [] |
4801 | 282 | hook_calls = [] | ||
4805 | 283 | class ACommand(commands.Command): | 283 | class ACommand(commands.Command): |
4806 | 284 | """A sample command.""" | 284 | """A sample command.""" |
4807 | 285 | def get_missing_cmd(cmd_name): | 285 | def get_missing_cmd(cmd_name): |
4809 | 286 | hook_calls.append(('called', cmd_name)) | 286 | self.hook_calls.append(('called', cmd_name)) |
4810 | 287 | if cmd_name in ('foo', 'info'): | 287 | if cmd_name in ('foo', 'info'): |
4811 | 288 | return ACommand() | 288 | return ACommand() |
4812 | 289 | commands.Command.hooks.install_named_hook( | 289 | commands.Command.hooks.install_named_hook( |
4813 | 290 | "get_missing_command", get_missing_cmd, None) | 290 | "get_missing_command", get_missing_cmd, None) |
4814 | 291 | self.ACommand = ACommand | ||
4815 | 292 | |||
4816 | 293 | def test_fires_on_get_cmd_object(self): | ||
4817 | 294 | # The get_missing_command(cmd) hook fires when commands are delivered to the | ||
4818 | 295 | # ui. | ||
4819 | 296 | self.hook_missing() | ||
4820 | 291 | # create a command directly, should not fire | 297 | # create a command directly, should not fire |
4823 | 292 | cmd = ACommand() | 298 | self.cmd = self.ACommand() |
4824 | 293 | self.assertEqual([], hook_calls) | 299 | self.assertEqual([], self.hook_calls) |
4825 | 294 | # ask by name, should fire and give us our command | 300 | # ask by name, should fire and give us our command |
4826 | 295 | cmd = commands.get_cmd_object('foo') | 301 | cmd = commands.get_cmd_object('foo') |
4830 | 296 | self.assertEqual([('called', 'foo')], hook_calls) | 302 | self.assertEqual([('called', 'foo')], self.hook_calls) |
4831 | 297 | self.assertIsInstance(cmd, ACommand) | 303 | self.assertIsInstance(cmd, self.ACommand) |
4832 | 298 | del hook_calls[:] | 304 | del self.hook_calls[:] |
4833 | 299 | # ask by a name that is supplied by a builtin - the hook should not | 305 | # ask by a name that is supplied by a builtin - the hook should not |
4834 | 300 | # fire and we still get our object. | 306 | # fire and we still get our object. |
4835 | 301 | commands.install_bzr_command_hooks() | 307 | commands.install_bzr_command_hooks() |
4836 | 302 | cmd = commands.get_cmd_object('info') | 308 | cmd = commands.get_cmd_object('info') |
4837 | 303 | self.assertNotEqual(None, cmd) | 309 | self.assertNotEqual(None, cmd) |
4839 | 304 | self.assertEqual(0, len(hook_calls)) | 310 | self.assertEqual(0, len(self.hook_calls)) |
4840 | 311 | |||
4841 | 312 | def test_skipped_on_HelpCommandIndex_get_topics(self): | ||
4842 | 313 | # The get_missing_command(cmd_name) hook is not fired when | ||
4843 | 314 | # looking up help topics. | ||
4844 | 315 | self.hook_missing() | ||
4845 | 316 | topic = commands.HelpCommandIndex() | ||
4846 | 317 | topics = topic.get_topics('foo') | ||
4847 | 318 | self.assertEqual([], self.hook_calls) | ||
4848 | 305 | 319 | ||
4849 | 306 | 320 | ||
4850 | 307 | class TestListCommandHook(tests.TestCase): | 321 | class TestListCommandHook(tests.TestCase): |
4851 | @@ -323,3 +337,10 @@ | |||
4852 | 323 | cmds = list(commands.all_command_names()) | 337 | cmds = list(commands.all_command_names()) |
4853 | 324 | self.assertEqual(['called'], hook_calls) | 338 | self.assertEqual(['called'], hook_calls) |
4854 | 325 | self.assertSubset(['foo', 'bar'], cmds) | 339 | self.assertSubset(['foo', 'bar'], cmds) |
4855 | 340 | |||
4856 | 341 | class TestDeprecations(tests.TestCase): | ||
4857 | 342 | |||
4858 | 343 | def test_shlex_split_unicode_deprecation(self): | ||
4859 | 344 | res = self.applyDeprecated( | ||
4860 | 345 | symbol_versioning.deprecated_in((2, 2, 0)), | ||
4861 | 346 | commands.shlex_split_unicode, 'whatever') | ||
4862 | 326 | 347 | ||
4863 | === modified file 'bzrlib/tests/test_commit.py' | |||
4864 | --- bzrlib/tests/test_commit.py 2010-02-13 01:50:29 +0000 | |||
4865 | +++ bzrlib/tests/test_commit.py 2010-04-06 07:24:41 +0000 | |||
4866 | @@ -1,4 +1,4 @@ | |||
4868 | 1 | # Copyright (C) 2005, 2006, 2008 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
4869 | 2 | # | 2 | # |
4870 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4871 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4872 | 5 | 5 | ||
4873 | === modified file 'bzrlib/tests/test_config.py' | |||
4874 | --- bzrlib/tests/test_config.py 2010-01-25 17:48:22 +0000 | |||
4875 | +++ bzrlib/tests/test_config.py 2010-04-06 07:24:41 +0000 | |||
4876 | @@ -1,4 +1,4 @@ | |||
4878 | 1 | # Copyright (C) 2005, 2006, 2008, 2009 Canonical Ltd | 1 | # Copyright (C) 2005-2010 Canonical Ltd |
4879 | 2 | # | 2 | # |
4880 | 3 | # This program is free software; you can redistribute it and/or modify | 3 | # This program is free software; you can redistribute it and/or modify |
4881 | 4 | # it under the terms of the GNU General Public License as published by | 4 | # it under the terms of the GNU General Public License as published by |
4882 | 5 | 5 | ||
4883 | === modified file 'bzrlib/tests/test_conflicts.py' | |||
4884 | --- bzrlib/tests/test_conflicts.py 2010-02-10 17:52:08 +0000 | |||
4885 | +++ bzrlib/tests/test_conflicts.py 2010-04-06 07:24:41 +0000 | |||
4886 | @@ -18,15 +18,32 @@ | |||
4887 | 18 | import os | 18 | import os |
4888 | 19 | 19 | ||
4889 | 20 | from bzrlib import ( | 20 | from bzrlib import ( |
4890 | 21 | branchbuilder, | ||
4891 | 21 | bzrdir, | 22 | bzrdir, |
4892 | 22 | conflicts, | 23 | conflicts, |
4893 | 23 | errors, | 24 | errors, |
4894 | 24 | option, | 25 | option, |
4895 | 25 | tests, | 26 | tests, |
4896 | 27 | workingtree, | ||
4897 | 26 | ) | 28 | ) |
4898 | 27 | from bzrlib.tests import script | 29 | from bzrlib.tests import script |
4899 | 28 | 30 | ||
4900 | 29 | 31 | ||
4901 | 32 | def load_tests(standard_tests, module, loader): | ||
4902 | 33 | result = loader.suiteClass() | ||
4903 | 34 | |||
4904 | 35 | sp_tests, remaining_tests = tests.split_suite_by_condition( | ||
4905 | 36 | standard_tests, tests.condition_isinstance(( | ||
4906 | 37 | TestResolveContentConflicts, | ||
4907 | 38 | ))) | ||
4908 | 39 | tests.multiply_tests(sp_tests, content_conflict_scenarios(), result) | ||
4909 | 40 | |||
4910 | 41 | # No parametrization for the remaining tests | ||
4911 | 42 | result.addTests(remaining_tests) | ||
4912 | 43 | |||
4913 | 44 | return result | ||
4914 | 45 | |||
4915 | 46 | |||
4916 | 30 | # TODO: Test commit with some added, and added-but-missing files | 47 | # TODO: Test commit with some added, and added-but-missing files |
4917 | 31 | # RBC 20060124 is that not tested in test_commit.py ? | 48 | # RBC 20060124 is that not tested in test_commit.py ? |
4918 | 32 | 49 | ||
4919 | @@ -69,15 +86,15 @@ | |||
4920 | 69 | ('hello.sploo.OTHER', 'yellowworld2'), | 86 | ('hello.sploo.OTHER', 'yellowworld2'), |
4921 | 70 | ]) | 87 | ]) |
4922 | 71 | tree.lock_read() | 88 | tree.lock_read() |
4924 | 72 | self.assertEqual(6, len(list(tree.list_files()))) | 89 | self.assertLength(6, list(tree.list_files())) |
4925 | 73 | tree.unlock() | 90 | tree.unlock() |
4926 | 74 | tree_conflicts = tree.conflicts() | 91 | tree_conflicts = tree.conflicts() |
4928 | 75 | self.assertEqual(2, len(tree_conflicts)) | 92 | self.assertLength(2, tree_conflicts) |
4929 | 76 | self.assertTrue('hello' in tree_conflicts[0].path) | 93 | self.assertTrue('hello' in tree_conflicts[0].path) |
4930 | 77 | self.assertTrue('hello.sploo' in tree_conflicts[1].path) | 94 | self.assertTrue('hello.sploo' in tree_conflicts[1].path) |
4931 | 78 | conflicts.restore('hello') | 95 | conflicts.restore('hello') |
4932 | 79 | conflicts.restore('hello.sploo') | 96 | conflicts.restore('hello.sploo') |
4934 | 80 | self.assertEqual(0, len(tree.conflicts())) | 97 | self.assertLength(0, tree.conflicts()) |
4935 | 81 | self.assertFileEqual('hello world2', 'hello') | 98 | self.assertFileEqual('hello world2', 'hello') |
4936 | 82 | self.assertFalse(os.path.lexists('hello.sploo')) | 99 | self.assertFalse(os.path.lexists('hello.sploo')) |
4937 | 83 | self.assertRaises(errors.NotConflicted, conflicts.restore, 'hello') | 100 | self.assertRaises(errors.NotConflicted, conflicts.restore, 'hello') |
4938 | @@ -192,59 +209,99 @@ | |||
4939 | 192 | pass | 209 | pass |
4940 | 193 | 210 | ||
4941 | 194 | 211 | ||
4983 | 195 | class TestResolveContentConflicts(TestResolveConflicts): | 212 | def content_conflict_scenarios(): |
4984 | 196 | 213 | return [('file,None', dict(_this_actions='modify_file', | |
4985 | 197 | # FIXME: We need to add the reverse case (delete in trunk, modify in | 214 | _check_this='file_has_more_content', |
4986 | 198 | # branch) but that could wait until the resolution mechanism is implemented. | 215 | _other_actions='delete_file', |
4987 | 199 | 216 | _check_other='file_doesnt_exist', | |
4988 | 200 | preamble = """ | 217 | )), |
4989 | 201 | $ bzr init trunk | 218 | ('None,file', dict(_this_actions='delete_file', |
4990 | 202 | $ cd trunk | 219 | _check_this='file_doesnt_exist', |
4991 | 203 | $ echo 'trunk content' >file | 220 | _other_actions='modify_file', |
4992 | 204 | $ bzr add file | 221 | _check_other='file_has_more_content', |
4993 | 205 | $ bzr commit -m 'Create trunk' | 222 | )), |
4994 | 206 | 223 | ] | |
4995 | 207 | $ bzr branch . ../branch | 224 | |
4996 | 208 | $ cd ../branch | 225 | |
4997 | 209 | $ bzr rm file | 226 | class TestResolveContentConflicts(tests.TestCaseWithTransport): |
4998 | 210 | $ bzr commit -m 'Delete file' | 227 | |
4999 | 211 | 228 | # Set by load_tests | |
5000 | 212 | $ cd ../trunk | 229 | this_actions = None |
4960 | 213 | $ echo 'more content' >>file | ||
4961 | 214 | $ bzr commit -m 'Modify file' | ||
4962 | 215 | |||
4963 | 216 | $ cd ../branch | ||
4964 | 217 | $ bzr merge ../trunk | ||
4965 | 218 | 2>+N file.OTHER | ||
4966 | 219 | 2>Contents conflict in file | ||
4967 | 220 | 2>1 conflicts encountered. | ||
4968 | 221 | """ | ||
4969 | 222 | |||
4970 | 223 | def test_take_this(self): | ||
4971 | 224 | self.run_script(""" | ||
4972 | 225 | $ bzr rm file.OTHER --force # a simple rm file.OTHER is valid too | ||
4973 | 226 | $ bzr resolve file | ||
4974 | 227 | $ bzr commit --strict -m 'No more conflicts nor unknown files' | ||
4975 | 228 | """) | ||
4976 | 229 | |||
4977 | 230 | def test_take_other(self): | ||
4978 | 231 | self.run_script(""" | ||
4979 | 232 | $ bzr mv file.OTHER file | ||
4980 | 233 | $ bzr resolve file | ||
4981 | 234 | $ bzr commit --strict -m 'No more conflicts nor unknown files' | ||
4982 | 235 | """) |
The diff has been truncated for viewing.
Bah. It's even worse than I thought, I'll resubmit against bzr.dev.