Commit Graph

746 Commits

Author SHA1 Message Date
Siddharth Agarwal
0685b87e70 git_handler: support extracting metadata from Git extra fields
Git has a well-hidden notion of extra fields. They aren't accessible from the
CLI, but Dulwich can create them. They're a better place to store Mercurial's
extra metadata than the commit message.

An upcoming patch will switch hg-git to saving the metadata in the Git extra
fields. This commit:
(a) prepares for that
(b) extracts other Git extra fields so that commits from Git with such fields
    roundtrip correctly
2014-08-31 06:49:18 -07:00
Siddharth Agarwal
73ef101f82 tests: add support for inline python
An upcoming patch will include an inline python test. tests/heredoctest.py is
copied over from the Mercurial repository.
2014-08-31 06:27:46 -07:00
Augie Fackler
ec5ffb1707 test-extra.t: use a templater format that's portable back to hg 2.8.2 2014-08-31 09:37:28 -04:00
Augie Fackler
c67c09d71b Makefile: fix tests-3.1 to actually be tests-3.1 in all-version-tests 2014-08-31 09:37:08 -04:00
Siddharth Agarwal
553598f445 git_handler: store hg extra data in git deterministically by sorting it
Previously, we'd iterate over the extra elements in arbitrary order. We now
sort the elements and store them in deterministic order.

Without sorting, the included test fails half the time.
2014-08-31 05:13:39 -07:00
Siddharth Agarwal
6ca8cde9a9 git_handler: drop unnecessary add_extras boolean from get_git_message 2014-08-31 03:33:36 -07:00
Siddharth Agarwal
706ef1547d tests: add test to ensure hg rename and extra metadata roundtrips
We didn't actually have a test for this until now.
2014-08-30 09:29:20 -07:00
Siddharth Agarwal
5477c71065 git_handler: fix filectxfn compatibility with hg's default branch
Mercurial rev 2eef89bfd70d changed the contract for filectxfn, and rev
6c946e059d3b added a way for us to detect the change.
2014-08-30 05:48:24 -07:00
Augie Fackler
a91be10a82 Add a file with contribution guidelines. 2014-08-23 15:02:03 -04:00
Augie Fackler
21707f30e0 Mark hg 3.1 as supported as well. 2014-08-23 12:58:09 -04:00
Augie Fackler
61c4c39b9a tests: adapt for hg 3.1 output changes 2014-08-23 13:05:28 -04:00
Augie Fackler
7cda21ac0c git_handler: attempt to advertise a slightly better user-agent
This causes github to actually respect us as a git client. I still
maintain the user-agent sniffing is silly, but at least now it works.
2014-08-23 12:37:25 -04:00
Augie Fackler
74b814ef9e git_handler: drop lots of compat cruft for old dulwich versions 2014-08-23 12:36:53 -04:00
Augie Fackler
13a5ad2a4d setup: require newer dulwich so we can always pass an opener to HttpGitClient 2014-08-23 12:45:27 -04:00
Augie Fackler
f454e245e4 hgrepo: catch NotGitRepository and turn it into abort 2014-08-23 12:35:57 -04:00
Augie Fackler
5b97ac37e5 _ssh: remove stray print 2014-08-23 12:01:06 -04:00
Augie Fackler
63480ba77f _ssh: fix trailing whitespace 2014-08-23 12:00:48 -04:00
Augie Fackler
ad70ce9871 Added signature for changeset 425eb47e3d65 2014-08-01 10:04:18 -04:00
Augie Fackler
c1864acf0c Bump version number. 2014-08-01 10:04:03 -04:00
Takumi IINO
0ada7f2963 setup: include document files to package. (issue114) 2014-07-06 15:38:33 +09:00
Augie Fackler
f67e55f336 git_handler: clean up coding style 2012-07-30 08:20:08 -05:00
Takumi IINO
8f03098c63 git_handler: enable thin pack optimization (issue102)
Git makes use thin pack transfer optimization, by default.
Some repository hosting services (like a code.google.com) are require thin pack
optimization.

