Mercurial > hg
comparison hgext/mq.py @ 14943:d3bb825ddae3
globally: use safehasattr(x, '__call__') instead of hasattr(x, '__call__')
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Mon, 25 Jul 2011 16:24:37 -0500 |
parents | e9ed3506f066 |
children | 3709cca378ff |
comparison
equal
deleted
inserted
replaced
14942:5b072d4b62f2 | 14943:d3bb825ddae3 |
---|---|
936 + hex(repo[None].p1().node()) + "\n") | 936 + hex(repo[None].p1().node()) + "\n") |
937 if user: | 937 if user: |
938 p.write("# User " + user + "\n") | 938 p.write("# User " + user + "\n") |
939 if date: | 939 if date: |
940 p.write("# Date %s %s\n\n" % date) | 940 p.write("# Date %s %s\n\n" % date) |
941 if hasattr(msg, '__call__'): | 941 if util.safehasattr(msg, '__call__'): |
942 msg = msg() | 942 msg = msg() |
943 commitmsg = msg and msg or ("[mq]: %s" % patchfn) | 943 commitmsg = msg and msg or ("[mq]: %s" % patchfn) |
944 n = repo.commit(commitmsg, user, date, match=match, force=True) | 944 n = repo.commit(commitmsg, user, date, match=match, force=True) |
945 if n is None: | 945 if n is None: |
946 raise util.Abort(_("repo commit failed")) | 946 raise util.Abort(_("repo commit failed")) |