/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to doc/developers/overview.txt

  • Committer: Vincent Ladeuil
  • Date: 2010-06-20 11:18:38 UTC
  • mto: (5247.1.10 first-try)
  • mto: This revision was merged to the branch mainline in revision 5326.
  • Revision ID: v.ladeuil+lp@free.fr-20100620111838-3s726ne0g2ni42m1
No more use of the get_transport imported *symbol*, all uses are through
the module now, allowing effective wrapping.

* bzrlib/workingtree.py:
(WorkingTree.find_trees): More evil calls to
transport.get_transport defeating the wrapping.

* bzrlib/transport/decorator.py:
(TransportDecorator.__init__): More evil calls to
transport.get_transport defeating the wrapping.

* bzrlib/tests/test_workingtree.py:
(TestWorkingTreeFormat.test_find_format.check_format): More evil
calls to transport.get_transport defeating the wrapping.

* bzrlib/tests/test_upgrade.py:
(TestUpgrade.test_upgrade_simple):
(TestUpgrade.test_upgrade_v6_to_meta_no_workingtree): More evil
calls to transport.get_transport defeating the wrapping.

* bzrlib/tests/test_transport_log.py:
(test_log_transport): More evil calls to transport.get_transport
defeating the wrapping.

* bzrlib/tests/test_smart_request.py:
(TestJailHook.test_jail_hook): More evil calls to
transport.get_transport defeating the wrapping.

* bzrlib/tests/test_sftp_transport.py:
(SFTPNonServerTest.test_abspath_root_sibling_server):
(SSHVendorBadConnection.test_bad_connection_paramiko):
(SSHVendorBadConnection.test_bad_connection_ssh):
(TestUsesAuthConfig.get_transport_for_connection): More evil calls
to transport.get_transport defeating the wrapping.

* bzrlib/tests/test_selftest.py:
(test_get_readonly_url_none):
(TestTestCaseWithTransport.test_get_readonly_url_none):
(TestTestCaseWithTransport.test_get_readonly_url_http):
(TestChrootedTest.test_root_is_root): More evil calls to
transport.get_transport defeating the wrapping.

* bzrlib/tests/test_remote.py:
(Test_ClientMedium_remote_path_from_transport.assertRemotePath):
(Test_ClientMedium_remote_path_from_transport.assertRemotePathHTTP):
More evil calls to transport.get_transport defeating the wrapping.

* bzrlib/tests/test_reconcile.py:
Unused import deleted.

* bzrlib/tests/test_permissions.py:
(check_mode_r):
(TestSftpPermissions.test_new_files):
(TestSftpPermissions.test_sftp_server_modes): More evil calls to
transport.get_transport defeating the wrapping.

* bzrlib/tests/test_lockable_files.py:
(setUp, TestLockableFiles_RemoteLockDir.setUp): More evil calls to
transport.get_transport defeating the wrapping.

* bzrlib/tests/test_knit.py:
(TestKnitIndex.test_knit_index_ignores_empty_files): More evil
calls to transport.get_transport defeating the wrapping.

* bzrlib/tests/test_index.py:
(test_build_index_empty_two_element_keys):
(test_build_index_one_reference_list_empty):
(test_build_index_two_reference_list_empty):
(test_build_index_one_node_no_refs):
(test_build_index_one_node_no_refs_accepts_empty_reflist):
(TestGraphIndexBuilder.test_build_index_one_node_2_element_keys):
(test_add_node_empty_value):
(test_build_index_nodes_sorted):
(test_build_index_2_element_key_nodes_sorted):
(test_build_index_reference_lists_are_included_one):
(test_build_index_reference_lists_with_2_element_keys):
(test_build_index_reference_lists_are_included_two):
(test_clear_cache):
(test_node_references_are_cr_delimited):
(test_multiple_reference_lists_are_tab_delimited):
(test_add_node_referencing_missing_key_makes_absent):
(test_node_references_three_digits):
(test_absent_has_no_reference_overhead):
(test_add_node_bad_key):
(TestGraphIndexBuilder.test_add_node_bad_key):
(test_add_node_bad_key_in_reference_lists):
(TestGraphIndexBuilder.test_add_node_bad_key_in_reference_lists):
(make_index):
(test_open_bad_index_no_error):
(test_iter_missing_entry_empty_no_size):
(test_validate_bad_index_errors):
(test_supports_unlimited_cache):
(TestCombinedGraphIndex.make_combined_index_with_missing):
(reload):
(TestCombinedGraphIndex.test_clear_cache):
(test_reorder_after_iter_entries):
(test_validate_reloads):
(TestCombinedGraphIndex.test_find_ancestors_across_indexes):
(TestCombinedGraphIndex.test_find_ancestors_missing_keys):
(test_find_ancestors_no_indexes):
(TestCombinedGraphIndex.test_find_ancestors_ghost_parent):
(test__find_ancestors_empty_index):
(test_construct): More evil calls to transport.get_transport
defeating the wrapping and some more import fixes.

