Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

fogcreek Merge with stable

Changeset 5a6f30401e32

Parents 1943afdd5692

Parents f0b9c6867bc8

by David Golub

Changes to 18 files · Browse files at 5a6f30401e32 Showing diff from parent 1943afdd5692 f0b9c6867bc8 Diff from another changeset...

Change 1 of 1 Show Entire File .hgtags Stacked
 
57
58
59
 
 
57
58
59
60
@@ -57,3 +57,4 @@
 26a8187ef879c83c2055044fa2080a640145d542 2.0.4  f2165388e6870c643636a0a74f1ebd1d008bdf3e 2.0.5  2a970d5e40fe4f757347464d820218809d58251b 2.1 +65a385cf4238af969487dc1a7a2b5ee60cf388cc 2.1.1
 
8
9
10
11
 
12
13
14
15
16
17
18
19
 
 
20
21
22
 
1530
1531
1532
1533
 
1534
1535
1536
1537
 
1538
1539
1540
1541
 
1542
1543
1544
 
2476
2477
2478
2479
 
2480
2481
2482
 
2485
2486
2487
2488
 
2489
2490
2491
 
3238
3239
3240
3241
 
3242
3243
3244
 
3537
3538
3539
3540
 
3541
3542
3543
 
5267
5268
5269
5270
 
5271
5272
5273
 
5413
5414
5415
5416
 
5417
5418
5419
 
5652
5653
5654
5655
 
5656
5657
5658
5659
5660
5661
 
 
5662
5663
5664
 
5666
5667
5668
 
 
 
 
5669
5670
5671
 
6674
6675
6676
6677
6678
 
6679
6680
6681
 
7784
7785
7786
7787
 
7788
7789
7790
 
7821
7822
7823
7824
 
7825
7826
7827
 
12745
12746
12747
12748
 
12749
12750
12751
12752
 
12753
12754
12755
12756
 
12757
12758
12759
 
12795
12796
12797
12798
 
12799
12800
12801
 
12803
12804
12805
12806
 
12807
12808
12809
 
8
9
10
 
11
12
13
14
15
16
17
 
 
18
19
20
21
22
 
1530
1531
1532
 
1533
1534
1535
1536
 
1537
1538
1539
1540
 
1541
1542
1543
1544
 
2476
2477
2478
 
2479
2480
2481
2482
 
2485
2486
2487
 
2488
2489
2490
2491
 
3238
3239
3240
 
3241
3242
3243
3244
 
3537
3538
3539
 
3540
3541
3542
3543
 
5267
5268
5269
 
5270
5271
5272
5273
 
5413
5414
5415
 
5416
5417
5418
5419
 
5652
5653
5654
 
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
 
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
 
6680
6681
6682
 
 
6683
6684
6685
6686
 
7789
7790
7791
 
7792
7793
7794
7795
 
7826
7827
7828
 
7829
7830
7831
7832
 
12750
12751
12752
 
12753
12754
12755
12756
 
12757
12758
12759
12760
 
12761
12762
12763
12764
 
12800
12801
12802
 
12803
12804
12805
12806
 
12808
12809
12810
 
