##// END OF EJS Templates
mq: rename secretcommit to newcommit...
Pierre-Yves David -
r16057:db4b0532 default
parent child Browse files
Show More
@@ -257,10 +257,11 b' class patchheader(object):'
257 ci += 1
257 ci += 1
258 del self.comments[ci]
258 del self.comments[ci]
259
259
260 def secretcommit(repo, *args, **kwargs):
260 def newcommit(repo, *args, **kwargs):
261 """helper dedicated to ensure a commit are secret
261 """helper dedicated to ensure a commit respect mq.secret setting
262
262
263 It should be used instead of repo.commit inside the mq source
263 It should be used instead of repo.commit inside the mq source for operation
264 creating new changeset.
264 """
265 """
265 if not repo.ui.configbool('mq', 'secret', False):
266 if not repo.ui.configbool('mq', 'secret', False):
266 return repo.commit(*args, **kwargs)
267 return repo.commit(*args, **kwargs)
@@ -575,7 +576,7 b' class queue(object):'
575 ret = hg.merge(repo, rev)
576 ret = hg.merge(repo, rev)
576 if ret:
577 if ret:
577 raise util.Abort(_("update returned %d") % ret)
578 raise util.Abort(_("update returned %d") % ret)
578 n = secretcommit(repo, ctx.description(), ctx.user(), force=True)
579 n = newcommit(repo, ctx.description(), ctx.user(), force=True)
579 if n is None:
580 if n is None:
580 raise util.Abort(_("repo commit failed"))
581 raise util.Abort(_("repo commit failed"))
581 try:
582 try:
@@ -746,7 +747,7 b' class queue(object):'
746
747
747 match = scmutil.matchfiles(repo, files or [])
748 match = scmutil.matchfiles(repo, files or [])
748 oldtip = repo['tip']
749 oldtip = repo['tip']
749 n = secretcommit(repo, message, ph.user, ph.date, match=match,
750 n = newcommit(repo, message, ph.user, ph.date, match=match,
750 force=True)
751 force=True)
751 if repo['tip'] == oldtip:
752 if repo['tip'] == oldtip:
752 raise util.Abort(_("qpush exactly duplicates child changeset"))
753 raise util.Abort(_("qpush exactly duplicates child changeset"))
@@ -987,7 +988,7 b' class queue(object):'
987 if util.safehasattr(msg, '__call__'):
988 if util.safehasattr(msg, '__call__'):
988 msg = msg()
989 msg = msg()
989 commitmsg = msg and msg or ("[mq]: %s" % patchfn)
990 commitmsg = msg and msg or ("[mq]: %s" % patchfn)
990 n = secretcommit(repo, commitmsg, user, date, match=match,
991 n = newcommit(repo, commitmsg, user, date, match=match,
991 force=True)
992 force=True)
992 if n is None:
993 if n is None:
993 raise util.Abort(_("repo commit failed"))
994 raise util.Abort(_("repo commit failed"))
General Comments 0
You need to be logged in to leave comments. Login now