~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: mbp at sourcefrog
  • Date: 2005-04-04 13:10:26 UTC
  • Revision ID: mbp@sourcefrog.net-20050404131026-628553cc03687658
new 'renames' command

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
 
204
204
 
205
205
 
 
206
def cmd_renames(dir='.'):
 
207
    """Show list of renamed files.
 
208
 
 
209
usage: bzr renames [BRANCH]
 
210
 
 
211
TODO: Option to show renames between two historical versions.
 
212
 
 
213
TODO: Only show renames under dir, rather than in the whole branch.
 
214
"""
 
215
    b = Branch(dir)
 
216
    old_inv = b.basis_tree().inventory
 
217
    new_inv = b.read_working_inventory()
 
218
    
 
219
    renames = list(bzrlib.tree.find_renames(old_inv, new_inv))
 
220
    renames.sort()
 
221
    for old_name, new_name in renames:
 
222
        print "%s => %s" % (old_name, new_name)        
 
223
 
 
224
 
 
225
 
206
226
def cmd_info():
207
227
    """info: Show statistical information for this branch
208
228
 
708
728
    'mv':                     ['source$', 'dest'],
709
729
    'relpath':                ['filename'],
710
730
    'remove':                 ['file+'],
 
731
    'renames':                ['dir?'],
711
732
    'root':                   ['filename?'],
712
733
    'status':                 [],
713
734
    }