12811
12812
12813
12814
@@ -8,15 +8,15 @@
 "Project-Id-Version: tortoisehg\n"  "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"  "POT-Creation-Date: 2011-07-01 16:15-0300\n" -"PO-Revision-Date: 2011-06-28 15:36+0000\n" +"PO-Revision-Date: 2011-07-05 21:33+0000\n"  "Last-Translator: Karsten Tinnefeld <Unknown>\n"  "Language-Team: German <de@li.org>\n"  "MIME-Version: 1.0\n"  "Content-Type: text/plain; charset=UTF-8\n"  "Content-Transfer-Encoding: 8bit\n"  "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2011-07-01 19:36+0000\n" -"X-Generator: Launchpad (build 13333)\n" +"X-Launchpad-Export-Date: 2011-07-06 04:43+0000\n" +"X-Generator: Launchpad (build 13168)\n"    #: TortoiseHgOverlayServer.py:51  msgid "TortoiseHg Overlay Icon Server" @@ -1530,15 +1530,15 @@
   #: tortoisehg/hgqt/filedialogs.py:210 tortoisehg/hgqt/filedialogs.py:686  msgid "View at revision..." -msgstr "" +msgstr "Anzeigen der Revision..."    #: tortoisehg/hgqt/filedialogs.py:213 tortoisehg/hgqt/filedialogs.py:689  msgid "Edit local" -msgstr "" +msgstr "Lokale Version bearbeiten"    #: tortoisehg/hgqt/filedialogs.py:216 tortoisehg/hgqt/filedialogs.py:692  msgid "Revert to revision..." -msgstr "" +msgstr "Zurückrollen zur Revision..."    #: tortoisehg/hgqt/filedialogs.py:363  msgid "File Differences Log Columns" @@ -2476,7 +2476,7 @@
 #: tortoisehg/hgqt/mq.py:114  msgctxt "MQ QPush"  msgid "Push all" -msgstr "" +msgstr "Alle verteilen"    #: tortoisehg/hgqt/mq.py:115 tortoisehg/hgtk/thgmq.py:125  msgid "Apply all patches" @@ -2485,7 +2485,7 @@
 #: tortoisehg/hgqt/mq.py:117  msgctxt "MQ QPush"  msgid "Push" -msgstr "" +msgstr "Verteilen"    #: tortoisehg/hgqt/mq.py:118  msgid "Apply one patch" @@ -3238,7 +3238,7 @@
   #: tortoisehg/hgqt/quickop.py:78 tortoisehg/hgtk/quickop.py:133  msgid "Do not save backup files (*.orig)" -msgstr "Sicherheitskopien (*.orig) nicht speichern" +msgstr "Sicherungskopien (*.orig) nicht speichern"    #: tortoisehg/hgqt/quickop.py:134 tortoisehg/hgtk/quickop.py:261  msgid "No files selected" @@ -3537,7 +3537,7 @@
   #: tortoisehg/hgqt/repofilter.py:209  msgid "Display only active branches" -msgstr "" +msgstr "Nur aktive Zweige anzeigen"    #: tortoisehg/hgqt/repofilter.py:212  msgid "Display closed branches" @@ -5267,7 +5267,7 @@
   #: tortoisehg/hgqt/run.py:1070 tortoisehg/hgqt/run.py:1101  msgid "discard uncommitted changes (no backup)" -msgstr "Nicht übernommene Änderungen (ohne Kopie) verwerfen" +msgstr "Nicht übernommene Änderungen (ungesichert) verwerfen"    #: tortoisehg/hgqt/run.py:1071  msgid "do not back up stripped revisions" @@ -5413,7 +5413,7 @@
   #: tortoisehg/hgqt/rupdate.py:61  msgid "Discard remote changes, no backup (-C/--clean)" -msgstr "" +msgstr "Entfernte Änderungen ungesichert verwerfen (-C/--clean)"    #: tortoisehg/hgqt/rupdate.py:63  msgid "Perform a push before updating (-p/--push)" @@ -5652,13 +5652,15 @@
   #: tortoisehg/hgqt/settings.py:413  msgid "Default widget" -msgstr "" +msgstr "Vorgabebereich"    #: tortoisehg/hgqt/settings.py:415  msgid ""  "Select the initial widget that will be shown when opening a repository. "  "Default: revdetails"  msgstr "" +"Wählen SIe den Bereich, der standardmäßig beim Öffnen eines Projektarchivs " +"angezeigt werden soll. Vorgabe: revdetails"    #: tortoisehg/hgqt/settings.py:420  msgid "" @@ -5666,6 +5668,10 @@
 " You can select the \"current\" (i.e. the working directory parent), the "  "current \"tip\" or the working directory (\"workingdir\"). Default: current"  msgstr "" +"Wählen Sie die Revision, die standardmäßig beim Öffnen eines Projektarchivs " +"ausgewählt werden soll. Sie können die aktuelle wählen (current, bezeichnet " +"den Vorgänger der Arbeitskopie), die Spitze des Archivs (tip) oder die " +"Arbeitskopieversion (workingdir). Vorgabe: current"    #: tortoisehg/hgqt/settings.py:424 tortoisehg/hgtk/thgconfig.py:130  msgid "Author Coloring" @@ -6674,8 +6680,7 @@
   #: tortoisehg/hgqt/shelve.py:186  msgid "Backup copies of modified files can be found in .hg/Trashcan/" -msgstr "" -"Sicherheitskopien der geänderten Dateien finden sich in .hg/Trashcan/" +msgstr "Sicherungskopien der geänderten Dateien finden sich in .hg/Trashcan/"    #: tortoisehg/hgqt/shelve.py:192  #, python-format @@ -7784,7 +7789,7 @@
   #: tortoisehg/hgqt/update.py:94 tortoisehg/hgtk/update.py:98  msgid "Discard local changes, no backup (-C/--clean)" -msgstr "Lokale Änderungen ohne Sicherung abräumen (-C/--clean)" +msgstr "Lokale Änderungen ungesichert abräumen (-C/--clean)"    #: tortoisehg/hgqt/update.py:96 tortoisehg/hgtk/update.py:104  msgid "Always merge (when possible)" @@ -7821,7 +7826,7 @@
   #: tortoisehg/hgqt/update.py:249 tortoisehg/hgtk/update.py:234  msgid "Discard - discard local changes, no backup" -msgstr "Verwerfen - lokale Änderungen ungesichert vewerfen" +msgstr "Verwerfen - lokale Änderungen ungesichert verwerfen"    #: tortoisehg/hgqt/update.py:250 tortoisehg/hgtk/update.py:235  msgid "&Shelve" @@ -12745,15 +12750,15 @@
 #: tortoisehg/util/hgshelve.py:433  #, python-format  msgid "removing backup file : %r\n" -msgstr "Entferne Sicherungsdatei: %r\n" +msgstr "Entferne Sicherungskopie: %r\n"    #: tortoisehg/util/hgshelve.py:437  msgid "delete of shelve backup failed" -msgstr "Entfernen des Stauraum-Kopie gescheitert" +msgstr "Entfernen des Stauraum-Sicherung gescheitert"    #: tortoisehg/util/hgshelve.py:440  msgid "bad shelve backup directory name" -msgstr "Name des Stauraum-Sicherungsverzeichnis ungeeignet" +msgstr "Verzeichnisname für die Stauraum-Sicherung ungeeignet"    #: tortoisehg/util/hgshelve.py:470  msgid "shelve can only be run interactively" @@ -12795,7 +12800,7 @@
   #: tortoisehg/util/hgshelve.py:593  msgid "unshelve backup aborted\n" -msgstr "Kopieren des Stauraums abgebrochen\n" +msgstr "Sicherung des Stauraums abgebrochen\n"    #: tortoisehg/util/hgshelve.py:597  msgid "applying shelved patch\n" @@ -12803,7 +12808,7 @@
   #: tortoisehg/util/hgshelve.py:610  msgid "restoring backup files\n" -msgstr "Sicherungskopien widerherstellen\n" +msgstr "stelle Dateien aus der Sicherung wieder her\n"    #: tortoisehg/util/hgshelve.py:619  msgid "removing shelved patches\n"
 
8
9
10
11
12
 
 
13
14
15
16
17
18
19
 
 
20
21
22
 
194
195
196
197
 
198
199
200
 
370
371
372
373
 
374
375
376
 
8
9
10
 
 
11
12
13
14
15
16
17
 
 
18
19
20
21
22
 
