Angel Ezquerra  committed 9ee1af0

commit: automatically set 'close branch' commit message

If the commit message is empty, when the user opens the "branchop" dialog and
selects "Close current branch", automatically set the commit message to:

Close BRANCH_NAME branch

where BRANCH_NAME is the current branch name.
The 'tortoisehg.engmsg' setting is respected. If set to False (or not set) the
commit message will be translated. Otherwise the message will be in English.

  • Participants
  • Parent commits 6d36a8c
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/

 from tortoisehg.hgqt.i18n import _
 from tortoisehg.hgqt.messageentry import MessageEntry
 from tortoisehg.hgqt import qtlib, qscilib, status, cmdui, branchop, revpanel
-from tortoisehg.hgqt import hgrcutil, mq, lfprompt
+from tortoisehg.hgqt import hgrcutil, mq, lfprompt, i18n
 from tortoisehg.util.hgversion import hgversion
 from PyQt4.QtCore import *
         if d.exec_() == QDialog.Accepted:
             self.branchop = d.branchop
+            if self.branchop is False:
+                if not self.getMessage(True).strip():
+                    engmsg = self.repo.ui.configbool(
+                        'tortoisehg', 'engmsg', False)
+                    msgset = i18n.keepgettext()._('Close %s branch')
+                    text = engmsg and msgset['id'] or msgset['str']
+                    self.setMessage(unicode(text) %
+                                    hglib.tounicode(self.repo[None].branch()))
     def canUndo(self):