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

annotate: move revision description logic to hglib

Changeset 3a8b0912825a

Parent 843f728b7889

by David Wilhelm

Changes to 2 files · Browse files at 3a8b0912825a Showing diff from parent 843f728b7889 Diff from another changeset...

 
254
255
256
257
258
259
260
261
262
263
264
265
266
267
 
268
269
270
 
254
255
256
 
 
 
 
 
 
 
 
 
 
 
257
258
259
260
@@ -254,17 +254,7 @@
  links.append([fctx, origline])   pos += len(hglib.tounicode(text))   if rev not in sums: - author = hglib.username(fctx.user()) - author = hglib.tounicode(author) - date = hglib.age(fctx.date()) - l = hglib.tounicode(fctx.description()).replace('\0', '').splitlines() - summary = l and l[0] or '' - if fctx.path() == self.annfile: - source = '' - else: - source = '(%s)' % fctx.path() - desc = '%s@%s%s:%s "%s"' % (author, rev, source, date, summary) - sums[rev] = desc + sums[rev] = hglib.get_revision_desc(fctx, self.annfile)     self.edit.summaries = sums   self.edit.links = links
 
433
434
435
 
 
 
 
 
 
 
 
 
 
 
 
 
 
436
437
438
 
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
@@ -433,6 +433,20 @@
  author = util.shortuser(user)   return author   +def get_revision_desc(fctx, curpath=None): + """return the revision description as a string""" + author = tounicode(username(fctx.user())) + rev = fctx.linkrev() + # If the source path matches the current path, don't bother including it. + if curpath and curpath == fctx.path(): + source = '' + else: + source = '(%s)' % fctx.path() + date = age(fctx.date()) + l = fctx.description().replace(u'\0', '').splitlines() + summary = l and l[0] or '' + return '%s@%s%s:%s "%s"' % (author, rev, source, date, summary) +  def validate_synch_path(path, repo):   '''   Validate the path that must be used to sync operations (pull,