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

thgstrip: show last changeset even though not show all changesets

Changeset f7a4d3af9542

Parent 52a25900e963

by Yuki KODAMA

Changes to one file · Browse files at f7a4d3af9542 Showing diff from parent 52a25900e963 Diff from another changeset...

 
139
140
141
 
142
143
144
 
148
149
150
 
151
152
 
153
154
155
 
161
162
163
164
 
 
 
 
 
 
 
 
165
166
167
168
 
 
169
 
 
 
 
 
 
 
 
 
 
 
 
 
170
171
172
173
174
175
176
 
 
177
178
179
 
180
181
182
 
139
140
141
142
143
144
145
 
149
150
151
152
153
 
154
155
156
157
 
163
164
165
 
166
167
168
169
170
171
172
173
174
 
 
 
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
 
197
198
199
200
 
201
202
203
204
@@ -139,6 +139,7 @@
  self.notify_kargs = kargs     def preview_changesets(self, rev=None, limit=True): + # validate revision   if rev is None:   rev = self.get_rev()   if rev is None: @@ -148,8 +149,9 @@
  self.update_info(self.prevnum) # use cached count   return   self.prevrev = rev +   # enumerate all descendants - # borrowed from 'strip' function in 'mercurial/repair.py' + # borrowed from strip() in 'mercurial/repair.py'   cl = self.repo.changelog   tostrip = [rev,]   for r in xrange(rev + 1, len(cl)): @@ -161,22 +163,42 @@
  # update changeset preview   for child in self.resultbox.get_children():   self.resultbox.remove(child) - showrevs = limit and tostrip[:50] or tostrip + NLIMIT = 50 + if limit and numstrip > NLIMIT: + showrevs, lastrev = tostrip[:NLIMIT-1], tostrip[NLIMIT-1:][-1] + else: + showrevs, lastrev = tostrip, None + def add_info(revnum): + info = csinfo.changesetinfo(self.repo, revnum)[1] + self.resultbox.pack_start(info, False, False, 2)   for r in showrevs: - info = csinfo.changesetinfo(self.repo, r)[1] - self.resultbox.pack_start(info, False, False, 2) - if not r == tostrip[-1]: + add_info(r) + if not r == showrevs[-1]:   self.resultbox.pack_start(gtk.HSeparator()) + if lastrev: + snipbox = gtk.HBox() + self.resultbox.pack_start(snipbox, False, False, 4) + spacer = gtk.Label() + snipbox.pack_start(spacer, False, False) + spacer.set_width_chars(24) + sniplbl = gtk.Label() + snipbox.pack_start(sniplbl, False, False) + sniplbl.set_markup('<span size="large" weight="heavy"' + ' font_family="monospace">...</span>') + sniplbl.set_angle(90) + snipbox.pack_start(gtk.Label()) + add_info(lastrev)   self.resultbox.show_all()     # update info label   self.update_info(numstrip)     # update preview status - notall = numstrip > len(showrevs) + numshow = len(showrevs) + (lastrev and 1 or 0) + notall = numstrip > numshow   if notall:   text = _('Displaying %(count)d of %(total)d changesets') \ - % dict(count=len(showrevs), total=numstrip) + % dict(count=numshow, total=numstrip)   else:   text = _('Displaying all changesets')   self.pstatlbl.set_text(text)