~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

[patch] 'bzr init DIR' (John)

Show diffs side-by-side

added added

removed removed

Lines of Context:
594
594
        bzr status
595
595
        bzr commit -m 'imported project'
596
596
    """
597
 
    def run(self):
598
 
        Branch.initialize('.')
 
597
    takes_args = ['location?']
 
598
    def run(self, location=None):
 
599
        from bzrlib.branch import Branch
 
600
        if location is None:
 
601
            location = '.'
 
602
        else:
 
603
            # The path has to exist to initialize a
 
604
            # branch inside of it.
 
605
            # Just using os.mkdir, since I don't
 
606
            # believe that we want to create a bunch of
 
607
            # locations if the user supplies an extended path
 
608
            if not os.path.exists(location):
 
609
                os.mkdir(location)
 
610
        Branch.initialize(location)
599
611
 
600
612
 
601
613
class cmd_diff(Command):