~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Martin Pool
  • Date: 2006-04-19 07:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 1675.
  • Revision ID: mbp@sourcefrog.net-20060419071605-51207e739c997442
Give a clear error for bzr status of an unversioned, nonexistent file. (Malone #3619)

Show diffs side-by-side

added added

removed removed

Lines of Context:
313
313
 
314
314
def _raise_if_doubly_unversioned(specific_files, old_tree, new_tree):
315
315
    """Complain if paths are not versioned in either tree."""
316
 
    if not specific_files:
 
316
    if len(specific_files) == 0:
317
317
        return
318
318
    old_unversioned = old_tree.filter_unversioned_files(specific_files)
319
319
    new_unversioned = new_tree.filter_unversioned_files(specific_files)
322
322
        raise errors.PathsNotVersionedError(sorted(unversioned))
323
323
    
324
324
 
 
325
def _raise_if_nonexistent(paths, old_tree, new_tree):
 
326
    """Complain if paths are not in either inventory or tree.
 
327
 
 
328
    It's OK with the files exist in either tree's inventory, or 
 
329
    if they exist in the tree but are not versioned.
 
330
    
 
331
    This can be used by operations such as bzr status that can accept
 
332
    unknown or ignored files.
 
333
    """
 
334
    mutter("check paths: %r", paths)
 
335
    if not paths:
 
336
        return
 
337
    s = old_tree.filter_unversioned_files(paths)
 
338
    s = new_tree.filter_unversioned_files(s)
 
339
    s = [path for path in s if not new_tree.has_filename(path)]
 
340
    if s:
 
341
        raise errors.PathsDoNotExist(sorted(s))
 
342
 
 
343
 
325
344
def get_prop_change(meta_modified):
326
345
    if meta_modified:
327
346
        return " (properties changed)"