This instance will be upgraded to Heptapod 0.25.0 (final) on 2021-09-22 at 15:00 UTC+2 (a few minutes of down time)

Commit 91d2e0fe authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Commit: implement hpd_display_parent_id and _ids

This was missing, and could turn out to be useful, even though
analysis shows that's not the case for #385.

The new tests look to be trivial, because display ids
are just the ids for commits of Git repositories. But
the point is to check the APIs are internally consistent
and avoid mistakes in refactorings.

There is a test in HgGitRepository that makes sure that
the Mercurial conversion for display is correct.

branch : heptapod-stable
parent 0a568e3d5b87
......@@ -274,10 +274,22 @@ def parent_ids
@parent_ids ||= @repository.commit(id).parent_ids
def hpd_display_parent_ids
# not yet loaded is probably just nil, but [] would be correct
# as well since parent_ids uses ||=
return parent_ids unless parent_ids { |id| @repository.commit_id_to_display_id(id) }
def parent_id
def hpd_display_parent_id
def parent_hgid
......@@ -58,6 +58,7 @@
it { expect(@commit.different_committer?).to be_truthy }
it { expect(@commit.parents).to eq(@gitlab_parents) }
it { expect(@commit.parent_id).to eq(@parents.first.oid) }
it { expect(@commit.hpd_display_parent_id).to eq(@parents.first.oid) }
it { expect(@commit.no_commit_message).to eq("No commit message") }
after do
......@@ -86,6 +87,7 @@
it { expect(commit.committer_name).to eq( }
it { expect(commit.committer_email).to eq( }
it { expect(commit.parent_ids).to eq(gitaly_commit.parent_ids) }
it { expect(commit.hpd_display_parent_ids).to eq(gitaly_commit.parent_ids) }
context 'non-UTC dates' do
let(:seconds) { }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment