~vexo/bzr/gpg_verify_download_missing

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2005-11-27 22:38:34 UTC
  • mfrom: (1185.33.36 bzr.dev)
  • Revision ID: robertc@robertcollins.net-20051127223834-d00ecca0d0b9384a
Merge from mpool, adjusting check to retain HTTP support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    try:
42
42
        return inner_branch_files(file_list, default_branch)
43
43
    except FileInWrongBranch, e:
44
 
        print file_list
45
44
        raise BzrCommandError("%s is not in the same branch as %s" %
46
45
                             (e.path, file_list[0]))
47
46
 
260
259
 
261
260
 
262
261
class cmd_inventory(Command):
263
 
    """Show inventory of the current working copy or a revision."""
264
 
    takes_options = ['revision', 'show-ids']
 
262
    """Show inventory of the current working copy or a revision.
 
263
 
 
264
    It is possible to limit the output to a particular entry
 
265
    type using the --kind option.  For example; --kind file.
 
266
    """
 
267
    takes_options = ['revision', 'show-ids', 'kind']
265
268
    
266
269
    @display_command
267
 
    def run(self, revision=None, show_ids=False):
 
270
    def run(self, revision=None, show_ids=False, kind=None):
 
271
        if kind and kind not in ['file', 'directory', 'symlink']:
 
272
            raise BzrCommandError('invalid kind specified')
268
273
        b = Branch.open_containing('.')[0]
269
274
        if revision is None:
270
275
            inv = b.working_tree().read_working_inventory()
275
280
            inv = b.get_revision_inventory(revision[0].in_history(b).rev_id)
276
281
 
277
282
        for path, entry in inv.entries():
 
283
            if kind and kind != entry.kind:
 
284
                continue
278
285
            if show_ids:
279
286
                print '%-50s %s' % (path, entry.file_id)
280
287
            else:
671
678
            print revision_id
672
679
 
673
680
 
674
 
class cmd_directories(Command):
675
 
    """Display list of versioned directories in this branch."""
676
 
    @display_command
677
 
    def run(self):
678
 
        for name, ie in (Branch.open_containing('.')[0].working_tree().
679
 
                         read_working_inventory().directories()):
680
 
            if name == '':
681
 
                print '.'
682
 
            else:
683
 
                print name
684
 
 
685
 
 
686
681
class cmd_init(Command):
687
682
    """Make a directory into a versioned branch.
688
683