Changeset 3a8b0912825a…
Parent 843f728b7889…
by
Changes to 2 files · Browse files at 3a8b0912825a Showing diff from parent 843f728b7889 Diff from another changeset...
@@ -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,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,
|
Loading...