194
195
196
 
197
198
199
200
 
370
371
372
 
373
374
375
376
@@ -8,15 +8,15 @@
 "Project-Id-Version: tortoisehg\n"  "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"  "POT-Creation-Date: 2011-07-01 16:15-0300\n" -"PO-Revision-Date: 2011-03-01 23:06+0000\n" -"Last-Translator: Tim <Unknown>\n" +"PO-Revision-Date: 2011-07-04 19:24+0000\n" +"Last-Translator: Tonnis Oosterhoff <Unknown>\n"  "Language-Team: Dutch <nl@li.org>\n"  "MIME-Version: 1.0\n"  "Content-Type: text/plain; charset=UTF-8\n"  "Content-Transfer-Encoding: 8bit\n"  "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2011-07-01 19:37+0000\n" -"X-Generator: Launchpad (build 13333)\n" +"X-Launchpad-Export-Date: 2011-07-05 04:35+0000\n" +"X-Generator: Launchpad (build 13168)\n"    #: TortoiseHgOverlayServer.py:51  msgid "TortoiseHg Overlay Icon Server" @@ -194,7 +194,7 @@
   #: tortoisehg/hgqt/archive.py:238 tortoisehg/hgqt/archive.py:241  msgid "Zip archives" -msgstr "" +msgstr "Zip archieven"    #: tortoisehg/hgqt/archive.py:316 tortoisehg/hgqt/archive.py:334  msgid "Duplicate Name" @@ -370,7 +370,7 @@
   #: tortoisehg/hgqt/backout.py:412 tortoisehg/hgqt/merge.py:489  msgid "Working Directory (merged)" -msgstr "" +msgstr "Werkmap (samengevoegd)"    #: tortoisehg/hgqt/backout.py:420 tortoisehg/hgqt/merge.py:497  msgid "Commit message"
Change 1 of 1 Show Entire File thg Stacked
 
77
78
79
 
 
80
81
82
 
77
78
79
80
81
82
83
84
@@ -77,6 +77,8 @@
  mystderr = cStringIO.StringIO()   origstderr = sys.stderr   sys.stderr = mystderr + sys.__stdout__ = sys.stdout + sys.__stderr__ = sys.stderr   ret = 0   try:   ret = tortoisehg.hgqt.run.dispatch(sys.argv[1:])
 
141
142
143
144
 
145
146
147
 
163
164
165
 
166
167
168
 
184
185
186
187
 
188
189
190
191
192
193
194
 
195
196
197
198
199
200
201
202
203
 
 
204
205
206
 
250
251
252
253
 
254
255
256
 
266
267
268
269
 
270
271
272
 
277
278
279
280
 
281
282
283
 
284
285
286
287
288
 
289
290
291
 
302
303
304
305
306
 
 
307
308
309
310
311
312
 
313
314
315
316
317
318
 
319
320
321
 
333
334
335
336
 
337
338
339
340
 
341
342
343
 
352
353
354
355
 
356
357
358
 
141
142
143
 
144
145
146
147
 
163
164
165
166
167
168
169
 
185
186
187
 
188
189
190
191
192
193
194
 
195
196
 
197
198
199
200
 
 
 
201
202
203
204
205
 
249
250
251
 
252
253
254
255
 
265
266
267
 
268
269
270
271
 
276
277
278
 
279
280
281
 
282
283
284
285
286
 
287
288
289
290
 
301
302
303
 
 
304
305
306
307
308
309
310
 
311
312
313
314
315
316
 
317
318
319
320
 
332
333
334
 
335
336
337
338
 
339
340
341
342
 
351
352
353
 
