Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

logview: make model and graphcell aware of incoming and new changesets

Hopefully someone more fluent in cairo will improve upon my attempts at
delineating new changesets.

Changeset 5f2e71ec6bc8

Parent e4f7a1a024ad

by Steve Borho

Changes to 5 files · Browse files at 5f2e71ec6bc8 Showing diff from parent e4f7a1a024ad Diff from another changeset...

 
575
576
577
578
 
579
580
581
 
575
576
577
 
578
579
580
581
@@ -575,7 +575,7 @@
  graphopts = { 'date': None, 'no_merges':False, 'only_merges':False,   'keyword':[], 'branch':None, 'pats':[], 'revrange':[],   'revlist':[], 'noheads':False, 'orig-tip':len(self.repo), - 'branch-view':False, 'rev':[] } + 'branch-view':False, 'rev':[], 'bundleview':False }   graphopts['filehist'] = path     # File log revision graph
 
498
499
500
 
501
502
503
 
498
499
500
501
502
503
504
@@ -498,6 +498,7 @@
  # handle strips, rebases, etc   self.origtip = min(len(self.repo), self.origtip)   opts['orig-tip'] = self.origtip + opts['bundleview'] = bool(self.bfile)     opts['no_merges'] = self.no_merges  
 
174
175
176
 
 
177
178
179
180
181
182
183
184
 
188
189
190
191
192
 
 
 
 
 
 
 
 
193
194
195
196
197
198
 
199
200
201
 
174
175
176
177
178
179
180
 
 
 
181
182
183
 
187
188
189
 
 
190
191
192
193
194
195
196
197
198
 
 
 
 
 
199
200
201
202
@@ -174,11 +174,10 @@
  arc_start_position_y = cell_area.y + cell_area.height / 2;   ctx.arc(arc_start_position_x, arc_start_position_y,   box_size / 5, 0, 2 * math.pi) + self.set_colour(ctx, colour, 0.0, 0.5) + ctx.stroke_preserve()     # Possible node status - # 0 - normal - # 1 - outgoing - # -1 - incoming   if status != 0:   def draw_arrow(x, y, inc):   ctx.move_to(x - 2, y) @@ -188,14 +187,16 @@
  ctx.stroke_preserve()   arrow_y = arc_start_position_y - box_size / 4   arrow_x = arc_start_position_x + 7; - ctx.rectangle(arrow_x, arrow_y , 2, 5) - if status == 1: + ctx.rectangle(arrow_x, arrow_y, 2, 5) + if status == -1: # Outgoing arrow + draw_arrow(arrow_x, arrow_y, -3) + elif status == 1: # New changeset, recently added to tip + # TODO: someone improve this, please + ctx.set_source_rgb(0, 1, 0) + ctx.arc(arrow_x, arrow_y, box_size / 5, 0, 2 * math.pi) + elif status == 2: # Incoming (bundle preview) arrow   draw_arrow(arrow_x, arrow_y + 5, 3) - elif status == -1: - draw_arrow(arrow_x, arrow_y, -3) - - self.set_colour(ctx, colour, 0.0, 0.5) - ctx.stroke_preserve() + ctx.stroke_preserve()     self.set_colour(ctx, colour, 0.5, 1.0)   ctx.fill()
 
40
41
42
43
 
44
45
46
 
50
51
52
 
 
53
54
55
 
169
170
171
172
173
174
 
 
 
 
 
 
 
175
176
177
 
40
41
42
 
43
44
45
46
 
50
51
52
53
54
55
56
57
 
171
172
173
 
 
 
174
175
176
177
178
179
180
181
182
183
@@ -40,7 +40,7 @@
   class TreeModel(gtk.GenericTreeModel):   - def __init__ (self, repo, graphdata, color_func, outgoing): + def __init__ (self, repo, graphdata, color_func, outgoing, origtip, bview):   gtk.GenericTreeModel.__init__(self)   self.repo = repo   self.outgoing = outgoing @@ -50,6 +50,8 @@
  self.wcparents = [x.rev() for x in repo.parents()]   self.tagrevs = [repo[r].rev() for t, r in repo.tagslist()]   self.branchtags = repo.branchtags() + self.origtip = origtip + self.bundleview = bview     def refresh(self):   repo = self.repo @@ -169,9 +171,13 @@
  else:   sumstr = bstr + tstr + summary   - status = node in self.outgoing and -1 or 0 - # TODO: determine incoming, give status 1 - + if node in self.outgoing: + status = -1 + elif revid >= self.origtip: + status = self.bundleview and 2 or 1 + else: + status = 0 +   revision = (sumstr, author, taglist, color, age, status)   self.revisions[revid] = revision   else:
 
129
130
131
 
132
133
134
 
247
248
249
250
251
252
 
 
 
 
 
253
254
255
 
356
357
358
 
359
360
361
 
129
130
131
132
133
134
135
 
248
249
250
 
 
 
251
252
253
254
255
256
257
258
 
359
360
361
362
363
364
365
@@ -129,6 +129,7 @@
  self.origtip = None   self.branch_color = False   self.outgoing = [] + self.bundleview = False     def set_outgoing(self, outgoing):   self.outgoing = outgoing @@ -247,9 +248,11 @@
  gcol.set_visible(self.show_graph)     if not self.model: - self.model = treemodel.TreeModel(self.repo, self.graphdata, - self.color_func, self.outgoing) - self.treeview.set_model(self.model) + model = treemodel.TreeModel(self.repo, self.graphdata, + self.color_func, self.outgoing, self.origtip, + self.bundleview) + self.treeview.set_model(model) + self.model = model     self.emit('batch-loaded')   if stopped: @@ -356,6 +359,7 @@
    def refresh(self, graphcol, pats, opts):   self.origtip = opts['orig-tip'] + self.bundleview = opts['bundleview']   if self.repo is not None:   hglib.invalidaterepo(self.repo)   if len(self.repo) > 0: