def get_rev_label_from_changeset_revision(repo, changeset_revision, include_date=True, include_hash=True):
 ctx = get_changectx_for_changeset(repo, changeset_revision)
 if ctx:
  rev = ('%04d' % ctx.rev())
  label = get_revision_label_from_ctx(ctx, include_date=include_date)
 else:
  rev = '-1'
  label = ('-1:%s' % changeset_revision)
 return (rev, label)

def get_rev_label_from_changeset_revision ( repo , changeset_revision , include_date = True , include_hash = True ) : ctx = get_changectx_for_changeset ( repo , changeset_revision ) if ctx : rev = ( '%04d' % ctx . rev ( ) ) label = get_revision_label_from_ctx ( ctx , include_date = include_date ) else : rev = '-1' label = ( '-1:%s' % changeset_revision ) return ( rev , label )
given a changeset revision hash .