1. 22 Nov, 2021 1 commit
    • Georges Racinet's avatar
      Repository lib: exposing the MercurialRepository.push Hgitaly method · bc5dea2d7b6b
      Georges Racinet authored
      See hgitaly#87.
      As is our current policy, we avoid new implementations based on spawning
      server-side `hg` subprocesses in favour of implementing in HGitaly from
      the onset. So that we won't have to redo it later for the Hgitaly3
      Hence this is exposed as the `hg_push` method at the current base class
      for all Mercurial repositories, which is `Gitlab::Mercurial::HgGitRepository`.
      branch : heptapod
  2. 12 Nov, 2021 1 commit
  3. 26 Oct, 2021 1 commit
  4. 18 Oct, 2021 1 commit
  5. 11 Oct, 2021 2 commits
    • Georges Racinet's avatar
      HgGitRepository#hg_bundle_to_disk: ensuring parent dir existence · 1e23ac515ef9
      Georges Racinet authored
      If called independently, this method has to ensure existence of
      the directory in which the bundle will be stored. In current
      operations, this seems to be done at least indirectly
      by the earlier Git bundle call, that
      we won't have any more once there is no Git conversion.
      branch : heptapod
    • Georges Racinet's avatar
      HgGitRepository: dedicated hg methods for some operations · 8b9f10fae431
      Georges Racinet authored
      This separation makes them easier to override from HGitalyRepository
      to bypass the Git part. Of course at some point HGitalyRepository
      should not subclass HgGitRepository any more, but that's much further
      in the future.
      This is also a good occasion to add RSpec tests for these
      overridden methods: even though they are extensively covered
      by the functional tests, the RSpec tests make for earlier
      detection of problems as they run directly on the Rails app CI,
      compared to the functional tests that need to go all the way to
      a new Docker image
      branch : heptapod
  6. 31 Aug, 2021 1 commit
  7. 07 Jul, 2021 2 commits
    • Georges Racinet's avatar
      HgGitRepository: section&item args in #hg_config_item_bool? · acd271965430
      Georges Racinet authored
      Using the fully dotted name was convenient for a `hg config` call,
      but now that we rely on an HGitaly method with section and item
      arguments, it'd be silly not to switch to that tighter style,
      given that we don't have many callers yet.
      branch : heptapod
    • Georges Racinet's avatar
      HgGitRepository: using HGitaly for hg_config_item_bool? · 82ff5c85e8d6
      Georges Racinet authored
      This finishes the proof that the Rails app can use HGitaly-specific
      services, and also fixes a minor bug.
      Generally speaking, in case a method of HgGitRepositoy can be replaced
      by an HGitaly call, we should do it directly on HgGitRepository,
      because HGitaly is available anyway, and has several advantages, even
      for legacy (`hg_git`) projects
      1. better quality overall
      2. less latency than calling the `hg` CLI
      3. more focused, with better atomicity potential
      branch : heptapod
  8. 14 Jun, 2021 1 commit
    • Georges Racinet on mutations.racinet.fr's avatar
      Repository Files: implement base64 encoding for Mercurial · 1c04c339fd66
      In particular, this makes uploading of binary files work in Web IDE.
      In theory it would be possible to pass some file as base64 encoded
      and require preservation of line endings. In practice that should
      not happen with the API requests front components and controllers
      generate. And I don't see why it should be forbidden (even if use-cases
      are hard to imagine).
      branch : heptapod-oldstable
  9. 13 Jun, 2021 1 commit
  10. 03 Jun, 2021 1 commit
    • Georges Racinet's avatar
      HgGitRepository#hgsha_from_rev: fixed path in error message · b617e4f5200d
      Georges Racinet authored
      When called for a share (typically with `.` to find out the sha
      of a just-created changesets), this case of failure gave a very
      wrong hint to people investigating a bug (spent few minutes
      wondering why it was called
      outside of the share before realizing the message was inappropriate).
      branch : heptapod-stable
  11. 02 Jun, 2021 1 commit
    • Georges Racinet's avatar
      HgGitRepository: new `hg_preserve_line_endings` option in file actions · 2a72da81467c
      Georges Racinet authored
      When this obviously mercurial-specific option is present in the
      `update` file action, line endings are preserved with
      - normalisation to Unix style if previous content is inconsistent
      - normalisation to Unix style if previous content had no line endings
      This is controlled by an option, because we definetely don't want
      all calls (in particular from the remote APIs) to suddenly start changing
      end of lines: our goal is to catch changes made from the Web UIs,
      because they tend to [change ends of lines](#445) if nothing is
      branch : heptapod-stable
  12. 26 May, 2021 2 commits
    • Georges Racinet's avatar
      HgGitRepository: branch/topic introspection only from full hash · db03d43bddea
      Georges Racinet authored
      Because we are now using `--hidden`, symbolic revisions such as
      a bookmark or tag name must be avoided, because of the
      ambiguities that are inherent to them, especially on the unfiltered
      This is easy to introduce now because it has always been the intent
      for these methods to work on full hashes anyway and that's what
      all current callers do.
      The HGitaly equivalent will be more flexible in that regard,
      because its changeset lookup is already able to switch to the
      unfiltered repository only if the requested revision is a full
      changeset ID.
      branch : heptapod-stable
    • Georges Racinet's avatar
      HgGitRepository: branch/topic introspection for obsolete changesets · c726b7856bb9
      Georges Racinet authored
      The `hg_changeset_branch` and `hg_changeset_branch_topic` methods
      are called on exact full hexadecimal SHAs only. Our general
      convention in that case (already in use in HGitaly) is that such
      reader methods should just work, because it just means that the
      application stored the hash in one way or another, and that
      accepting obsolete changesets does not bring any ambiguity.
      Closes #487
      branch : heptapod-stable
  13. 13 May, 2021 1 commit
    • Georges Racinet's avatar
      Project export: fixed Mercurial projects · 5f4213ac05b6
      Georges Racinet authored
      All that was missing is our bundle producer to return `true` to
      signal success. This is ignored in the case of backups, but is
      essential for project export.
      branch : heptapod-oldstable
  14. 14 Apr, 2021 1 commit
    • Georges Racinet's avatar
      HgGitRepository#multi_action: fix for non-UTF8 file paths · 3d0574635569
      Georges Racinet authored
      Logging directly with `#{filepath}` gives a JSON encoding
      error, adding rspec dumps as a Ruby litteral and always work.
      I could confirm that it was all that was needed to
      commit a file with non-UTF8 file name.
      Also taking care of branch names, yet not sure in that case what
      is really possible.
      branch : heptapod-stable
  15. 18 May, 2021 1 commit
    • Georges Racinet's avatar
      GitLab 13.11: Rubocop and other cosmetic code · 10281b0a0400
      Georges Racinet authored
      Each new GitLab version comes with new rules.
      The `allow_nil` seems to have not beed needed, the one in
      MR conflicts HAML template just makes the diff simpler, perhaps
      it changed upstream as well.
      branch : heptapod
  16. 20 Mar, 2021 1 commit
  17. 11 Mar, 2021 2 commits
  18. 08 Feb, 2021 2 commits
    • Georges Racinet's avatar
      HgGitRepository#hg_changeset_branch_topic: new method · 426f2c40742d
      Georges Racinet authored
      We could even have made `hg_changeset_branch` use it, but it's
      so simple… and topic can still be expensive in some cases if not
      We could also have a helper to parse the "branchmap key" notation,
      but the case is slightly different here: we always have a colon.
      That changes `rpartition` behaviour a lot.
      branch : heptapod
    • Georges Racinet's avatar
      HgGitRepository#hg_changeset_branch: fixed error treatment · c6909ec86aae
      Georges Racinet authored
      The buoying of the message from Mercurial got wrong in the
      refactoring with `hg_call`. About time to give it a test, then.
      branch : heptapod
  19. 29 Jan, 2021 1 commit
  20. 27 Jan, 2021 2 commits
    • Raphaël Gomès's avatar
      Merge Requests: semi-linear merge method · c9c4686036dd
      Raphaël Gomès authored
      We previously had py-heptapod use the recent setting in the
      topic extension allowing merges with ancestor if the target
      is a changeset without topic, we now produce that.
      A named branch change cannot be semi-linear.
      (description written by gracinet after final amendment)
      branch : heptapod
    • Georges Racinet's avatar
      HgGitRepository: stop skipping hooks in actions from Rails app · c9efba528b35
      Georges Racinet authored
      All `hg` calls done from the Rails app were done without sending
      hooks, because in Ruby, boolean evaluation of `0` (as integer)
      is `true`.
      Of course the functional tests catch the error, but they aren't
      launched for each Merge Request of the Rails app, as that would
      involve going through the whole Omnibus/Docker build.
      branch : heptapod
  21. 21 Jan, 2021 1 commit
  22. 19 Jan, 2021 1 commit
  23. 14 Jan, 2021 4 commits
  24. 13 Jan, 2021 2 commits
    • Georges Racinet's avatar
      HgGitRepository#hg_call: stop invalidating hg/git maps · 57b5dc4b5118
      Georges Racinet authored
      These invalidations are useful only when there are new
      commits, but the subsequent reads needed by lookups
      can be quite expensive for larger repos.
      For instance, a changeset publication does not need any
      invalidation. Nor does even a commit until one needs
      to convert the new changeset SHA to Git.
      Therefore, it is best for the caller to decide when exactly
      to invalidate, to avoid cases of invalidation + lookup when
      invalidation wasn't necessary.
      branch : heptapod
    • Georges Racinet's avatar
      HgGitRepository#hg_call: made path optional as named argument · 7f34f4a47763
      Georges Racinet authored
      Many popen calls to `hg` that we want to rewrite with
      `hg_call` work on `@hgpath`, even though work in a temporary
      working directory. Also, from tests, it's a
      bit awkward because `@hgpath` is an instance variable.
      branch : heptapod
  25. 14 Jan, 2021 2 commits
  26. 13 Jan, 2021 4 commits