* bzrlib/tests/test_directory_service.py:
(TestDirectoryLookup.test_get_transport): More evil calls to
transport.get_transport defeating the wrapping.

* bzrlib/tests/test_debug.py:
Unused import deleted.

* bzrlib/tests/test_btree_index.py:
(TestBTreeBuilder.test_three_level_tree_details):
(TestBTreeBuilder.test_spill_index_stress_2_2):
(TestBTreeIndex.make_index):
(test_trivial_constructor):
(test__read_nodes_no_size_one_page_reads_once):
(TestBTreeIndex.test__read_nodes_no_size_multiple_pages):
(TestBTreeIndex.test_2_levels_key_count_2_2):
(TestBTreeIndex.test_validate_two_pages):
(TestBTreeIndex.test_iter_all_entries_reads):
(TestBTreeIndex.test_iter_all_entries_reads):
(TestBTreeIndex.test_iter_entries_references_2_refs_resolved):
(TestBTreeIndex.test_iter_entries_references_2_refs_resolved):
(TestBTreeIndex.test_supports_unlimited_cache):
(TestExpandOffsets.make_index): More evil calls to
transport.get_transport defeating the wrapping.

* bzrlib/tests/per_workingtree/test_pull.py:
Unused import deleted.

* bzrlib/tests/per_versionedfile.py:
(test_readonly_mode):
(TestWeave.get_file):
(reopen_file):
(TestReadonlyHttpMixin.test_readonly_http_works):
(TestReadonlyHttpMixin.test_readonly_http_works_with_feeling):
(TestWeaveHTTP.get_file):
(TestWeaveMerge.get_file): More evil calls to
transport.get_transport defeating the wrapping.

* bzrlib/tests/per_repository/test_reconcile.py:
(setUp):
(TestReconcileWithIncorrectRevisionCache.setUp):
(test_reconcile_wrong_order):
(test_reconcile_wrong_order_secondary_inventory): More evil calls
to transport.get_transport defeating the wrapping.

* bzrlib/tests/per_repository/test_has_same_location.py:
(TestHasSameLocation.test_different_format_not_equal): More evil
calls to transport.get_transport defeating the wrapping.

* bzrlib/tests/per_repository/test_fetch.py:
Unused import deleted.

* bzrlib/tests/per_intertree/__init__.py:
Unused import deleted.

* bzrlib/tests/per_interrepository/__init__.py:
(TestCaseWithInterRepository.make_bzrdir): More evil calls to
transport.get_transport defeating the wrapping.

* bzrlib/tests/per_interbranch/test_push.py:
Unused import deleted.

* bzrlib/tests/per_interbranch/__init__.py:
Unused import deleted.

* bzrlib/tests/per_bzrdir/test_bzrdir.py:
(TestBzrDir.sproutOrSkip):
(TestBzrDir.test_format_initialize_find_open):
(TestBzrDir.test_open_not_bzrdir):
(TestBzrDir.test_open_branch):
(TestBzrDir.test_open_branch):
(TestBzrDir.test_list_branches):
(TestBzrDir.test_create_repository):
(TestBzrDir.test_create_repository_shared):
(TestBzrDir.test_create_repository_nonshared):
(TestBzrDir.test_open_repository):
(test_root_transport):
(TestBzrDir.test_find_repository_no_repo_under_standalone_branch):
(TestBzrDir.test_find_repository_containing_shared_repository):
(TestBzrDir.test_find_repository_shared_within_shared_repository):
(TestBzrDir.test_find_repository_with_nested_dirs_works):
(ChrootedBzrDirTests.test_find_repository_no_repository):
(TestBzrDirControlComponent): More evil calls to
transport.get_transport defeating the wrapping.

* bzrlib/tests/per_branch/test_stacking.py: 
Unused import deleted.

* bzrlib/tests/per_branch/test_permissions.py: 
Unused import deleted.

* bzrlib/tests/per_branch/test_bound_sftp.py:
(test_unbinding): More evil calls to transport.get_transport
defeating the wrapping.

* bzrlib/tests/blackbox/test_upgrade.py:
(TestWithUpgradableBranches.test_upgrade_up_to_date_checkout_warns_branch_left_alone):
(test_upgrade_explicit_metaformat):
(TestWithUpgradableBranches.test_upgrade_explicit_knit):
(test_upgrade_with_existing_backup_dir):
(TestWithUpgradableBranches.test_upgrade_with_existing_backup_dir):
More evil calls to transport.get_transport defeating the wrapping.

* bzrlib/tests/blackbox/test_serve.py:
(test_bzr_serve_port_readonly): More evil calls to
transport.get_transport defeating the wrapping.

* bzrlib/plugins/launchpad/test_lp_directory.py:
(DirectoryOpenBranchTests.test_directory_open_branch): Use
transport.get_transport instead of get_transport.

