Fix post-commit UI for small Mercurial repositories.

Review Request #12843 — Created Feb. 24, 2023 and submitted

Information

Review Board
release-6.x

Reviewers

The way that the initial commit was represented when fetching lists of
commits for Mercurial repositories wasn't correct, reporting an ID of 40
consecutive zeros, instead of an empty parent ID. The result of this is
that when the "New Review Request" UI hit the end of the commit list, it
would end up in an infinite loop requesting new commits starting at
00000....

This change fixes all affected backends to convert the 000 commit to a
proper empty string.

  • Loaded the /r/new/ UI for a tiny Mercurial repository and saw that it
    no longer made infinite requests for commits.
  • Ran unit tests.
Summary ID
Fix post-commit UI for small Mercurial repositories.
The way that the initial commit was represented when fetching lists of commits for Mercurial repositories wasn't correct, reporting an ID of 40 consecutive zeros, instead of an empty parent ID. The result of this is that when the "New Review Request" UI hit the end of the commit list, it would end up in an infinite loop requesting new commits starting at `00000...`. This change fixes all affected backends to convert the 000 commit to a proper empty string. Testing Done: - Loaded the /r/new/ UI for a tiny Mercurial repository and saw that it no longer made infinite requests for commits. - Ran unit tests.
635acf2e646dc0681c4acd39957d3e0cb569c5d9
Description From Last Updated

Can we use a constant for this, so we always have something clear to reference? Alternatively, since we perform this …

chipx86chipx86

This can be one line now.

chipx86chipx86

Here too.

chipx86chipx86
chipx86
  1. 
      
  2. reviewboard/scmtools/hg.py (Diff revision 1)
     
     
    Show all issues

    Can we use a constant for this, so we always have something clear to reference?

    Alternatively, since we perform this same logic in many places, maybe it'd be better to have a normalize function for this.

  3. reviewboard/scmtools/tests/test_hg.py (Diff revision 1)
     
     
     
    Show all issues

    This can be one line now.

  4. reviewboard/scmtools/tests/test_hg.py (Diff revision 1)
     
     
     
    Show all issues

    Here too.

  5. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.0.x (6849020)