Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

synch, history: useability improvements

* when synch is launched from log, disable 'view pulled changes button'
* add notification so the log can refresh after pulls
* changesets added after log window is opened are given darkgreen color
(merges are now blue)

Changeset fae93fb492a9

Parent 15cf316bbf3c

by Steve Borho

Changes to 3 files · Browse files at fae93fb492a9 Showing diff from parent 15cf316bbf3c Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​history.py Stacked
 
73
74
75
76
 
 
77
78
79
 
271
272
273
 
 
 
274
275
276
 
73
74
75
 
76
77
78
79
80
 
272
273
274
275
276
277
278
279
280
@@ -73,7 +73,8 @@
    def _synch_clicked(self, toolbutton, data):   from hggtk import synch - dlg = synch.SynchDialog([], False) + dlg = synch.SynchDialog([], False, True) + dlg.set_notify_func(self.thgrefresh, None)   dlg.show_all()     def toggle_view_column(self, button, property): @@ -271,6 +272,9 @@
  else:   self.graphview = LogTreeView(self.repo, self.limit, self.stbar)   + origtip = self.opts.get('orig-tip', len(self.repo.changelog)) + self.graphview.set_property('original-tip-revision', origtip) +   # Allocate ChangeSet instance to use internally   self.changeview = changeset.ChangeSet(self.ui, self.repo, self.cwd, [],   self.opts, self.stbar)
 
35
36
37
 
 
 
 
 
38
39
40
 
93
94
95
 
96
97
98
 
227
228
229
 
 
230
231
232
 
245
246
247
 
 
248
249
250
 
425
426
427
 
 
428
429
430
 
 
431
432
433
 
442
443
444
 
 
445
446
447
 
35
36
37
38
39
40
41
42
43
44
45
 
98
99
100
101
102
103
104
 
233
234
235
236
237
238
239
240
 
253
254
255
256
257
258
259
260
 
435
436
437
438
439
440
 
 
441
442
443
444
445
 
454
455
456
457
458
459
460
461
@@ -35,6 +35,11 @@
  'The maximum number of revisions to display',   gobject.PARAM_READWRITE),   + 'original-tip-revision': (gobject.TYPE_PYOBJECT, + 'Tip revision when application opened', + 'Revisions above this number will be drawn green', + gobject.PARAM_READWRITE), +   'revision': (gobject.TYPE_PYOBJECT,   'Revision',   'The currently selected revision', @@ -93,6 +98,7 @@
  self.currev = None   self.construct_treeview()   self.pbar = pbar + self.origtip = None     def set_repo(self, repo, pbar=None):   self.repo = repo @@ -227,6 +233,8 @@
  return self.limit   elif property.name == 'revision':   return self.currev + elif property.name == 'original-tip-revision': + return self.origtip   else:   raise AttributeError, 'unknown property %s' % property.name   @@ -245,6 +253,8 @@
  self.batchsize = value   elif property.name == 'revision':   self.set_revision_id(value) + elif property.name == 'original-tip-revision': + self.origtip = value   else:   raise AttributeError, 'unknown property %s' % property.name   @@ -425,9 +435,11 @@
  self.treeview.append_column(self.date_column)     def text_color_orig(self, parents, rev, author): + if self.origtip is not None and int(rev) > self.origtip: + return 'darkgreen'   if len(parents) == 2: - # mark merge changesets green - return '#006400' + # mark merge changesets blue + return 'blue'   elif len(parents) == 1:   # detect non-trivial parent   if long(rev) != parents[0]+1: @@ -442,6 +454,8 @@
  color_cache = {}     def text_color_author(self, parents, rev, author): + if self.origtip is not None and int(rev) > self.origtip: + return 'darkgreen'   for re, v in self.author_pats:   if (re.search(author)):   return v
Change 1 of 6 Show Entire File hggtk/​synch.py Stacked
 
20
21
22
23
 
24
25
26
 
29
30
31
 
 
32
33
34
 
284
285
286
287
 
288
289
290
 
301
302
303
304
305
 
306
307
308
 
589
590
591
 
 
592
593
594
 
638
639
640
 
 
 
 
641
642
643
 
20
21
22
 
23
24
25
26
 
29
30
31
32
33
34
35
36
 
286
287
288
 
289
290
291
292
 
303
304
305
 
 
306
307
308
309
 
590
591
592
593
594
595
596
597
 
641
642
643
644
645
646
647
648
649
650
@@ -20,7 +20,7 @@
 from hggtk import dialog, gtklib, hgthread, history, thgconfig, hgemail    class SynchDialog(gtk.Window): - def __init__(self, repos=[], pushmode=False): + def __init__(self, repos=[], pushmode=False, fromlog=False):   """ Initialize the Dialog. """   gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)   gtklib.set_tortoise_icon(self, 'menusynch.ico') @@ -29,6 +29,8 @@
  self.root = paths.find_root()   self.selected_path = None   self.hgthread = None + self.fromlog = fromlog + self.notify_func = None     # persistent app data   self._settings = settings.Settings('synch') @@ -284,7 +286,7 @@
  except hglib.RepoError:   return   tip = len(repo.changelog) - if self.origchangecount == tip: + if self.origchangecount == tip or self.fromlog:   self.viewpulled.hide()   else:   self.buttonhbox.show() @@ -301,8 +303,7 @@
  self.repo = repo     def _view_pulled_changes(self, button): - countpulled = len(self.repo.changelog) - self.origchangecount - opts = {'limit' : countpulled, 'from-synch' : True} + opts = {'orig-tip' : self.origchangecount, 'from-synch' : True}   dlg = history.GLog(self.ui, None, None, [], opts)   dlg.display()   @@ -589,6 +590,8 @@
  self._stop_button.set_sensitive(False)   if self.hgthread.return_code() is None:   self.write(_('[command interrupted]')) + if self.notify_func: + self.notify_func(self.notify_args)   return False # Stop polling this function     AdvancedDefaults = { @@ -638,6 +641,10 @@
  else:   self.textview.set_wrap_mode(gtk.WRAP_WORD)   + def set_notify_func(self, func, *args): + self.notify_func = func + self.notify_args = args +    def run(ui, *pats, **opts):   return SynchDialog(pats, opts.get('pushmode'))