Changeset - 2bb58ce6adbf
[Not reviewed]
default
0 2 0
Manuel Jacob - 7 years ago 2019-02-18 23:50:43
me@manueljacob.de
hg: rename `precursors` property of MercurialChangeset to `predecessors`

Mercurial changed the terminology around version 4.4.
2 files changed with 7 insertions and 7 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -76,49 +76,49 @@ class MercurialChangeset(BaseChangeset):
 
            return self._ctx.orphan()
 
        except AttributeError: # renamed in Mercurial 4.6 (03039ff3082b)
 
            return self._ctx.unstable()
 

	
 
    @LazyProperty
 
    def phase(self):
 
        if(self._ctx.phase() == 1):
 
            return 'Draft'
 
        elif(self._ctx.phase() == 2):
 
            return 'Secret'
 
        else:
 
            return ''
 

	
 
    @LazyProperty
 
    def successors(self):
 
        successors = obsolete.successorssets(self._ctx._repo, self._ctx.node())
 
        if successors:
 
            # flatten the list here handles both divergent (len > 1)
 
            # and the usual case (len = 1)
 
            successors = [hex(n)[:12] for sub in successors for n in sub if n != self._ctx.node()]
 

	
 
        return successors
 

	
 
    @LazyProperty
 
    def precursors(self):
 
    def predecessors(self):
 
        precursors = set()
 
        nm = self._ctx._repo.changelog.nodemap
 
        for p in self._ctx._repo.obsstore.precursors.get(self._ctx.node(), ()):
 
            pr = nm.get(p[0])
 
            if pr is not None:
 
                precursors.add(hex(p[0])[:12])
 
        return precursors
 

	
 
    @LazyProperty
 
    def bookmarks(self):
 
        return map(safe_unicode, self._ctx.bookmarks())
 

	
 
    @LazyProperty
 
    def message(self):
 
        return safe_unicode(self._ctx.description())
 

	
 
    @LazyProperty
 
    def committer(self):
 
        return safe_unicode(self.author)
 

	
 
    @LazyProperty
 
    def author(self):
 
        return safe_unicode(self._ctx.user())
 

	
kallithea/templates/changeset/changeset.html
Show inline comments
 
@@ -96,58 +96,58 @@ ${self.repo_context_bar('changelog', c.c
 
                       ${_('Grafted from:')} ${h.link_to(h.short_id(rev),h.url('changeset_home',repo_name=c.repo_name,revision=rev), class_="changeset_hash")}
 
                     </div>
 
                     %endif
 
                     <% rev = c.changeset.extra.get('transplant_source', '').encode('hex') %>
 
                     %if rev:
 
                     <div>
 
                       ${_('Transplanted from:')} ${h.link_to(h.short_id(rev),h.url('changeset_home',repo_name=c.repo_name,revision=rev), class_="changeset_hash")}
 
                     </div>
 
                     %endif
 

	
 
                     % if hasattr(c.changeset, 'successors') and c.changeset.successors:
 
                     <div class='successors'>
 
                       <span class='successors_header'>${_('Replaced by:')} </span>
 
                       % for i, s in enumerate(c.changeset.successors):
 
                           <%
 
                           comma = ""
 
                           if i != len(c.changeset.successors)-1:
 
                             comma = ", "
 
                           %>
 
                         <a class='successors_hash' href="${h.url('changeset_home',repo_name=c.repo_name, revision=s)}">${s}</a>${comma}
 
                       % endfor
 
                     </div>
 
                     % endif
 

	
 
                     % if hasattr(c.changeset, 'precursors') and c.changeset.precursors:
 
                     <div class='precursors'>
 
                       <span class='precursors_header'>${_('Preceded by:')} </span>
 
                       % for i, s in enumerate(c.changeset.precursors):
 
                     % if hasattr(c.changeset, 'predecessors') and c.changeset.predecessors:
 
                     <div class='predecessors'>
 
                       <span class='predecessors_header'>${_('Preceded by:')} </span>
 
                       % for i, s in enumerate(c.changeset.predecessors):
 
                           <%
 
                           comma = ""
 
                           if i != len(c.changeset.precursors)-1:
 
                           if i != len(c.changeset.predecessors)-1:
 
                             comma = ", "
 
                           %>
 
                           <a class="precursors_hash" href="${h.url('changeset_home',repo_name=c.repo_name, revision=s)}">${s}</a>${comma}
 
                           <a class="predecessors_hash" href="${h.url('changeset_home',repo_name=c.repo_name, revision=s)}">${s}</a>${comma}
 
                       % endfor
 
                     </div>
 
                     % endif
 
                </div>
 
            </div>
 
            <div class="form-group formatted-fixed">${h.urlify_text(c.changeset.message, c.repo_name)}</div>
 
            <div>
 
              <% a_rev, cs_rev, file_diff_data = c.changes[c.changeset.raw_id] %>
 
              % if c.limited_diff:
 
                  ${ungettext('%s file changed', '%s files changed', len(file_diff_data)) % len(file_diff_data)}:
 
              % else:
 
                  ${ungettext('%s file changed with %s insertions and %s deletions', '%s files changed with %s insertions and %s deletions', len(file_diff_data)) % (len(file_diff_data), c.lines_added, c.lines_deleted)}:
 
              %endif
 
              </div>
 
              <div class="cs_files">
 
                %for fid, url_fid, op, a_path, path, diff, stats in file_diff_data:
 
                    <div class="cs_${op} clearfix">
 
                      <span class="node">
 
                          <i class="icon-diff-${op}"></i>${h.link_to(h.safe_unicode(path), '#%s' % fid)}
 
                      </span>
 
                      <div class="changes">${h.fancy_file_stats(stats)}</div>
 
                    </div>
 
                %endfor
 
                %if c.limited_diff:
0 comments (0 inline, 0 general)