/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 __init__.py

  • Committer: Ian Clatworthy
  • Date: 2009-08-17 03:24:47 UTC
  • mto: (0.64.207 trunk)
  • mto: This revision was merged to the branch mainline in revision 6631.
  • Revision ID: ian.clatworthy@canonical.com-20090817032447-cxs3ub6g2omr42ap
update help

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
The normal import recipe is::
27
27
 
28
 
  bzr init-repo .
29
28
  bzr fast-export-from-xxx SOURCE project.fi
30
 
  bzr fast-import project.fi
 
29
  bzr fast-import project.fi project.bzr
31
30
 
32
31
If fast-export-from-xxx doesn't exist yet for the tool you're importing
33
32
from, the alternative recipe is::
34
33
 
35
 
  bzr init-repo .
36
34
  front-end > project.fi
37
 
  bzr fast-import project.fi
 
35
  bzr fast-import project.fi project.fi
38
36
 
39
37
The list of known front-ends and their status is documented on
40
38
http://bazaar-vcs.org/BzrFastImport/FrontEnds. The fast-export-from-xxx
107
105
class cmd_fast_import(Command):
108
106
    """Backend for fast Bazaar data importers.
109
107
 
110
 
    This command reads a mixed command/data stream and
111
 
    creates branches in the current repository accordingly.
112
 
    The usual recipe is::
113
 
 
114
 
      bzr fast-import project.fi
115
 
 
 
108
    This command reads a mixed command/data stream and creates
 
109
    branches in a Bazaar repository accordingly. The preferred
 
110
    recipe is::
 
111
 
 
112
      bzr fast-import project.fi project.bzr
 
113
 
 
114
    Numerous commands are provided for generating a fast-import file
 
115
    to use as input. These are named fast-export-from-xxx where xxx
 
116
    is one of cvs, darcs, git, hg, mnt, p4 or svn.
116
117
    To specify standard input as the input stream, use a
117
 
    source name of '-' (instead of project.fi). Numerous commands
118
 
    are provided for generating a fast-import stream to use as input.
119
 
    These include fast-export-from-svn, fast-export-from-git,
120
 
    fast-export-from-hg and fast-export-from-darcs.
121
 
 
122
 
    If you wish to write a custom exporter for your project, see
123
 
    http://bazaar-vcs.org/BzrFastImport for the detailed protocol
124
 
    specification. In many cases, exporters can be written quite
125
 
    quickly using whatever scripting/programming language you like.
126
 
 
127
 
    If run inside a branch using a shared repository, then
128
 
    the current branch is made the trunk and other branches,
129
 
    if any, are created in sister directories. If run inside
130
 
    a standalone tree, the current branch is also made the
131
 
    trunk, but warnings are output about other branches found.
132
 
 
133
 
    Git reference names are mapped to bzr branch names as follows:
 
118
    source name of '-' (instead of project.fi).
 
119
    
 
120
    project.bzr will be created if it doesn't exist. If it exists
 
121
    already, it should be empty or be an existing Bazaar repository
 
122
    or branch. If not specified, the current directory is assumed.
 
123
 
 
124
    fast-import will intelligently select the format to use when
 
125
    creating a repository or branch. If you are running Bazaar 1.17
 
126
    up to Bazaar 2.0, the default format for Bazaar 2.x ("2a") is used.
 
127
    Otherwise, the current default format ("pack-0.92" for Bazaar 1.x)
 
128
    is used. If you wish to specify a custom format, use the --format
 
129
    option.
 
130
 
 
131
     .. note::
 
132
     
 
133
        To maintain backwards compatibility, fast-import lets you
 
134
        create the target repository or standalone branch yourself.
 
135
        It is recommended though that you let fast-import create
 
136
        these for you instead.
 
137
 
 
138
    :Branch mapping rules:
 
139
 
 
140
     Git reference names are mapped to Bazaar branch names as follows:
134
141
      
135
 
    * refs/heads/foo is mapped to foo
136
 
    * refs/remotes/origin/foo is mapped to foo.remote
137
 
    * refs/tags/foo is mapped to foo.tag
138
 
    * */master is mapped to trunk, trunk.remote, etc.
139
 
    * */trunk is mapped to git-trunk, git-trunk.remote, etc.
140
 
 
141
 
 
142
 
    At checkpoints and on completion, the commit-id -> revision-id
143
 
    map is saved to a file called 'fastimport-id-map' in the control
144
 
    directory for the repository (e.g. .bzr/repository). If the import
145
 
    is interrupted or unexpectedly crashes, it can be started again
146
 
    and this file will be used to skip over already loaded revisions.
147
 
    As long as subsequent exports from the original source begin
148
 
    with exactly the same revisions, you can use this feature to
149
 
    maintain a mirror of a repository managed by a foreign tool.
150
 
    If and when Bazaar is used to manage the repository, this file
151
 
    can be safely deleted.
152
 
 
153
 
    Note: A slightly more complex recipe is required when importing large
154
 
    projects via exporters that reuse blob data across commits, namely::
155
 
 
156
 
      bzr init-repo .
157
 
      front-end > xxx.fi
158
 
      bzr fast-import-info -v xxx.fi > xxx.cfg
159
 
      bzr fast-import xxx.fi --info xxx.cfg
160
 
 
161
 
    In this scenario, the xxx.cfg file generated by the first pass
162
 
    holds caching hints that the second pass uses to lower memory
163
 
    usage. Development is planned so that this recipe becomes obsolete
164
 
    in the future, i.e. so that the simple recipe always works.
 
142
     * refs/heads/foo is mapped to foo
 
143
     * refs/remotes/origin/foo is mapped to foo.remote
 
144
     * refs/tags/foo is mapped to foo.tag
 
145
     * */master is mapped to trunk, trunk.remote, etc.
 
146
     * */trunk is mapped to git-trunk, git-trunk.remote, etc.
 
147
 
 
148
    :Branch creation rules:
 
149
 
 
150
     When a shared repository is created or found at the destination,
 
151
     branches are created inside it. In the simple case of a single
 
152
     branch (refs/heads/master) inside the input file, the branch is
 
153
     project.bzr/trunk.
 
154
 
 
155
     When a standalone branch is found at the destination, the trunk
 
156
     is imported there and warnings are output about any other branches
 
157
     found in the input file.
 
158
 
 
159
     When a branch in a shared repository is found at the destination,
 
160
     that branch is made the trunk and other branches, if any, are
 
161
     created in sister directories.
 
162
 
 
163
    :Custom exporters:
 
164
 
 
165
     The fast-export-from-xxx commands typically call more advanced
 
166
     xxx-fast-export scripts. You are welcome to use the advanced
 
167
     scripts if you prefer.
 
168
 
 
169
     If you wish to write a custom exporter for your project, see
 
170
     http://bazaar-vcs.org/BzrFastImport for the detailed protocol
 
171
     specification. In many cases, exporters can be written quite
 
172
     quickly using whatever scripting/programming language you like.
 
173
 
 
174
    :Reducing memory usage:
 
175
 
 
176
     A slightly more complex recipe is required when importing large
 
177
     projects via exporters (like fast-export-from-git and
 
178
     git-fast-export) that reuse blob data across commits.
 
179
     The recipe is::
 
180
 
 
181
       front-end > xxx.fi
 
182
       bzr fast-import-info -v xxx.fi > xxx.cfg
 
183
       bzr fast-import xxx.fi --info xxx.cfg xxx.bzr
 
184
 
 
185
     In this scenario, the xxx.cfg file generated by the first pass
 
186
     holds caching hints that the second pass uses to lower memory
 
187
     usage. Development is planned so that this recipe becomes obsolete
 
188
     in the future, i.e. so that the simple recipe always works.
 
189
 
 
190
    :Restarting an import:
 
191
 
 
192
     At checkpoints and on completion, the commit-id -> revision-id
 
193
     map is saved to a file called 'fastimport-id-map' in the control
 
194
     directory for the repository (e.g. .bzr/repository). If the import
 
195
     is interrupted or unexpectedly crashes, it can be started again
 
196
     and this file will be used to skip over already loaded revisions.
 
197
     As long as subsequent exports from the original source begin
 
198
     with exactly the same revisions, you can use this feature to
 
199
     maintain a mirror of a repository managed by a foreign tool.
 
200
     If and when Bazaar is used to manage the repository, this file
 
201
     can be safely deleted.
165
202
 
166
203
    :Examples:
167
204
 
170
207
       bzr fast-export-from-svn /svn/repo/path project.fi
171
208
       bzr fast-import project.fi
172
209
 
 
210
     Import a CVS repository into Bazaar::
 
211
 
 
212
       bzr fast-export-from-cvs /cvs/repo/path project.fi
 
213
       bzr fast-import project.fi
 
214
 
173
215
     Import a Git repository into Bazaar::
174
216
 
175
217
       bzr fast-export-from-git /git/repo/path project.fi
294
336
     directory name of the library)::
295
337
 
296
338
       front-end | bzr fast-import-filter -i lib/xxx/ > xxx.fi
297
 
       bzr init-repo mylibrary
298
 
       cd mylibrary
299
 
       bzr fast-import ../xxx.fi
 
339
       bzr fast-import xxx.fi mylibrary.bzr
300
340
       (lib/xxx/foo is now foo)
301
341
 
302
342
     Create a new repository without a sensitive file::
303
343
 
304
344
       front-end | bzr fast-import-filter -x missile-codes.txt > clean.fi
305
 
       bzr init-repo project.clean
306
 
       cd project.clean
307
 
       bzr fast-import ../clean.fi
 
345
       bzr fast-import clean.fi clean.bzr
308
346
    """
309
347
    hidden = False
310
348
    _see_also = ['fast-import']