This patch enables dulwich's thin_packs option by default.
2014-07-04 15:46:49 +09:00
Takumi IINO
7d525ec923 git_handler: use mercurial's password manager
mercurial has useful own password manager.
2014-06-17 15:42:37 +09:00
Siddharth Agarwal
046261ebf6 git_handler: set substate to None to cope with Mercurial changes 2014-06-17 14:17:49 -07:00
Siddharth Agarwal
4480c5bdb3 git_handler: update memfilectx creation per Mercurial changes
Mercurial commit a326c58391eb changed the signature of the memfilectx
constructor.
2014-06-17 12:49:33 -07:00
Siddharth Agarwal
a524b3dbfc tests: assert compatibility with Mercurial 3.0.1 2014-06-17 14:24:21 -07:00
Siddharth Agarwal
7e76cb54a3 git-cleanup: drop empty options and move help text to docstring 2014-05-19 21:12:40 -07:00
Siddharth Agarwal
656340ba3c gclear: drop empty options and move help text to docstring
The synopsis is meant for a command description, not help text.
2014-05-19 21:09:30 -07:00
Siddharth Agarwal
534ff10d84 gexport: drop empty options and redundant synopsis, and add help text 2014-05-19 21:07:09 -07:00
Siddharth Agarwal
7d1d2670cb gimport: drop empty options and redundant synopsis, and add help text 2014-05-19 21:06:32 -07:00
Siddharth Agarwal
0d4f4de4da commands: switch to new-style declaration via decorators
This is supported in all the versions that hg-git supports.
2014-05-19 19:03:02 -07:00
Siddharth Agarwal
0649f5c865 verify: add a wrapper function in __init__.py
Upcoming patches will switch to the new-style command decorator instead of the
explicit command table. That doesn't mesh well with top-level command functions
defined in other modules.
2014-05-19 18:55:32 -07:00
Siddharth Agarwal
58c28a86e9 import: remove redundant imports
These modules are already imported above.
2014-05-19 18:48:40 -07:00
Siddharth Agarwal
29901229f3 tests: fix further breakage due to upstream output changes
Mercurial changesets 355cfc5dc0f1 and 02e6c82cb015 added messages when
bookmarks are activated and deactivated, respectively.
2014-05-26 18:37:09 -07:00
CoolOppo
2b8e4e9116 Fixed small typo 2014-05-25 20:18:40 -04:00
Siddharth Agarwal
29a5f7c417 tests: assert compatibility with Mercurial 3.0 2014-05-19 20:39:43 -07:00
Siddharth Agarwal
bffd6d062c tests: test with @ instead of tip 2014-05-19 19:27:48 -07:00
Siddharth Agarwal
f553d6f950 testedwith: update list of versions hg-git is tested with
This should be kept in sync with the Makefile, but hasn't been.
2014-05-19 19:21:46 -07:00
Siddharth Agarwal
7f8c670530 readme: drop Mercurial and Dulwich compatibilty information
No one's ever going to bother keeping this in sync.
2014-05-19 20:44:53 -07:00
Siddharth Agarwal
d0ee6b199a tests: fix breakage caused by Mercurial changes
Mercurial commit 1ecf7fef14e2 added a new message to `hg resolve` with no more
unresolved files.
2014-05-19 19:52:22 -07:00
Augie Fackler
b5d06af748 Added signature for changeset ed515afe5a32 2014-05-13 17:42:19 -04:00
Augie Fackler
d5522aeda7 setup: bump version number, correct author 2014-05-13 17:42:05 -04:00
Augie Fackler
32e8a45170 Makefile: drop support for hg older than 2.8.2
Ubuntu's current LTS release (Trusty Tahr) comes with Mercurial 2.8.2,
which still works fine with current code. The older LTS comes with a
version that's broken, but I don't have to worry about that anymore.
2014-05-13 17:25:04 -04:00
Takumi IINO
7dcd72400d gignore: remove illegal components (issue92)
mercurial can't ignore .hg direcotry.
2014-04-16 22:04:26 +09:00
Siddharth Agarwal
f82134e252 listkeys: while looking for bookmarks, don't fetch a pack
hg pull calls listkeys for bookmarks. This would previously cause a pack with
all refs to be fetched. For Mercurial mirrors of Git repositories where only
some refs were mirrored, this would cause problems in a bunch of ways:

- A larger pack would be fetched than necessary.
- The final refs written out to the Git repo would only be the set of refs we
  were actually interested in. If a GC was subsequently run, unreferenced
  objects would be deleted. Those objects might be referred to on subsequent
  fetches, which could cause hg-git to crash.

We replace all that logic with a simple null fetch. The tests introduced in the
previous patch ensure no regressions.
2014-05-08 20:18:06 -07:00
Siddharth Agarwal
c39a11100a test-bookmark-workflow: introduce tests for incoming bookmarks
An upcoming patch will change bookmark discovery significantly. These tests
make sure nothing major regresses.
2014-05-08 19:49:50 -07:00
Siddharth Agarwal
8fbad9ff16 filter_refs: only return all refs when heads is None
We're going to pass in an empty list to this function in an upcoming patch,
with the intent that filter_refs returns an empty dict.
2014-05-08 19:30:38 -07:00
Siddharth Agarwal
4587ed225c revset_fromgit: use repo.changelog.node instead of contexts
hg perfrevset 'max(fromgit())' on a repo with around 60,000 commits:

before: ! wall 1.055093 comb 1.050000 user 1.050000 sys 0.000000 (best of 10)
after:  ! wall 0.148586 comb 0.140000 user 0.140000 sys 0.000000 (best of 62)

In reality, perfrevset doesn't clear the Git-to-Mercurial map, which means that
a call like `hg log -r 'max(fromgit())'` speeds up from around 1.5 seconds to
0.6.
2014-04-14 21:05:13 -07:00
Siddharth Agarwal
ccfe0b660e revset_gitnode: use repo.changelog.node instead of contexts
For a repository with around 60,000 commits, perfrevset for gitnode becomes:
before: ! wall 1.130716 comb 1.130000 user 1.130000 sys 0.000000 (best of 9)
after:  ! wall 0.178828 comb 0.180000 user 0.180000 sys 0.000000 (best of 54)

In reality, perfrevset doesn't clear the Git-to-Mercurial map, which means that
a call like `hg log -r 'gitnode(...)'` speeds up from around 1.5 seconds to
0.6.
2014-04-14 19:32:17 -07:00
Siddharth Agarwal
f8423175b8 test-git-submodules: replace hg cat with hg manifest
Mercurial commit a6d634896102 added support for hg cat across subrepositories.
That caused these tests to break. Fix this by using hg manifest instead.
2014-05-08 13:53:36 -07:00