Adding support for Mercurial repositories to RB-Gateway.

Review Request #9409 — Created Nov. 29, 2017 and updated

Henri-Philippe Marceau
rb-gateway, students

hg_repository.go, a Mercurial specific implementation of repository.go
was created. The hg case was added to LoadConfig in util.go to
allow Mercurial repositories to be defined in the config file.
hg_repository_test.go was created, it contains unit tests for every
method implemented in hg_repository.go.

httpie was used to send GetName, GetPath, GetFile,
GetFileByCommit, GetBranches, GetCommits & GetCommit requests to
a tester Hg repo. Each request yielded the expected result. Unit tests
were also written and can be found in hg_repository_test.go. All of the
test were run and all were passed. Also, Review Board successfully
accessed a Mercurial Repository through RB-Gateway.

  • 0
  • 0
  • 3
  • 1
  • 4
Description From Last Updated
Henri-Philippe Marceau
Henri-Philippe Marceau
Riley Creaghan
  1. I'll say upfront that I know nothing about Go, so all I can really comment on is a few stylistic things.

  2. hg_repository.go (Diff revision 3)

    This is a small nitpick but I've looked in a few other files, and I think there should be a space between 'import' and the parenthesis.

    Also I think this import list should be alphabetical.

  3. hg_repository.go (Diff revision 3)

    There are a few spots like this where a few more line breaks could make this a little nicer looking.
    I've been comparing against git_repository.go and that file has linebreaks after most if-statements.
    However, I don't understand Go, so there may be a valid reason to group it together in some places.

  4. hg_repository.go (Diff revision 3)

    This is another example of where I think an extra line would be good to have, just between the end of the if block and the last return statement

  5. hg_repository_test.go (Diff revision 3)

    I think this import list should be alphabetical.

  6. All in all the styling is nice and the comments are good. Good work!

Graham Sea
  2. hg_repository.go (Diff revision 3)

    Not sure if this applies to go but this line is longer than 78 characters.

  3. hg_repository_test.go (Diff revision 3)

    This line is also longer than 78 characters.

Henri-Philippe Marceau
Review request changed




Revision 4 (+712)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
Theodore Brockman
  2. hg_repository.go (Diff revision 4)
    I don't know if the multiple line-comments are due to a style-guide or anything, but if not I believe you can do C-style /* */ multi-line comments in Go!