Commit Graph

758 Commits

Author SHA1 Message Date
Siddharth Agarwal
1a2929b055 git_handler.save_remote_refs: use an atomic temp file to write
This bug becomes obvious now that the code is structured like this.
2014-09-03 19:56:45 +02:00
Siddharth Agarwal
22561bae4b git_handler: move remote ref writing to a separate function
For consistency with save_map and save_tags.
2014-09-03 19:55:28 +02:00
Siddharth Agarwal
315a838922 git_handler.update_remote_branches: rename 'tags' to 'remote_refs'
'tags' is a fairly nonsensical name in this context.
2014-09-03 19:47:37 +02:00
Siddharth Agarwal
71fe850624 hgrepo: move remote ref loading to git_handler
The writing out is in the git handler, so the loading should be too.
2014-09-03 19:46:42 +02:00
Siddharth Agarwal
8a139c3cfe git_handler: convert to hex at the end instead of in the middle
This makes upcoming patches simpler.
2014-09-03 19:35:31 +02:00
Siddharth Agarwal
043b7dbe03 git_handler: move git-remote-refs out to a class field for consistency 2014-09-03 18:48:16 +02:00
Siddharth Agarwal
89bb592958 git_handler: rename tagsfile to tags_file for PEP8 compat 2014-09-03 18:47:28 +02:00
Siddharth Agarwal
630ca7513d git_handler: rename mapfile to map_file for PEP8 compat 2014-09-03 18:46:55 +02:00
Siddharth Agarwal
bae8da0932 git_handler: remove unnecessary os.path.join call 2014-09-03 18:45:18 +02:00
Siddharth Agarwal
f11a61a432 git_handler.load_map: use None as the uninitialized condition
If there are no elements in the map, we would have tried loading it over and
over again. With this, we only try loading it once.
2014-09-03 20:29:01 +02:00
Siddharth Agarwal
53fad749ea test-extra: add some more rename tests 2014-08-31 14:23:57 -07:00
Siddharth Agarwal
ed8599fcd4 git_handler: export hg extra metadata as git extra metadata (issue121)
We export new git commits with hg extra metadata stored as git extra fields.
We also ensure that parsing old commits doesn't break.
2014-08-31 14:01:07 -07:00
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