Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hg: Add a cache for mercurial repositories. #372

Merged
merged 12 commits into from
Jun 12, 2024

Commits on May 13, 2024

  1. hg: refactor for later evolutions

    Signed-off-by: Christophe de Vienne <christophe.devienne@orus.io>
    cdevienne committed May 13, 2024
    Configuration menu
    Copy the full SHA
    8249aec View commit details
    Browse the repository at this point in the history
  2. hg: Add a cache for mercurial repositories.

    The idea is to save the whole untouched clone (with no checkout) in the cache.
    
    If already present, the pull is done directly in the cache, and is
    faster (except on very small repos) because only new changeset are
    transfered.
    
    If the ref is a changeset id (not a tag, branch, topic or bookmark), and
    the changeset is already known in the cached clone, no pull is done
    which avoid any network exchange.
    
    Then we copy the cached entry and do the checkout.
    
    Signed-off-by: Christophe de Vienne <christophe.devienne@orus.io>
    cdevienne committed May 13, 2024
    Configuration menu
    Copy the full SHA
    a606d2c View commit details
    Browse the repository at this point in the history
  3. hg: code cleaning: drop unused function

    Signed-off-by: Christophe de Vienne <christophe.devienne@orus.io>
    cdevienne committed May 13, 2024
    Configuration menu
    Copy the full SHA
    d2b9218 View commit details
    Browse the repository at this point in the history
  4. hg: fix cacheID construction

    The repo URL must be in the cache id.
    The ref is purposely not included in it because we want to reuse the cached repository
    when the ref moves.
    And finally, we use a sha256 hash to mask any authentication data because we don't
    want them to be readable in the cache folder name.
    
    Signed-off-by: Christophe de Vienne <christophe.devienne@orus.io>
    cdevienne committed May 13, 2024
    Configuration menu
    Copy the full SHA
    299570d View commit details
    Browse the repository at this point in the history
  5. hg-cache: add a e2e test

    Signed-off-by: Christophe de Vienne <christophe.devienne@orus.io>
    cdevienne committed May 13, 2024
    Configuration menu
    Copy the full SHA
    235398e View commit details
    Browse the repository at this point in the history
  6. Add copyright header

    Signed-off-by: Christophe de Vienne <christophe.devienne@orus.io>
    cdevienne committed May 13, 2024
    Configuration menu
    Copy the full SHA
    f42e9ea View commit details
    Browse the repository at this point in the history
  7. hg_test: use require.NoError, code cleanup

    Signed-off-by: Christophe de Vienne <christophe.devienne@orus.io>
    cdevienne committed May 13, 2024
    Configuration menu
    Copy the full SHA
    868e6d0 View commit details
    Browse the repository at this point in the history
  8. hg: simplify cacheID

    Use only the repository URL as a cacheID
    
    Signed-off-by: Christophe de Vienne <christophe.devienne@orus.io>
    cdevienne committed May 13, 2024
    Configuration menu
    Copy the full SHA
    de55c1b View commit details
    Browse the repository at this point in the history
  9. hg: fix a possible unbounded growth of the cache

    Signed-off-by: Christophe de Vienne <christophe.devienne@orus.io>
    cdevienne committed May 13, 2024
    Configuration menu
    Copy the full SHA
    195a66f View commit details
    Browse the repository at this point in the history

Commits on May 21, 2024

  1. hg: unexport completely the Hg api

    The 'hg' type is strictly an internal tool of the 'hg' fetcher.
    The only meaningful public API of this package is the 'Sync' type.
    
    Signed-off-by: Christophe de Vienne <christophe.devienne@orus.io>
    cdevienne committed May 21, 2024
    Configuration menu
    Copy the full SHA
    255e804 View commit details
    Browse the repository at this point in the history

Commits on May 27, 2024

  1. hg: cleanup dead code

    Signed-off-by: Christophe de Vienne <christophe.devienne@orus.io>
    cdevienne committed May 27, 2024
    Configuration menu
    Copy the full SHA
    ffd1bd9 View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2024

  1. hg: expose the Hg type again

    Signed-off-by: Christophe de Vienne <christophe.devienne@orus.io>
    cdevienne committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    cc864a7 View commit details
    Browse the repository at this point in the history