354
355
356
357
@@ -141,7 +141,7 @@
  self.rev_combo.setMaxVisibleItems(self.rev_combo.count())   self.rev_combo.setCurrentIndex(0)   self.subrepos_chk.setChecked(self.get_subrepos_present()) - self.dest_edit.setText(self.repo.root) + self.dest_edit.setText(hglib.tounicode(self.repo.root))   self.filesradio.setChecked(True)   self.update_path()   @@ -163,6 +163,7 @@
  self.arch_btn.clicked.connect(self.archive)   self.detail_btn.clicked.connect(self.detail_clicked)   self.close_btn.clicked.connect(self.close) + self.cancel_btn.clicked.connect(self.cancel_clicked)     # dialog setting   self.setWindowTitle(_('Archive - %s') % self.repo.displayname) @@ -184,23 +185,21 @@
    def browse_clicked(self):   """Select the destination directory or file""" - dest = hglib.fromunicode(self.dest_edit.text()) + dest = unicode(self.dest_edit.text())   if not os.path.exists(dest):   dest = os.path.dirname(dest)   select = self.get_selected_archive_type()   FD = QFileDialog   if select['type'] == 'files':   caption = _('Select Destination Folder') - path = FD.getExistingDirectory(parent=self, caption=caption, + response = FD.getExistingDirectory(parent=self, caption=caption,   directory=dest, options=FD.ShowDirsOnly | FD.ReadOnly) - response = str(path)   else:   caption = _('Open File')   ext = '*' + select['ext']   filter = '%s (%s)\nAll Files (*.*)' % (select['label'], ext) - filename = FD.getOpenFileName(parent=self, caption=caption, - directory=dest, filter=filter, options=FD.ReadOnly ); - response = str(filename) + response = FD.getOpenFileName(parent=self, caption=caption, + directory=dest, filter=filter, options=FD.ReadOnly)   if response:   self.dest_edit.setText(response)   self.update_path() @@ -250,7 +249,7 @@
  def remove_rev(path):   l = ''   for i in xrange(self.rev_combo.count() - 1): - l += hglib.fromunicode(self.rev_combo.itemText(i)) + l += unicode(self.rev_combo.itemText(i))   revs = [rev[0] for rev in l]   revs.append(wdrev)   if not self.prevtarget is None: @@ -266,7 +265,7 @@
  if select['type'] != 'files':   path += select['ext']   return path - text = self.rev_combo.currentText() + text = unicode(self.rev_combo.currentText())   if len(text) == 0:   return   wdrev = str(self.repo['.'].rev()) @@ -277,15 +276,15 @@
  self.repo[hglib.fromunicode(text)]   except (error.RepoError, error.LookupError):   return - path = hglib.fromunicode(self.dest_edit.text()) + path = unicode(self.dest_edit.text())   path = remove_ext(path)   path = remove_rev(path) - path = add_rev(path, hglib.fromunicode(text)) + path = add_rev(path, text)   path = add_ext(path)   self.dest_edit.setText(path)   self.prevtarget = text   type = self.get_selected_archive_type()['type'] - self.compose_command(path, type) + self.compose_command(hglib.fromunicode(path), type)     def compose_command(self, dest, type):   cmdline = ['archive', '--repository', self.repo.root] @@ -302,20 +301,20 @@
  cmdline.append('-I')   cmdline.append(f)   cmdline.append('--') - cmdline.append(hglib.fromunicode(dest)) - self.hgcmd_txt.setText('hg ' + ' '.join(cmdline)) + cmdline.append(dest) # dest: local str + self.hgcmd_txt.setText(hglib.tounicode('hg ' + ' '.join(cmdline)))   return cmdline     def archive(self):   # verify input   type = self.get_selected_archive_type()['type'] - dest = self.dest_edit.text() + dest = unicode(self.dest_edit.text())   if os.path.exists(dest):   if type == 'files':   if os.path.isfile(dest):   qtlib.WarningMsgBox(_('Duplicate Name'),   _('The destination "%s" already exists as ' - 'a file!' % dest)) + 'a file!') % dest)   return False   elif os.listdir(dest):   if not qtlib.QuestionMsgBox(_('Confirm Overwrite'), @@ -333,11 +332,11 @@
  else:   qtlib.WarningMsgBox(_('Duplicate Name'),   _('The destination "%s" already exists as ' - 'a folder!' % dest)) + 'a folder!') % dest)   return False     # prepare command line - cmdline = self.compose_command(dest, type) + cmdline = self.compose_command(hglib.fromunicode(dest), type)     if self.files_in_rev_chk.isChecked():   self.savedcwd = os.getcwd() @@ -352,7 +351,7 @@
  else:   self.cmd.setShowOutput(True)   - def cancel_clicked(): + def cancel_clicked(self):   self.cmd.cancel()     def command_started(self):
 
10
11
12
13
 
14
15
16
 
232
233
234
 
235
236
237
 
419
420
421
422
 
423
424
425
 
10
11
12
 
13
14
15
16
 
232
233
234
235
236
237
238
 
420
421
422
 
423
424
425
426
@@ -10,7 +10,7 @@
 from tortoisehg.util import hglib  from tortoisehg.hgqt.i18n import _  from tortoisehg.hgqt import qtlib, csinfo, i18n, cmdui, status, resolve -from tortoisehg.hgqt import commit, qscilib, thgrepo +from tortoisehg.hgqt import qscilib, thgrepo, messageentry    from PyQt4.QtCore import *  from PyQt4.QtGui import * @@ -232,6 +232,7 @@
  cmd = hglib.fromunicode(cmd)   repo = self.repo   if cmd == 'commit': + from tortoisehg.hgqt import commit   dlg = commit.CommitDialog(repo, [], {}, self.wizard())   dlg.finished.connect(dlg.deleteLater)   dlg.exec_() @@ -419,7 +420,7 @@
  # commit message area   msg_sep = qtlib.LabeledSeparator(_('Commit message'))   self.layout().addWidget(msg_sep) - msgEntry = commit.MessageEntry(self) + msgEntry = messageentry.MessageEntry(self)   msgEntry.installEventFilter(qscilib.KeyPressInterceptor(self))   msgEntry.refresh(repo)   msgEntry.loadSettings(QSettings(), 'backout/message')
 
9
10
11
 
 
 
 
 
 
 
12
13
14
 
15
16
17
18
19
20
21
22
 
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
 
9
10
11
12
13
14
15
16
17
18
19
20
 
21
22
 
 
 
 
23
24
25
 
