Commits

Anonymous 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.

Comments (0)

Files changed (1)

tortoisehg/hgqt/commit.py

 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 *
         d.setWindowModality(Qt.WindowModal)
         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()))
             self.refresh()
 
     def canUndo(self):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.