def get_file_context_from_ctx(ctx, filename):
 deleted = False
 filename = basic_util.strip_path(filename)
 for ctx_file in ctx.files():
  ctx_file_name = basic_util.strip_path(ctx_file)
  if (filename == ctx_file_name):
   try:
    fctx = ctx[ctx_file]
    return fctx
   except LookupError:
    deleted = True
 if deleted:
  return 'DELETED'
 return None

def get_file_context_from_ctx ( ctx , filename ) : deleted = False filename = basic_util . strip_path ( filename ) for ctx_file in ctx . files ( ) : ctx_file_name = basic_util . strip_path ( ctx_file ) if ( filename == ctx_file_name ) : try : fctx = ctx [ ctx_file ] return fctx except LookupError : deleted = True if deleted : return 'DELETED' return None
return the mercurial file context for a specified file .