27
28
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
31
32
@@ -9,14 +9,17 @@
   from mercurial import ui, util, error   +from tortoisehg.util import hglib, shlib, wconfig, bugtraq + +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 +  from PyQt4.QtCore import *  from PyQt4.QtGui import * -from PyQt4.Qsci import QsciScintilla, QsciAPIs, QsciLexerMakefile +from PyQt4.Qsci import QsciAPIs   -from tortoisehg.hgqt.i18n import _ -from tortoisehg.util import hglib, shlib, wconfig, bugtraq -from tortoisehg.hgqt import qtlib, qscilib, status, cmdui, branchop, revpanel -from tortoisehg.hgqt import hgrcutil, mq    # Technical Debt for CommitWidget  # disable commit button while no message is entered or no files are selected @@ -24,136 +27,6 @@
 # spell check / tab completion  # in-memory patching / committing chunk selected files   -class MessageEntry(qscilib.Scintilla): - - def __init__(self, parent, getCheckedFunc=None): - super(MessageEntry, self).__init__(parent) - self.setEdgeColor(QColor('LightSalmon')) - self.setEdgeMode(QsciScintilla.EdgeLine) - self.setReadOnly(False) - self.setMarginWidth(1, 0) - self.setFont(qtlib.getfont('fontcomment').font()) - self.setCaretWidth(10) - self.setCaretLineBackgroundColor(QColor("#e6fff0")) - self.setCaretLineVisible(True) - self.setAutoIndent(True) - self.setAutoCompletionThreshold(2) - self.setAutoCompletionSource(QsciScintilla.AcsAPIs) - self.setAutoCompletionFillupsEnabled(True) - self.setLexer(QsciLexerMakefile(self)) - self.lexer().setFont(qtlib.getfont('fontcomment').font()) - self.lexer().setColor(QColor(Qt.red), QsciLexerMakefile.Error) - self.setMatchedBraceBackgroundColor(Qt.yellow) - self.setIndentationsUseTabs(False) - self.setBraceMatching(QsciScintilla.SloppyBraceMatch) - #self.setIndentationGuidesBackgroundColor(QColor("#e6e6de")) - #self.setFolding(QsciScintilla.BoxedFoldStyle) - # http://www.riverbankcomputing.com/pipermail/qscintilla/2009-February/000461.html - self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded) - self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) - # default message entry widgets to word wrap, user may override - self.setWrapMode(QsciScintilla.WrapWord) - - self.getChecked = getCheckedFunc - self.setContextMenuPolicy(Qt.CustomContextMenu) - self.customContextMenuRequested.connect(self.menuRequested) - - def menuRequested(self, point): - line = self.lineAt(point) - point = self.viewport().mapToGlobal(point) - - def apply(): - line = 0 - while True: - line = self.reflowBlock(line) - if line is None: - break; - def paste(): - files = self.getChecked() - self.insert(', '.join(files)) - def settings(): - from tortoisehg.hgqt.settings import SettingsDialog - dlg = SettingsDialog(True, focus='tortoisehg.summarylen') - dlg.exec_() - - menu = self.createStandardContextMenu() - menu.addSeparator() - if self.getChecked: - action = menu.addAction(_('Paste &Filenames')) - action.triggered.connect(paste) - for name, func in [(_('App&ly Format'), apply), - (_('C&onfigure Format'), settings)]: - def add(name, func): - action = menu.addAction(name) - action.triggered.connect(func) - add(name, func) - return menu.exec_(point) - - def refresh(self, repo): - self.setEdgeColumn(repo.summarylen) - self.setIndentationWidth(repo.tabwidth) - self.setTabWidth(repo.tabwidth) - self.summarylen = repo.summarylen - - def reflowBlock(self, line): - lines = self.text().split('\n', QString.KeepEmptyParts) - if line >= len(lines): - return None - if not len(lines[line]) > 1: - return line+1 - - # find boundaries (empty lines or bounds) - b = line - while b and len(lines[b-1]) > 1: - b = b - 1 - e = line - while e+1 < len(lines) and len(lines[e+1]) > 1: - e = e + 1 - group = QStringList([lines[l].simplified() for l in xrange(b, e+1)]) - sentence = group.join(' ') - parts = sentence.split(' ', QString.SkipEmptyParts) - - outlines = QStringList() - line = QStringList() - partslen = 0 - for part in parts: - if partslen + len(line) + len(part) + 1 > self.summarylen: - if line: - outlines.append(line.join(' ')) - line, partslen = QStringList(), 0 - line.append(part) - partslen += len(part) - if line: - outlines.append(line.join(' ')) - - self.beginUndoAction() - self.setSelection(b, 0, e+1, 0) - self.removeSelectedText() - self.insertAt(outlines.join('\n')+'\n', b, 0) - self.endUndoAction() - self.setCursorPosition(b, 0) - return b + len(outlines) + 1 - - def moveCursorToEnd(self): - lines = self.lines() - if lines: - lines -= 1 - pos = self.lineLength(lines) - self.setCursorPosition(lines, pos) - self.ensureLineVisible(lines) - self.horizontalScrollBar().setSliderPosition(0) - - def keyPressEvent(self, event): - if event.modifiers() == Qt.ControlModifier and event.key() == Qt.Key_E: - line, col = self.getCursorPosition() - self.reflowBlock(line) - elif event.key() == Qt.Key_Backtab: - event.accept() - newev = QKeyEvent(event.type(), Qt.Key_Tab, Qt.ShiftModifier) - super(MessageEntry, self).keyPressEvent(newev) - else: - super(MessageEntry, self).keyPressEvent(event) -  class CommitWidget(QWidget, qtlib.TaskWidget):   'A widget that encompasses a StatusWidget and commit extras'   commitButtonEnable = pyqtSignal(bool)
 
29
30
31
32
 
33
34
35
 
29
30
31
 
32
33
34
35
@@ -29,7 +29,7 @@
 class HgFileView(QFrame):   "file diff, content, and annotation viewer"   - diffHeaderRegExp = re.compile("^@@ -[0-9]+,[0-9]+ \+[0-9]+,[0-9]+ @@$") + diffHeaderRegExp = re.compile("^@@ -[0-9]+,[0-9]+ \+[0-9]+,[0-9]+ @@")     linkActivated = pyqtSignal(QString)   fileDisplayed = pyqtSignal(QString, QString)
 
10
11
12
13
14
 
 
15
16
17
 
295
296
297
 
298
299
300
 
496
497
498
499
 
500
501
502
 
10
11
12
 
 
13
14
15
16
17
 
295
296
297
298
299
300
301
 
497
498
499
 
