~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-03-22 11:43:02 UTC
  • Revision ID: mbp@sourcefrog.net-20050322114302-3bcffcfce1de3cc7
handle add, remove, file-id being given filenames that are
not relative to branch root

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
    """
173
173
    assert file_list
174
174
    b = Branch(file_list[0], find_root=True)
175
 
    b.add(file_list, verbose=verbose)
 
175
    b.add([b.relpath(f) for f in file_list], verbose=verbose)
176
176
 
177
177
 
178
178
def cmd_relpath(filename):
249
249
 
250
250
 
251
251
def cmd_remove(file_list, verbose=False):
252
 
    Branch('.').remove(file_list, verbose=verbose)
 
252
    b = Branch(file_list[0])
 
253
    b.remove([b.relpath(f) for f in file_list], verbose=verbose)
253
254
 
254
255
 
255
256
 
256
257
def cmd_file_id(filename):
257
 
    i = Branch('.').read_working_inventory().path2id(filename)
 
258
    b = Branch(filename)
 
259
    i = b.inventory.path2id(b.relpath(filename))
258
260
    if i is None:
259
261
        bailout("%s is not a versioned file" % filename)
260
262
    else: