Mercurial > hgsubversion
diff util.py @ 186:6266ba36ee15
Create patch to make normal output much less verboseā¦
author | Dan Villiom Podlaski Christiansen <danchr@cs.au.dk> |
---|---|
date | Sat, 17 Jan 2009 15:30:38 -0600 |
parents | 57355b0e7bd1 |
children | 6e3f99ba47ec |
line wrap: on
line diff
--- a/util.py +++ b/util.py @@ -109,3 +109,16 @@ def build_extra(revnum, branch, uuid, su def is_svn_repo(repo): return os.path.exists(os.path.join(repo.path, 'svn')) + +default_commit_msg = '*** empty log message ***' + +def describe_revision(r): + try: + msg = [s for s in map(str.strip, r.message.splitlines()) if s][0] + except: + msg = default_commit_msg + + return ('[r%d] %s: %s' % (r.revnum, r.author, msg))[:80] + '\n' + +def describe_commit(h, b): + return ' committed to "%s" as %s\n' % ((b or 'default'), node.short(h))