500
501
502
503
@@ -10,8 +10,8 @@
   from tortoisehg.util import hglib  from tortoisehg.hgqt.i18n import _ -from tortoisehg.hgqt import qtlib, csinfo, i18n, cmdui, status, commit, resolve -from tortoisehg.hgqt import qscilib, thgrepo +from tortoisehg.hgqt import qtlib, csinfo, i18n, cmdui, status, resolve +from tortoisehg.hgqt import qscilib, thgrepo, messageentry    from PyQt4.QtCore import *  from PyQt4.QtGui import * @@ -295,6 +295,7 @@
  cmd = hglib.fromunicode(cmd)   repo = self.repo   if cmd == 'commit': + from tortoisehg.hgqt import commit   dlg = commit.CommitDialog(repo, [], {}, self)   dlg.finished.connect(dlg.deleteLater)   dlg.exec_() @@ -496,7 +497,7 @@
  # commit message area   msg_sep = qtlib.LabeledSeparator(_('Commit message'))   self.layout().addWidget(msg_sep) - msgEntry = commit.MessageEntry(self) + msgEntry = messageentry.MessageEntry(self)   msgEntry.installEventFilter(qscilib.KeyPressInterceptor(self))   msgEntry.refresh(repo)   msgEntry.loadSettings(QSettings(), 'merge/message')
Change 1 of 1 Show Entire File tortoisehg/​hgqt/​messageentry.py Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
@@ -0,0 +1,145 @@
+# messageentry.py - TortoiseHg's commit message editng widget +# +# Copyright 2011 Steve Borho <steve@borho.org> +# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2, incorporated herein by reference. + +import os + +from PyQt4.QtCore import * +from PyQt4.QtGui import * +from PyQt4.Qsci import QsciScintilla, QsciLexerMakefile + +from tortoisehg.hgqt.i18n import _ +from tortoisehg.hgqt import qtlib, qscilib + +class MessageEntry(qscilib.Scintilla): + + def __init__(self, parent, getCheckedFunc=None): + super(MessageEntry, self).__init__(parent) + self.setEdgeColor(QColor('LightSalmon')) + self.setEdgeMode(QsciScintilla.EdgeLine) + self.setReadOnly(False) + self.setMarginWidth(1, 0) + self.setFont(qtlib.getfont('fontcomment').font()) + self.setCaretWidth(10) + self.setCaretLineBackgroundColor(QColor("#e6fff0")) + self.setCaretLineVisible(True) + self.setAutoIndent(True) + self.setAutoCompletionThreshold(2) + self.setAutoCompletionSource(QsciScintilla.AcsAPIs) + self.setAutoCompletionFillupsEnabled(True) + self.setLexer(QsciLexerMakefile(self)) + self.lexer().setFont(qtlib.getfont('fontcomment').font()) + self.lexer().setColor(QColor(Qt.red), QsciLexerMakefile.Error) + self.setMatchedBraceBackgroundColor(Qt.yellow) + self.setIndentationsUseTabs(False) + self.setBraceMatching(QsciScintilla.SloppyBraceMatch) + #self.setIndentationGuidesBackgroundColor(QColor("#e6e6de")) + #self.setFolding(QsciScintilla.BoxedFoldStyle) + # http://www.riverbankcomputing.com/pipermail/qscintilla/2009-February/000461.html + self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded) + self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) + # default message entry widgets to word wrap, user may override + self.setWrapMode(QsciScintilla.WrapWord) + + self.getChecked = getCheckedFunc + self.setContextMenuPolicy(Qt.CustomContextMenu) + self.customContextMenuRequested.connect(self.menuRequested) + + def menuRequested(self, point): + line = self.lineAt(point) + point = self.viewport().mapToGlobal(point) + + def apply(): + line = 0 + while True: + line = self.reflowBlock(line) + if line is None: + break; + def paste(): + files = self.getChecked() + self.insert(', '.join(files)) + def settings(): + from tortoisehg.hgqt.settings import SettingsDialog + dlg = SettingsDialog(True, focus='tortoisehg.summarylen') + dlg.exec_() + + menu = self.createStandardContextMenu() + menu.addSeparator() + if self.getChecked: + action = menu.addAction(_('Paste &Filenames')) + action.triggered.connect(paste) + for name, func in [(_('App&ly Format'), apply), + (_('C&onfigure Format'), settings)]: + def add(name, func): + action = menu.addAction(name) + action.triggered.connect(func) + add(name, func) + return menu.exec_(point) + + def refresh(self, repo): + self.setEdgeColumn(repo.summarylen) + self.setIndentationWidth(repo.tabwidth) + self.setTabWidth(repo.tabwidth) + self.summarylen = repo.summarylen + + def reflowBlock(self, line): + lines = self.text().split('\n', QString.KeepEmptyParts) + if line >= len(lines): + return None + if not len(lines[line]) > 1: + return line+1 + + # find boundaries (empty lines or bounds) + b = line + while b and len(lines[b-1]) > 1: + b = b - 1 + e = line + while e+1 < len(lines) and len(lines[e+1]) > 1: + e = e + 1 + group = QStringList([lines[l].simplified() for l in xrange(b, e+1)]) + sentence = group.join(' ') + parts = sentence.split(' ', QString.SkipEmptyParts) + + outlines = QStringList() + line = QStringList() + partslen = 0 + for part in parts: + if partslen + len(line) + len(part) + 1 > self.summarylen: + if line: + outlines.append(line.join(' ')) + line, partslen = QStringList(), 0 + line.append(part) + partslen += len(part) + if line: + outlines.append(line.join(' ')) + + self.beginUndoAction() + self.setSelection(b, 0, e+1, 0) + self.removeSelectedText() + self.insertAt(outlines.join('\n')+'\n', b, 0) + self.endUndoAction() + self.setCursorPosition(b, 0) + return b + len(outlines) + 1 + + def moveCursorToEnd(self): + lines = self.lines() + if lines: + lines -= 1 + pos = self.lineLength(lines) + self.setCursorPosition(lines, pos) + self.ensureLineVisible(lines) + self.horizontalScrollBar().setSliderPosition(0) + + def keyPressEvent(self, event): + if event.modifiers() == Qt.ControlModifier and event.key() == Qt.Key_E: + line, col = self.getCursorPosition() + self.reflowBlock(line) + elif event.key() == Qt.Key_Backtab: + event.accept() + newev = QKeyEvent(event.type(), Qt.Key_Tab, Qt.ShiftModifier) + super(MessageEntry, self).keyPressEvent(newev) + else: + super(MessageEntry, self).keyPressEvent(event)
 
