Mercurial > hg
changeset 16057:db4b0532dbf2
mq: rename secretcommit to newcommit
This function create secret changeset only when mq.secret is true
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Mon, 30 Jan 2012 00:05:28 +0100 |
parents | 66f1647f65d1 |
children | f5b6046f6ce8 |
files | hgext/mq.py |
diffstat | 1 files changed, 8 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/mq.py Wed Feb 01 16:28:35 2012 -0600 +++ b/hgext/mq.py Mon Jan 30 00:05:28 2012 +0100 @@ -257,10 +257,11 @@ ci += 1 del self.comments[ci] -def secretcommit(repo, *args, **kwargs): - """helper dedicated to ensure a commit are secret - - It should be used instead of repo.commit inside the mq source +def newcommit(repo, *args, **kwargs): + """helper dedicated to ensure a commit respect mq.secret setting + + It should be used instead of repo.commit inside the mq source for operation + creating new changeset. """ if not repo.ui.configbool('mq', 'secret', False): return repo.commit(*args, **kwargs) @@ -575,7 +576,7 @@ ret = hg.merge(repo, rev) if ret: raise util.Abort(_("update returned %d") % ret) - n = secretcommit(repo, ctx.description(), ctx.user(), force=True) + n = newcommit(repo, ctx.description(), ctx.user(), force=True) if n is None: raise util.Abort(_("repo commit failed")) try: @@ -746,7 +747,7 @@ match = scmutil.matchfiles(repo, files or []) oldtip = repo['tip'] - n = secretcommit(repo, message, ph.user, ph.date, match=match, + n = newcommit(repo, message, ph.user, ph.date, match=match, force=True) if repo['tip'] == oldtip: raise util.Abort(_("qpush exactly duplicates child changeset")) @@ -987,7 +988,7 @@ if util.safehasattr(msg, '__call__'): msg = msg() commitmsg = msg and msg or ("[mq]: %s" % patchfn) - n = secretcommit(repo, commitmsg, user, date, match=match, + n = newcommit(repo, commitmsg, user, date, match=match, force=True) if n is None: raise util.Abort(_("repo commit failed"))