~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin Pool
  • Date: 2006-04-13 03:48:05 UTC
  • mto: This revision was merged to the branch mainline in revision 1662.
  • Revision ID: mbp@sourcefrog.net-20060413034805-5da73e30153f2ccf
init-repo shouldn't insist on creating a new directory (Malone #38331)

Show diffs side-by-side

added added

removed removed

Lines of Context:
897
897
 
898
898
 
899
899
class cmd_init_repository(Command):
900
 
    """Create a shared repository to keep branches in."""
 
900
    """Create a shared repository to hold branches.
 
901
 
 
902
    New branches created under the repository directory will store their revisions
 
903
    in the repository, not in the branch directory, if the branch format supports
 
904
    shared storage.
 
905
 
 
906
    example:    
 
907
        bzr init-repo repo
 
908
        bzr init --format=metadir repo/trunk
 
909
        cd repo/trunk
 
910
        (add files here)
 
911
    """
901
912
    takes_args = ["location"] 
902
913
    takes_options = [Option('format', 
903
914
                            help='Use a specific format rather than the'
915
926
        from bzrlib.transport import get_transport
916
927
        if format is None:
917
928
            format = BzrDirMetaFormat1()
918
 
        get_transport(location).mkdir('')
919
 
        newdir = format.initialize(location)
 
929
        transport = get_transport(location)
 
930
        if not transport.has('.'):
 
931
            transport.mkdir('')
 
932
        newdir = format.initialize_on_transport(transport)
920
933
        repo = newdir.create_repository(shared=True)
921
934
        repo.set_make_working_trees(trees)
922
935