Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

commit: use username from command line, then user combo box

Changeset 7c16e57ec305

Parent 9ef223aa496d

by Steve Borho

Changes to one file · Browse files at 7c16e57ec305 Showing diff from parent 9ef223aa496d Diff from another changeset...

 
23
24
25
26
27
28
29
 
30
31
32
 
56
57
58
 
59
60
 
 
 
 
 
 
 
 
 
61
62
63
 
187
188
189
 
 
 
 
 
 
 
 
 
 
 
190
191
192
 
209
210
211
212
 
213
214
215
 
23
24
25
 
26
27
 
28
29
30
31
 
55
56
57
58
59
 
60
61
62
63
64
65
66
67
68
69
70
71
 
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
 
228
229
230
 
231
232
233
234
@@ -23,10 +23,9 @@
 # qctlib decode failure dialog (ask for retry locale, suggest HGENCODING)  # add rollback function with prompt  # +1 / -1 head indication (not as important with workbench integration) -# hook up username from command line to username combo  # recent committers history  # pushafterci, autoincludes list -# use username and date options +# use date option  # implement a branchop dialog (in another file)  # qnew/shelve-patch creation dialog (in another file)  # reflow / auto-wrap / message format checks / paste filenames @@ -56,8 +55,17 @@
  self.setLayout(layout)   form = QFormLayout()   form.setContentsMargins(3, 9, 9, 0) +   usercombo = QComboBox() - usercombo.addItem(hglib.tounicode(self.stwidget.repo[None].user())) + try: + if opts.get('user'): + usercombo.addItem(hglib.tounicode(opts['user'])) + usercombo.addItem(hglib.tounicode(self.stwidget.repo[None].user())) + except util.Abort: + import socket + user = '%s@%s' % (util.getuser(), socket.getfqdn()) + usercombo.addItem(hglib.tounicode(user)) +   usercombo.setEditable(True)   form.addRow(_('Changeset:'), QLabel(_('Working Copy')))   form.addRow(_('User:'), usercombo) @@ -187,6 +195,17 @@
  parent=self)   self.stwidget.tv.setFocus()   return + user = self.usercombo.currentText() + try: + user = hglib.fromunicode(user, 'strict') + except UnicodeEncodeError: + pass # TODO + if not user: + qtlib.WarningMsgBox(_('Username required'), + _('Please enter a username'), + parent=self) + self.usercombo.setFocus() + return   checkedUnknowns = self.stwidget.getChecked('?I')   if checkedUnknowns:   res = qtlib.CustomPrompt( @@ -209,7 +228,7 @@
  dispatch._dispatch(ui, ['remove'] + checkedMissing)   else:   return - cmdline = ['commit', '--message', msg] + files + cmdline = ['commit', '--user', user, '--message', msg] + files   ret = dispatch._dispatch(ui, cmdline)   if not ret:   self.addMessageToHistory()