18
19
20
21
22
 
 
23
24
25
 
654
655
656
657
 
658
659
660
 
856
857
858
 
859
860
861
 
18
19
20
 
 
21
22
23
24
25
 
654
655
656
 
657
658
659
660
 
856
857
858
859
860
861
862
@@ -18,8 +18,8 @@
   from tortoisehg.util import hglib, patchctx  from tortoisehg.hgqt.i18n import _ -from tortoisehg.hgqt import qtlib, cmdui, rejects, commit, qscilib, thgrepo -from tortoisehg.hgqt import qqueue, qreorder, fileview, thgimport, status +from tortoisehg.hgqt import qtlib, cmdui, rejects, qscilib, thgrepo, status +from tortoisehg.hgqt import qqueue, qreorder, fileview, thgimport, messageentry  from tortoisehg.hgqt.qtlib import geticon    # TODO @@ -654,7 +654,7 @@
  mtbarhbox.addWidget(self.newCheckBox)   mtbarhbox.addWidget(self.patchNameLE, 1)   - self.messageEditor = commit.MessageEntry(self) + self.messageEditor = messageentry.MessageEntry(self)   self.messageEditor.installEventFilter(qscilib.KeyPressInterceptor(self))   self.messageEditor.refresh(repo)   @@ -856,6 +856,7 @@
  @pyqtSlot()   def qinitOrCommit(self):   if os.path.isdir(self.repo.mq.join('.hg')): + from tortoisehg.hgqt import commit   mqrepo = thgrepo.repository(None, self.repo.mq.path)   dlg = commit.CommitDialog(mqrepo, [], {}, self)   dlg.finished.connect(dlg.deleteLater)
 
16
17
18
19
20
 
21
22
23
 
36
37
38
39
 
40
41
42
 
16
17
18
 
 
19
20
21
22
 
35
36
37
 
38
39
40
41
@@ -16,8 +16,7 @@
   from tortoisehg.util import hglib  from tortoisehg.hgqt.i18n import _ -from tortoisehg.hgqt import cmdui, qscilib, qtlib -from tortoisehg.hgqt.commit import MessageEntry +from tortoisehg.hgqt import cmdui, qscilib, qtlib, messageentry    class QFoldDialog(QDialog):   @@ -36,7 +35,7 @@
    mlbl = QLabel(_('New patch message:'))   self.layout().addWidget(mlbl) - self.msgte = MessageEntry(self) + self.msgte = messageentry.MessageEntry(self)   self.msgte.installEventFilter(qscilib.KeyPressInterceptor(self))   self.layout().addWidget(self.msgte)  
 
17
18
19
 
 
20
21
22
 
17
18
19
20
21
22
23
24
@@ -17,6 +17,8 @@
 from tortoisehg.hgqt import cmdui, qtlib, thgrepo, manifestmodel  from tortoisehg.util import hglib, paths   +# TODO: this dialog should take a repo argument, not ui +  class RenameDialog(QDialog):   """TortoiseHg rename dialog"""  
 
645
646
647
 
 
648
649
650
651
652
653
654
 
645
646
647
648
649
650
651
 
 
652
653
654
@@ -645,10 +645,10 @@
  effects = qtlib.geteffect(style)   text = qtlib.applyeffects(' %s ' % len(files), effects)   changes.append(text) + if A: + addtotal(A, 'log.added')   if M:   addtotal(M, 'log.modified') - if A: - addtotal(A, 'log.added')   if R:   addtotal(R, 'log.removed')   return ''.join(changes)
 
309
310
311
 
312
313
314
 
407
408
409
 
410
411
412
 
413
414
415
 
483
484
485
 
486
487
488
 
489
490
491
 
309
310
311
312
313
314
315
 
408
409
410
411
412
413
414
415
416
417
418
 
486
487
488
489
490
491
492
493
494
495
496
@@ -309,6 +309,7 @@
  _('An error occurred while updating the repository hgrc '   'file (%s)' % abshgrcpath))   return False + self.setShortName(shortname)   return True   return False   @@ -407,9 +408,11 @@
  self.name = value.toString()   return True   return False +   def menulist(self):   return ['openAll', 'add', None, 'newGroup', None, 'rename', 'remove',   None, 'reloadRegistry'] +   def flags(self):   return (Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsDropEnabled   | Qt.ItemIsDragEnabled | Qt.ItemIsEditable) @@ -483,9 +486,11 @@
 class AllRepoGroupItem(RepoGroupItem):   def __init__(self, parent=None):   RepoGroupItem.__init__(self, name=_('default'), parent=parent) +   def menulist(self):   return ['openAll', 'add', None, 'newGroup', None, 'rename',   None, 'reloadRegistry'] +   def undump(self, xr):   a = xr.attributes()   name = a.value('', 'name').toString()
 
1413
1414
1415
1416
 
1417
1418
 
1419
1420
 
 
1421
1422
1423
 
1446
1447
1448
1449
 
1450
1451
1452
 
1468
1469
1470
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1471
1472
1473
 
1413
1414
1415
 
1416
1417
 
1418
1419
 
1420
1421
1422
1423
1424
 
1447
1448
1449
 
