Skip to content
Snippets Groups Projects
  1. Feb 23, 2019
  2. Oct 23, 2017
  3. Aug 10, 2017
  4. Jan 08, 2016
  5. Dec 31, 2015
  6. May 28, 2015
  7. Mar 12, 2015
  8. Feb 21, 2015
  9. Dec 02, 2014
    • Siddharth Agarwal's avatar
      git_handler: mark source for rename info as Git or Mercurial · fffe8883
      Siddharth Agarwal authored
      See inline comments for why the additional metadata needs to be stored.
      
      This literally breaks all the hashes because of the additional metadata. The
      changing of hashes is unfortunate but necessary to preserve bidirectionality.
      
      While this could be broken up into multiple commits, there was no way to do
      that while preserving bidirectionality. Following the principle that every
      intermediate commit must result in a correct state, I decided to combine the
      commits.
      fffe8883
  10. May 27, 2014
  11. Mar 25, 2014
    • Siddharth Agarwal's avatar
      hg2git: in _init_dirs, store keys without leading '/' (issue103) · 623cb724
      Siddharth Agarwal authored
      Previously, whenever a tree that wasn't the root ('') was stored, we'd prepend
      a '/' to it. Then, when we'd try retrieving the entry, we'd do so without the
      leading '/'. This caused data loss because existing tree entries were dropped
      on the floor. Fix that by only adding '/' if we're adding to a non-empty
      initial path.
      
      This wasn't detected in tests because most of them deal only with files in the
      root and not ones in subdirectories.
      623cb724
  12. Mar 05, 2014
    • Siddharth Agarwal's avatar
      git_handler.fetch: actually return number of heads added or removed · 4cddcb76
      Siddharth Agarwal authored
      The return value as implemented in git_handler.fetch was pretty bogus. It used
      to return the number of values that changed in the 'refs/heads/' namespace,
      regardless of whether multiple values in there point to the same Mercurial
      commit, or whether particular heads were even imported. Fix all of that by
      using the actual heads in the changelog, just like vanilla Mercurial.
      
      The test output changes demonstrate examples where the code was buggy.
      4cddcb76
  13. Dec 15, 2013
  14. Dec 13, 2013
  15. Aug 28, 2013
  16. Jan 06, 2013
    • David M. Carr's avatar
      push: provide better output about changed references (issue #64) · a6b7ad53
      David M. Carr authored
      As pointed out by l33t, Hg-Git's output for push doesn't currently do a very
      good job of telling the user what happened.  My previous changes in this area
      had moved some of the output from status to note, making it only show if
      --verbose was specified.  However, I hadn't realized at the time that the
      reference information (though overly verbose) was providing a valueable purpose
      that otherwise wasn't met; telling the user that a remote reference had changed.
      
      This changeset makes it so that:
      *   default output will include simple messages like "adding reference
          refs/heads/feature" and "updating reference refs/heads/master" (omitting any
          mention of unchanged references)
      *   verbose output will include more detailed messages like "adding reference
          default::refs/heads/feature => GIT:aba43c" and "updating reference
          default::refs/heads/master => GIT:aba43c" (omitting any mention of unchanged
          references)
      *   debug output will include the detailed output like in verbose, but
          addtionally will include messages like "unchanged reference
          default::refs/heads/other => GIT:aba43c"
      
      https://bitbucket.org/durin42/hg-git/issue/64/push-confirmation
      a6b7ad53
    • David M. Carr's avatar
      push: add more output about what was added (issue #64) · 163c4525
      David M. Carr authored
      l33t pointed out that currently, Hg-Git doesn't provide any confirmation that a
      push was successful other than the exit code.  Normal Mercurial provides a
      couple other messages followed by "added X changesets with Y changes to
      Z files".  After this change, Hg-Git will provide much more similar output.
      It's not identical, as the underlying model is substantially different, but the
      concept is the same.  The main message is "added X commits with Y trees and
      Z blobs".
      
      This change doesn't affect the output of what references/branches were touched.
      That will be addressed in a subsequent commit.
      
      Dulwich doesn't provide an easy hook to get the information needed for this
      output.  Instead of passing generate_pack_contents as the pack generator
      function to send_pack, I pass a custom function that determines the "missing"
      objects, stores the counts, and then calls generate_pack_contents (which then
      will determine the "missing" objects again.
      
      The new expected output:
      searching for changes # unless quiet true
      <N> commits found     # if verbose true
      list of commits:      # if debugflag true and at least one commit found
      <each hash>           # if debugflag true and at least one commit found
      adding objects        # if at least one commit found unless quiet true
      added <N> commits with <N> trees and <N> blobs # if at least one object unless
                                                     # quiet true
      
      https://bitbucket.org/durin42/hg-git/issue/64/push-confirmation
      163c4525
  17. Nov 03, 2012
    • David M. Carr's avatar
      tests: convert echos to comments · 52461f71
      David M. Carr authored
      Now that we're in the unified test format, there isn't a need to use echo
      to provide context to command output.  This technique actually ends up resulting
      in redundant output.  To preserve the original context, but eliminate the
      redundancy, such echo statements have been converted into comment lines.
      52461f71
    • David M. Carr's avatar
      tests: extract git command-line client and dulwich requirements into testutil · 675f19af
      David M. Carr authored
      One or both of these requirements were in almost every test in exactly the same
      way.  Now, these checks are performed in every test that uses the testutil.
      This makes it easier for test authors to add these checks into new tests (just
      add a reference to the testutil, which you'd probably want anyway).
      
      We considered having each test declare their requirements (currently, either
      "git" or "dulwich"), but in this case, preferred the simplicity of having the
      check always performed (even if a particular test doesn't need one or the
      other).  You can't perform any meaningful testing of Hg-Git without both of
      these dependencies properly configured.  The main value to checking for them
      in the tests (rather than just letting the tests fail) is that it gives a
      meaningful error message to help people figure out how to fix their environment.
      In the case that either git or dulwich is missing, the information will be
      just as clearly conveyed regardless of whether its all the tests that are
      skipped, or just most of them.
      
      I didn't add dulwich to hghave (even though this is clearly the sort of thing
      that hghave is intended for) because hghave is currently pulled from Mercurial
      completely unchanged, and it's probably best to keep it that way.
      
      Tested by running the tests in three configurations:
       * No dulwich installed (ran 0, skipped 28, failed 0, output:
              Skipped *: missing feature: dulwich)
       * Bad git on path (ran 1, skipped 27, failed 0, output:
              Skipped *: missing feature: git command line client)
       * Working git and correct version of dulwich installed
              (ran 28, skipped 0, failed 0)
      
      Thanks to Felipe Contreras for the idea to extract this logic into a library.
      675f19af
  18. Oct 31, 2012
    • David M. Carr's avatar
      tests: let git init create directories when applicable · 935c4fb1
      David M. Carr authored
      It's functionally equivalent to create a directory, cd into it, git init, and
      cd out of the directory, or simply git init with the directory specified.
      
      In several cases, we were doing the former without performing any other
      operations in the git repo, which just made the test unneccesarily complex.
      Even in the case where we still want to cd into the directory, calling git
      init with the directory name eliminates the need for a separate mkdir command.
      
      This changeset converts the former approach to the latter with the goal of
      increasing the readability of the tests.
      
      Thanks to Felipe Contreras for the patch which this was based on.
      935c4fb1
    • David M. Carr's avatar
      tests: extract commonly used commit/tag functions into testutil library · c4849b2d
      David M. Carr authored
      Thanks to Felipe Contreras for the patch which this was based on.
      
      The functions were renamed to make it clearer that these are shell functions
      rather than normal git/hg commands, and to make it clearer which tool is being
      invoked.
      
      Old name | New name
      ------------------------
      commit   | fn_git_commit
      tag      | fn_git_tag
      hgcommit | fn_hg_commit
      hgtag    | fn_hg_tag
      
      Extraction from test-encoding.t was left for a subsequent patch, as I was seeing
      unexpected output changes when I attempted the extraction.
      
      The gitcommit and hgcommit functions in test-bookmark-workflow.t were left
      as-is for now, as they have a different behavior than the standard version
      (separate counters for each).
      c4849b2d
    • David M. Carr's avatar
      tests: extract extension configuration into a testutil library · a7da97e6
      David M. Carr authored
      Thanks to Felipe Contreras for the patch which this was based on.
      
      Even though the MQ extension was only used in a single test
      (test-pull-after-strip.t), I included it in the testutil.  It shouldn't hurt
      anything to have it enabled and not used, and saves us from having to deal
      with enabling extensions in individual tests at all.
      
      Similarly, this changeset results in the graphlog extension being enabled
      for all tests, even though there were some that didn't use it before.  This is
      even less significant in Mercurial 2.3+, since in those versions, graphlog is
      part of core, and is available even when the extension is disabled.
      a7da97e6
  19. Oct 29, 2012
  20. Oct 26, 2012
    • David M. Carr's avatar
      push: suppress "exporting hg objects to git" message · 9c71a6f0
      David M. Carr authored
      When communicating with the user on push/outgoing, Mercurial doesn't show a
      "exporting hg objects to git" message, so we shouldn't.  The message has been
      changed to be shown if --verbose is specified.
      9c71a6f0
    • David M. Carr's avatar
      push: suppress ref output by default · d4ccec82
      David M. Carr authored
      When communicating with the user on push, Mercurial doesn't show much on
      success.  Currently, Hg-Git shows every changed ref.  After this change,
      the default output will more closely match Mercurial's regular behavior (no
      per-ref output), while changed refs will be shown if --verbose is specified,
      and all refs will be shown if --debug is specified.
      d4ccec82
    • David M. Carr's avatar
      gitrepo: initial support for listkeys · 4f4ab2d8
      David M. Carr authored
      This changeset adds test coverage for comparing "hg outgoing -B" in normal
      Mercurial usage with Hg-Git usage.  This didn't match, since previously, gitrepo
      didn't provide a meaningful listkeys implementation.  Now, it does.
      
      gitrepo now has access to a GitHandler when a localrepo is available.  This
      handler is used to access the information needed to implement listkeys for
      namespaces (currently, only bookmarks) and bookmarks.
      
      A couple of other tests were testing "divergent bookmark" scenarios.  These
      tests have been updated to filter out the divergent bookmark output, as it isn't
      consistent across the supported Mercurial versions.
      4f4ab2d8
  21. Oct 25, 2012
    • David M. Carr's avatar
      push: fix traceback when pushing empty hg repo to empty git repo (issue #58) · 06a29fdd
      David M. Carr authored
      In the logic that was attempting to handle the case where the local repo doesn't
      have any bookmarks, the assumption was being made that tip resolved to a
      non-null revision.  In the case of a totally empty local repo, however, that
      isn't a valid assumption, and resulted in attempting to set the master ref
      to None, which broke dulwich.
      
      The "fix", which avoids the traceback and allows the push to complete (though
      still do nothing, since in this case there aren't any changes to push), is to
      not tweak the refs at all if tip is nullid.  Leaving the special capabilities
      ref and not adding a master ref appears to be fine in this case.
      06a29fdd
  22. Oct 08, 2012
  23. Sep 14, 2012
    • David M. Carr's avatar
      tests: eliminate use of git-daemon · 7edcbdd2
      David M. Carr authored
      Dulwich now supports local repositories just fine.  Not using the daemon makes
      the tests easier to read and more reliable (less likely to be skipped because
      a stray daemon is holding onto the port).
      7edcbdd2
    • David M. Carr's avatar
      tests: remove piping of command git init to remove leading path · e48a3f30
      David M. Carr authored
      In many cases we were piping to a python script to strip out the varying leading
      path to the test repos.  This is no longer needed, as the modern run-test.py
      automatically substitutes the leading path as $TESTTMP.  Eliminating the piping
      makes the tests easier to read and write, as well as allowing the exit codes
      to be verified by the test.
      e48a3f30
    • David M. Carr's avatar
      tests: remove configuration of bookmarks extension · bc7b18c2
      David M. Carr authored
      All of our supported Hg versions include bookmarks in core.  Thus, actovating
      it in the hgrc and setting bookmarks.track.current are no longer needed.
      bc7b18c2
  24. Sep 10, 2012
  25. Sep 06, 2012
    • David M. Carr's avatar
      push: return 1 if no changes found, 0 if success · 68e5dddc
      David M. Carr authored
      While working on some other tests, I noticed that the push command was returning
      exit code 1 on success.  This changeset makes hgrepo.push use the same return
      code contract as localrepo.push, which makes the exit codes behave as expected.
      68e5dddc
  26. May 15, 2011
  27. Mar 26, 2010
  28. Nov 23, 2009
  29. Oct 25, 2009
Loading