* bzrlib/plugins/launchpad/account.py:
(check_lp_login): Use transport.get_transport instead of
get_transport.

* bzrlib/builtins.py (run): Use transport.get_transport instead of
get_transport.

* bzrlib/btree_index.py:
(BTreeBuilder._spill_mem_keys_to_disk): Use
transport.get_transport instead of get_transport.

* bzrlib/benchmarks/bench_commit.py:
Unused import deleted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
This document describes the key classes and concepts within Bazaar.  It is
6
6
intended to be useful to people working on the Bazaar codebase, or to
7
 
people writing plugins.
 
7
people writing plugins.  People writing plugins may also like to read the 
 
8
guide to `Integrating with Bazaar <integrating.html>`_ for some specific
 
9
recipes.
8
10
 
9
11
If you have any questions, or if something seems to be incorrect, unclear
10
12
or missing, please talk to us in ``irc://irc.freenode.net/#bzr``, or write
11
 
to the Bazaar mailing list.  To propose a correction or addition to this
12
 
document, send a merge request or new text to the mailing list.
13
 
 
14
 
The current version of this document is available in the file
15
 
``doc/developers/overview.txt`` in the source tree, and available online
16
 
within the developer documentation, <http://doc.bazaar-vcs.org/developers/>.
17
 
 
18
 
 
19
 
Essential Domain Classes
20
 
########################
21
 
 
22
 
The core domain objects within the bazaar model are:
23
 
 
24
 
* Transport
25
 
 
26
 
* Branch
27
 
 
28
 
* Repository
29
 
 
30
 
* WorkingTree
31
 
 
32
 
Transports are explained below. See http://bazaar-vcs.org/Classes/
33
 
for an introduction to the other key classes.
 
13
to the Bazaar mailing list.  
 
14
 
 
15
 
 
16
Core classes
 
17
############
34
18
 
35
19
Transport
36
 
#########
 
20
=========
37
21
 
38
22
The ``Transport`` layer handles access to local or remote directories.
39
23
Each Transport object acts as a logical connection to a particular
46
30
Python file I/O mechanisms.
47
31
 
48
32
Filenames vs URLs
49
 
=================
 
33
-----------------
50
34
 
51
35
Transports work in terms of URLs.  Take note that URLs are by definition
52
36
only ASCII - the decision of how to encode a Unicode string into a URL
83
67
is also in the form of URL components.
84
68
 
85
69
 
 
70
WorkingTree
 
71
===========
 
72
 
 
73
A workingtree is a special type of Tree that's associated with a working
 
74
directory on disk, where the user can directly modify the files. 
 
75
 
 
76
Responsibilities:
 
77
 
 
78
 * Maintaining a WorkingTree on disk at a file path.
 
79
 * Maintaining the basis inventory (the inventory of the last commit done)
 
80
 * Maintaining the working inventory.
 
81
 * Maintaining the pending merges list.
 
82
 * Maintaining the stat cache.
 
83
 * Maintaining the last revision the working tree was updated to.
 
84
 * Knows where its Branch is located.
 
85
 
 
86
Dependencies:
 
87
 
 
88
 * a Branch
 
89
 * an MutableInventory
 
90
 * local access to the working tree
 
91
 
 
92
Branch
 
93
======
 
94
 
 
95
A Branch is a key user concept - its a single line of history that one or
 
96
more people have been committing to. 
 
97
 
 
98
A Branch is responsible for:
 
99
 
 
100
 * Holding user preferences that are set in a Branch.
 
101
 * Holding the 'tip': the last revision to be committed to this Branch. (And the revno of that revision.)
 
102
 * Knowing how to open the Repository that holds its history.
 
103
 * Allowing write locks to be taken out to prevent concurrent alterations to the branch.
 
104
 
 
105
Depends on:
 
106
 * URL access to its base directory.
 
107
 * A Transport to access its files.
 
108
 * A Repository to hold its history.
 
109
 
86
110
Repository
87
 
##########
 
111
==========
88
112
 
89
113
Repositories store committed history: file texts, revisions, inventories,
90
 
and graph relationships between them.
 
114
and graph relationships between them.  A repository holds a bag of
 
115
revision data that can be pointed to by various branches:
 
116
 
 
117
 * Maintains storage of various history data at a URL:
 
118
   * Revisions (Must have a matching inventory)
 
119
   * Digital Signatures
 
120
   * Inventories for each Revision. (Must have all the file texts available).
 
121
   * File texts
 
122
 
 
123
 * Synchronizes concurrent access to the repository by different
 
124
   processes.  (Most repository implementations use a physical 
 
125
   mutex only for a short period, and effectively support multiple readers
 
126
   and writers.)
91
127
 
92
128
Stacked Repositories
93
 
====================
 
129
--------------------
94
130
 
95
131
A repository can be configured to refer to a list of "fallback"
96
132
repositories.  If a particular revision is not present in the original