~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-06-22 07:18:01 UTC
  • Revision ID: mbp@sourcefrog.net-20050622071801-916bbae5bd93cf0a
- new mkdir command

Show diffs side-by-side

added added

removed removed

Lines of Context:
363
363
        bzrlib.add.smart_add(file_list, verbose, not no_recurse)
364
364
 
365
365
 
 
366
 
 
367
class cmd_mkdir(Command):
 
368
    """Create a new versioned directory.
 
369
 
 
370
    This is equivalent to creating the directory and then adding it.
 
371
    """
 
372
    takes_args = ['dir+']
 
373
 
 
374
    def run(self, dir_list):
 
375
        import os
 
376
        import bzrlib.branch
 
377
        
 
378
        b = None
 
379
        
 
380
        for d in dir_list:
 
381
            os.mkdir(d)
 
382
            if not b:
 
383
                b = bzrlib.branch.Branch(d)
 
384
            b.add([d], verbose=True)
 
385
 
 
386
 
366
387
class cmd_relpath(Command):
367
388
    """Show path of a file relative to root"""
368
389
    takes_args = ['filename']