Change RepositoryDelegate into a factory function.
[cvs2svn.git] / cvs2svn_lib / config.py
blob416326c1cc2dd7a2ae5bc59780ef493534c09ff6
1 # (Be in -*- python -*- mode.)
3 # ====================================================================
4 # Copyright (c) 2000-2008 CollabNet. All rights reserved.
6 # This software is licensed as described in the file COPYING, which
7 # you should have received as part of this distribution. The terms
8 # are also available at http://subversion.tigris.org/license-1.html.
9 # If newer versions of this license are posted there, you may use a
10 # newer version instead, at your option.
12 # This software consists of voluntary contributions made by many
13 # individuals. For exact contribution history, see the revision
14 # history and logs, available at http://cvs2svn.tigris.org/.
15 # ====================================================================
17 """This module contains various configuration constants used by cvs2svn."""
20 SVN_KEYWORDS_VALUE = 'Author Date Id Revision'
22 # The default names for the trunk/branches/tags directory for each
23 # project:
24 DEFAULT_TRUNK_BASE = 'trunk'
25 DEFAULT_BRANCHES_BASE = 'branches'
26 DEFAULT_TAGS_BASE = 'tags'
28 SVNADMIN_EXECUTABLE = 'svnadmin'
29 CO_EXECUTABLE = 'co'
30 CVS_EXECUTABLE = 'cvs'
32 # A pickled list of the projects defined for this conversion.
33 PROJECTS = 'projects.pck'
35 # A file holding the Serializer to be used for CVS_REVS_*_DATAFILE and
36 # CVS_SYMBOLS_*_DATAFILE:
37 ITEM_SERIALIZER = 'item-serializer.pck'
39 # The first file contains the CVSRevisions in a form that can be
40 # sorted to deduce preliminary Changesets. The second file is the
41 # sorted version of the first.
42 CVS_REVS_DATAFILE = 'revs.dat'
43 CVS_REVS_SORTED_DATAFILE = 'revs-s.dat'
45 # The first file contains the CVSSymbols in a form that can be sorted
46 # to deduce preliminary Changesets. The second file is the sorted
47 # version of the first.
48 CVS_SYMBOLS_DATAFILE = 'symbols.dat'
49 CVS_SYMBOLS_SORTED_DATAFILE = 'symbols-s.dat'
51 # A mapping from CVSItem id to Changeset id.
52 CVS_ITEM_TO_CHANGESET = 'cvs-item-to-changeset.dat'
54 # A mapping from CVSItem id to Changeset id, after the
55 # RevisionChangeset loops have been broken.
56 CVS_ITEM_TO_CHANGESET_REVBROKEN = 'cvs-item-to-changeset-revbroken.dat'
58 # A mapping from CVSItem id to Changeset id, after the SymbolChangeset
59 # loops have been broken.
60 CVS_ITEM_TO_CHANGESET_SYMBROKEN = 'cvs-item-to-changeset-symbroken.dat'
62 # A mapping from CVSItem id to Changeset id, after all Changeset
63 # loops have been broken.
64 CVS_ITEM_TO_CHANGESET_ALLBROKEN = 'cvs-item-to-changeset-allbroken.dat'
66 # A mapping from id to Changeset.
67 CHANGESETS_INDEX = 'changesets-index.dat'
68 CHANGESETS_STORE = 'changesets.pck'
70 # A mapping from id to Changeset, after the RevisionChangeset loops
71 # have been broken.
72 CHANGESETS_REVBROKEN_INDEX = 'changesets-revbroken-index.dat'
73 CHANGESETS_REVBROKEN_STORE = 'changesets-revbroken.pck'
75 # A mapping from id to Changeset, after the RevisionChangesets have
76 # been sorted and converted into OrderedChangesets.
77 CHANGESETS_REVSORTED_INDEX = 'changesets-revsorted-index.dat'
78 CHANGESETS_REVSORTED_STORE = 'changesets-revsorted.pck'
80 # A mapping from id to Changeset, after the SymbolChangeset loops have
81 # been broken.
82 CHANGESETS_SYMBROKEN_INDEX = 'changesets-symbroken-index.dat'
83 CHANGESETS_SYMBROKEN_STORE = 'changesets-symbroken.pck'
85 # A mapping from id to Changeset, after all Changeset loops have been
86 # broken.
87 CHANGESETS_ALLBROKEN_INDEX = 'changesets-allbroken-index.dat'
88 CHANGESETS_ALLBROKEN_STORE = 'changesets-allbroken.pck'
90 # The RevisionChangesets in commit order. Each line contains the
91 # changeset id and timestamp of one changeset, in hexadecimal, in the
92 # order that the changesets should be committed to svn.
93 CHANGESETS_SORTED_DATAFILE = 'changesets-s.txt'
95 # A file containing a marshalled copy of all the statistics that have
96 # been gathered so far is written at the end of each pass as a
97 # marshalled dictionary. This is the pattern used to generate the
98 # filenames.
99 STATISTICS_FILE = 'statistics-%02d.pck'
101 # This text file contains records (1 per line) that describe openings
102 # and closings for copies to tags and branches. The format is as
103 # follows:
105 # SYMBOL_ID SVN_REVNUM TYPE CVS_SYMBOL_ID
107 # where type is either OPENING or CLOSING. CVS_SYMBOL_ID is the id of
108 # the CVSSymbol whose opening or closing is being described (in hex).
109 SYMBOL_OPENINGS_CLOSINGS = 'symbolic-names.txt'
110 # A sorted version of the above file. SYMBOL_ID and SVN_REVNUM are
111 # the primary and secondary sorting criteria. It is important that
112 # SYMBOL_IDs be located together to make it quick to read them at
113 # once. The order of SVN_REVNUM is only important because it is
114 # assumed by some internal consistency checks.
115 SYMBOL_OPENINGS_CLOSINGS_SORTED = 'symbolic-names-s.txt'
117 # Skeleton version of the repository filesystem. See class
118 # RepositoryMirror for how these work.
119 MIRROR_NODES_INDEX_TABLE = 'mirror-nodes-index.dat'
120 MIRROR_NODES_STORE = 'mirror-nodes.pck'
122 # Offsets pointing to the beginning of each symbol's records in
123 # SYMBOL_OPENINGS_CLOSINGS_SORTED. This file contains a pickled map
124 # from symbol_id to file offset.
125 SYMBOL_OFFSETS_DB = 'symbol-offsets.pck'
127 # Pickled map of CVSPath.id to instance.
128 CVS_PATHS_DB = 'cvs-paths.pck'
130 # A series of records. The first is a pickled serializer. Each
131 # subsequent record is a serialized list of all CVSItems applying to a
132 # CVSFile.
133 CVS_ITEMS_STORE = 'cvs-items.pck'
135 # The same as above, but with the CVSItems ordered in groups based on
136 # their initial changesets. CVSItems will usually be accessed one
137 # changeset at a time, so this ordering helps disk locality (even
138 # though some of the changesets will later be broken up).
139 CVS_ITEMS_SORTED_INDEX_TABLE = 'cvs-items-sorted-index.dat'
140 CVS_ITEMS_SORTED_STORE = 'cvs-items-sorted.pck'
142 # A record of all symbolic names that will be processed in the
143 # conversion. This file contains a pickled list of TypedSymbol
144 # objects.
145 SYMBOL_DB = 'symbols.pck'
147 # A pickled list of the statistics for all symbols. Each entry in the
148 # list is an instance of cvs2svn_lib.symbol_statistics._Stats.
149 SYMBOL_STATISTICS = 'symbol-statistics.pck'
151 # These two databases provide a bidirectional mapping between
152 # CVSRevision.ids (in hex) and Subversion revision numbers.
154 # The first maps CVSRevision.id to the SVN revision number of which it
155 # is a part (more than one CVSRevision can map to the same SVN
156 # revision number).
158 # The second maps Subversion revision numbers (as hex strings) to
159 # pickled SVNCommit instances.
160 CVS_REVS_TO_SVN_REVNUMS = 'cvs-revs-to-svn-revnums.dat'
162 # This database maps Subversion revision numbers to pickled SVNCommit
163 # instances.
164 SVN_COMMITS_INDEX_TABLE = 'svn-commits-index.dat'
165 SVN_COMMITS_STORE = 'svn-commits.pck'
167 # How many bytes to read at a time from a pipe. 128 kiB should be
168 # large enough to be efficient without wasting too much memory.
169 PIPE_READ_SIZE = 128 * 1024
171 # Records the author and log message for each changeset. The database
172 # contains a map metadata_id -> (author, logmessage). Each
173 # CVSRevision that is eligible to be combined into the same SVN commit
174 # is assigned the same id. Note that the (author, logmessage) pairs
175 # are not necessarily all distinct; other data are taken into account
176 # when constructing ids.
177 METADATA_INDEX_TABLE = 'metadata-index.dat'
178 METADATA_STORE = 'metadata.pck'
180 # The same, after it has been cleaned up for the chosen output option:
181 METADATA_CLEAN_INDEX_TABLE = 'metadata-clean-index.dat'
182 METADATA_CLEAN_STORE = 'metadata-clean.pck'
184 # The following four databases are used in conjunction with --use-internal-co.
186 # Records the RCS deltas for all CVS revisions. The deltas are to be
187 # applied forward, i.e. those from trunk are reversed wrt RCS.
188 RCS_DELTAS_INDEX_TABLE = 'rcs-deltas-index.dat'
189 RCS_DELTAS_STORE = 'rcs-deltas.pck'
191 # Records the revision tree of each RCS file. The format is a list of
192 # list of integers. The outer list holds lines of development, the inner list
193 # revisions within the LODs, revisions are CVSItem ids. Branches "closer
194 # to the trunk" appear later. Revisions are sorted by reverse chronological
195 # order. The last revision of each branch is the revision it sprouts from.
196 # Revisions that represent deletions at the end of a branch are omitted.
197 RCS_TREES_INDEX_TABLE = 'rcs-trees-index.dat'
198 RCS_TREES_STORE = 'rcs-trees.pck'
200 # At any given time during OutputPass, holds the full text of each CVS
201 # revision that was checked out already and still has descendants that will
202 # be checked out.
203 CVS_CHECKOUT_DB = 'cvs-checkout.db'
205 # End of DBs related to --use-internal-co.
207 # flush a commit if a 5 minute gap occurs.
208 COMMIT_THRESHOLD = 5 * 60