1450
1451
1452
1453
 
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
@@ -1413,11 +1413,12 @@
  def exportRevisions(self, revisions):   if not revisions:   revisions = [self.rev] - dir = QFileDialog.getExistingDirectory(self, _('Export patch'), + udir = QFileDialog.getExistingDirectory(self, _('Export patch'),   hglib.tounicode(self.repo.root)) - if not dir: + if not udir:   return - epath = os.path.join(hglib.fromunicode(dir), + strdir = hglib.fromunicode(udir) + epath = os.path.join(strdir,   hglib.fromunicode(self.repo.shortname)+'_%r.patch')     cmdline = ['export', '--repository', self.repo.root, '--verbose', @@ -1446,7 +1447,7 @@
  'in the selected location (%s).\n\n') \   % (len(existingRevisions),   " ,".join([str(rev) for rev in existingRevisions]), - dir) + udir)     warningMessage += \   _('What do you want to do?\n') + u'\n' + \ @@ -1468,6 +1469,29 @@
    self.runCommand(cmdline)   + if len(revisions) == 1: + # Show a message box with a link to the export folder and to the + # exported file + rev = revisions[0] + patchfilename = os.path.normpath(epath % rev) + patchdirname = os.path.normpath(strdir) + patchshortname = os.path.basename(patchfilename) + qtlib.InfoMsgBox(_('Patch exported'), + _('Revision #%d (%s) was exported to:<p>' + '<a href="file:///%s">%s</a>%s' + '<a href="file:///%s">%s</a>') \ + % (rev, str(self.repo[rev]), + patchdirname, patchdirname, os.path.sep, + patchfilename, patchshortname)) + else: + # Show a message box with a link to the export folder + qtlib.InfoMsgBox(_('Patches exported'), + _('%d patches were exported to:<p>' + '<a href="file:///%s">%s</a>') \ + % (len(revisions), + strdir, + strdir)) +   def visualDiffRevision(self):   opts = dict(change=self.rev)   dlg = visdiff.visualdiff(self.repo.ui, self.repo, [], opts)
 
332
333
334
335
336
337
338
339
340
341
342
343
344
 
619
620
621
622
 
 
 
 
 
 
 
623
624
625
 
774
775
776
777
 
778
779
780
 
875
876
877
878
 
879
880
881
 
332
333
334
 
 
 
 
 
 
 
335
336
337
 
612
613
614
 
615
616
617
618
619
620
621
622
623
624
 
773
774
775
 
776
777
778
779
 
874
875
876
 
877
878
879
880
@@ -332,13 +332,6 @@
  index = 0   self.targetcombo.setCurrentIndex(index)   - def applyTargetOption(self, cmdline): - if self.embedded and self.targetcheckbox.isChecked(): - idx = self.targetcombo.currentIndex() - if idx != -1 and idx < len(self.targetargs): - cmdline += self.targetargs[idx] - return cmdline -   def configChanged(self):   'Repository is reporting its config files have changed'   self.reload() @@ -619,7 +612,13 @@
  cmdline.append(val)     if 'rev' in details and '--rev' not in cmdline: - cmdline = self.applyTargetOption(cmdline) + if self.embedded and self.targetcheckbox.isChecked(): + idx = self.targetcombo.currentIndex() + if idx != -1 and idx < len(self.targetargs): + args = self.targetargs[idx] + if args[0][2:] not in details: + args[0] = '--rev' + cmdline += args   if self.opts.get('noproxy'):   cmdline += ['--config', 'http_proxy.host=']   if self.opts.get('debug'): @@ -774,7 +773,7 @@
  cmdline += ['--update', '--config', uimerge]   elif self.cachedpp == 'fetch':   cmdline[2] = 'fetch' - self.run(cmdline, ('force', 'branch', 'rev')) + self.run(cmdline, ('force', 'branch', 'rev', 'bookmark'))     def outclicked(self):   url = self.currentUrl(True) @@ -875,7 +874,7 @@
  cmdline.extend(['--rev', str(rev)])   if branch:   cmdline.extend(['--branch', branch]) - self.run(cmdline, ('force', 'new-branch', 'branch', 'rev')) + self.run(cmdline, ('force', 'new-branch', 'branch', 'rev', 'bookmark'))     def postpullclicked(self):   dlg = PostPullDialog(self.repo, self)
 
113
114
115
116
 
117
118
119
120
121
 
122
123
124
125
126
127
128
 
129
130
131
132
133
 
134
135
136
 
316
317
318
319
 
320
321
322
 
113
114
115
 
116
117
118
119
120
121
122
123
124
125
126
127
128
 
129
130
131
132
133
134
135
136
137
138
 
318
319
320
 
321
322
323
324
@@ -113,24 +113,26 @@
  t, path = selrows[0]   wctx = self.repo[None]   if t & frozenset('?') and wctx.deleted(): - rmenu = QMenu(_('Was renamed from')) + rmenu = QMenu(_('Was renamed from'), self.parent())   for d in wctx.deleted()[:15]:   def mkaction(deleted):   a = rmenu.addAction(hglib.tounicode(deleted))   a.triggered.connect(lambda: renamefromto(repo, deleted, path))   mkaction(d) + menu.addSeparator()   menu.addMenu(rmenu)     # Add restart merge actions for resolved files   if alltypes & frozenset('u'):   f = make(_('Restart Merge...'), resolve, frozenset('u'))   files = [f for t, f in selrows if 'u' in t] - rmenu = QMenu(_('Restart merge with')) + rmenu = QMenu(_('Restart merge with'), self.parent())   for tool in hglib.mergetools(repo.ui):   def mkaction(rtool):   a = rmenu.addAction(hglib.tounicode(rtool))   a.triggered.connect(lambda: resolve_with(rtool, repo, files))   mkaction(tool) + menu.addSeparator()   menu.addMenu(rmenu)   return menu   @@ -316,7 +318,7 @@
 def rename(parent, ui, repo, files):   from tortoisehg.hgqt.rename import RenameDialog   assert len(files) == 1 - dlg = RenameDialog(repo, files, parent) + dlg = RenameDialog(ui, files, parent)   dlg.finished.connect(dlg.deleteLater)   dlg.exec_()   return True