Commit Graph

960 Commits

Author SHA1 Message Date
Sean Farley
ef7fa85796 push: use unfiltered repo for looking previously mapped nodes
It looks like this is the only place where this could happen via this
map_hg_get function.
2015-04-27 16:51:27 -07:00
Sean Farley
39fa028455 refs: avoid using dulwich to load refs
We avoid using dulwich's refs method because it is incredibly slow. On a repo
with a few hundred branches and a few thousand tags, dulwich took about 200ms
to load everything.

This patch only traveses the remote ref directory and cuts that time down to
about 50ms.
2015-09-24 14:06:36 -07:00
Sean Farley
6bc1a87edc refs: use dulwich to read remote refs
It is unclear to me why we keep a file (which can become out of sync) of remote
refs instead of just using dulwich. This caught a missing remote ref in the
test suite.
2015-05-16 19:43:26 -07:00
Yuya Nishihara
d9061cc274 help: ignore argument passed to doc loader
The API changed at Mercurial da52575e3613.
2015-09-30 22:14:36 +09:00
Augie Fackler
e2d23a1df8 version: bump to 0.8.2 2015-08-11 17:24:03 -04:00
Augie Fackler
17c71bd22d tests: add hg 3.5 to all-version-tests 2015-08-11 17:22:38 -04:00
Sean Farley
a759c02688 init: fix default hg breakage by returning the right type
Originally, I copied the logic for the file scheme which calls
_peerlookup(path) but in mercurial/hg.py they have:

    try:
        return thing(path)
    except TypeError:
        return thing

So, our http(s) scheme broke default Mercurial because I tried returning
thing(path) instead of just thing. A test has been added to catch this.
2015-07-17 11:25:00 -07:00
Sean Farley
74ba2fc128 init: test for git http(s) paths
Wraps the http(s) schemes to test for a .git at the end of the url.
2015-06-26 16:36:39 -07:00
Sean Farley
39d59547c5 init: test for raw git ssh paths 2015-06-26 16:35:41 -07:00
Sean Farley
4d5f0b97d4 git_handler: test for a raw git ssh uri
By testing the uri early, we can reuse logic later in the method to parse the
git uri. We rely on the isgitsshuri heuristic to return True or False, and if
True, prepend 'git+ssh://' to the uri.

Arguably, this is fragile, and am open to better ideas, but can't think of
anything else currently.
2015-06-26 16:32:20 -07:00
Sean Farley
e2c674532c gitrepo: use isgitsshuri in islocal 2015-06-26 16:27:11 -07:00
Sean Farley
52aee01bcf util: add heuristic method to determine if a uri is git
This add the ability to copy & paste from github's (and other git-style) urls.
Due to how we need to handle this, we need to also ensure that paths that end
with .git are stripped of their extension.
2015-07-01 13:55:59 -07:00
Sean Farley
559877bd3b init: sort imports and clean up pep warnings 2015-06-30 15:20:06 -07:00
Sean Farley
96e32e85c0 import_git_commit: skip hgsubstate logic if file was deleted
Previously, there was an edge case for Git repositories that started as
Mercurial repositories and had used subrepos where a deleted .hgsubstate would
be ignored and therefore reintroduced.

This patch fixes that behavior by checking for the deleted .hgsubstate file
first.

A test has been added to verify behavior.
2015-06-13 18:03:34 -07:00
Durham Goode
594789d17b gitimport: add save frequency config
If the importer encountered an error half way through a large import, all the
commits are saved, but the mapfile is not written, so the process starts over
from the beginning when run again.

This adds the option for a config value that will save the map file every X
commits. I thought about just hard coding this to 100 or something, but doing it
this way seems a little less invasive.
2015-06-11 13:56:16 -07:00
Durham Goode
abb733905a pull: consider remotes during discovery
The default dulwich graph walker only walks from refs/heads. During the
discovery phase of fetching this causes it to redownload commits that are only
referenced by refs/remotes. In a normal hggit case, this seems to mean it
redownloads the entire git repo on every hg pull.

Added a --debug to a test to check the object count (it decreased from 21 to 10
as part of this patch).
2015-06-23 20:17:10 -07:00
Siddharth Agarwal
cbf50582c1 tests: use Mercurial 3.4.1 for all-version-tests 2015-06-19 11:45:18 -07:00
Augie Fackler
d7b4c70b92 hggit: adapt pull wrapper function for recent hg
We can just accept-and-forward kwargs, which should be nicely
futureproof for a while.
2015-06-18 16:42:13 -04:00
anatoly techtonik
81bb3feb82 Add version info to hggit for "hg --version -v"
getversion() also reports dulwich version
2015-03-17 15:05:00 +03:00
Siddharth Agarwal
e22c598860 test-gitignore.t: drop check for ignore.readpats
ignore.readpats was added at some point before 2.8. Mercurial upstream has now
dropped the ignore module completely, so drop this check.
2015-06-01 11:44:55 -07:00
Yuya Nishihara
0cdf33ea57 gitdirstate: eliminate naked except clause in compatibility code
Tested with Mercurial 2.8.2, 2.9.2, e7caebd40c68 (stable) and
513aeb4ef454 (default).
2015-05-31 13:54:15 +09:00
Yuya Nishihara
4c08edb7cb ignore: evaluate ignore.readpats to see if ignore module really exists
Otherwise ImportError wouldn't be raised thanks to demandimport.

Perhaps tests passed at 4b0ecb5952a6 because we are likely to have ignore.pyc
in our mercurial tree.
2015-05-31 13:51:42 +09:00
Durham Goode
c2cce99cc4 test: update test output with summary phase info
Upstream Mercurial has added phase info to the summary output. Let's update the
test to reflect that.
2015-05-28 12:44:00 -07:00
Durham Goode
ad625d9971 ignore: update ignore logic to match upstream
Upstream mercurial has dropped the ignore module and replaced it with 'include:'
patterns. Let's do the same in hggit.

Ran tests against Mercurial latest (61a01892dd10) and Mercurial 3.4.
2015-05-28 12:40:49 -07:00
Gregory Szorc
c0465bda87 git_handler: properly handle paths when files converge
filectx.renamed() returns a 2-tuple or None. memfilectx.__init__ expects
the copied argument to be either None or a string. Before, we were
passing a 2-tuple, leading to the memfilectx storing the wrong type.
This eventually resulted in doing a key lookup against a manifest
with a 2-tuple, which made manifest.c throw an error.
2015-05-14 12:51:37 -07:00
Sean Farley
057929f2ba git_handler: update for bookmark changes in mercurial 3.5 2015-05-12 17:05:13 -07:00
Sean Farley
09a1dd77d6 tests: update tests for new git output, sigh 2015-05-12 16:43:33 -07:00
Augie Fackler
c0dd0be339 setup: mark version as 0.8.1 2015-05-12 18:20:54 -04:00
Siddharth Agarwal
4c89f40263 init: mark hg-git as compatible with Mercurial 3.4
Note that one test still fails with 3.4 -- however, it is a bug in core
Mercurial, only affects edge cases (broken symlinks) in the test, and is fixed
in upstream stable.
2015-05-08 15:51:45 -07:00
Siddharth Agarwal
178e6c9bdb overlaychangectx: use overlayrevlog logic to determine parents
The old logic was broken -- it didn't work at the boundary between hg and git
commits. The logic in overlayrevlog.parents handles that correctly.

This is the last fix required for Mercurial 3.4.
2015-05-08 15:50:48 -07:00
Siddharth Agarwal
fa1f56923a overlay: adapt diff to work with lazymanifests 2015-05-08 16:00:45 -07:00
Siddharth Agarwal
befdd01f3c test-bookmark-workflow: fix for Mercurial 3.4 2015-05-03 13:14:20 -07:00
Augie Fackler
c1d5202a78 pull: acquire wlock before lock to fix lock-checker warnings 2015-04-29 18:03:03 -04:00
Sean Farley
7f080a40f6 overlay: flake8 cleanup 2015-04-22 16:41:38 -07:00
Sean Farley
76f530f942 overlay: remove method that apparenetly was never called
This method had a syntax error that would have caused a crash.
2015-04-22 16:40:45 -07:00
Sean Farley
3b19ebc41e hg2git: flake8 cleanup 2015-04-22 16:42:48 -07:00
Sean Farley
89740bc8a4 gitdirstate: flake8 cleanup 2015-04-22 16:34:25 -07:00
Sean Farley
53945fe29d verify: flake8 cleanup 2015-04-22 16:31:11 -07:00
Sean Farley
1f2ea783f8 util: flake8 cleanup 2015-04-22 16:27:13 -07:00
Sean Farley
a8328e4738 gitrepo: flake8 cleanups 2015-04-22 16:25:04 -07:00
Sean Farley
5209dc41df ssh: move imports to top of file 2015-04-22 16:23:09 -07:00
Sean Farley
42a644d529 hgrepo: remove unused import 2015-04-22 16:21:51 -07:00
Sean Farley
0afb430516 init: whitespace and formating cleanup
Also cleans up some unused imports.
2015-04-17 12:52:27 -04:00
Sean Farley
c26b1ba406 hgrepo: whitespace and formatting cleanup 2015-04-16 10:34:57 -04:00
Sean Farley
30ae373e3c git_handler: remove unused variables 2015-04-15 18:37:37 -04:00
Sean Farley
2a2d57d708 git_handler: whitespace and formating changes
All errors found with flake8.
2015-04-15 18:31:06 -04:00
Sean Farley
283ba31ae9 git_handler: remove dead imports and put them on multiple lines 2015-04-15 16:10:15 -04:00
Siddharth Agarwal
f4e95251f9 git_mapfile.save_map: stop sorting the keys entirely
There really is no point to this -- the sorting is expensive to compute and
the structure is never actually used.

For a mapfile with 1.5 million entries, this speeds up save_map from 3.6
seconds to 0.87.

This is probably the limit of the speedups we can get with pure-Python code.
Any further speedups will have to be made by rewriting these bits in C.
2015-04-09 21:15:20 -07:00
Siddharth Agarwal
520f944b25 git_handler: move cStringIO to a global import
There are a couple of places that use StringIO for the added features it has
over cStringIO, so we can't replace all its uses wholesale.
2015-04-13 08:03:57 -07:00
Siddharth Agarwal
621b383912 git_handler.save_map: buffer the output
For a mapfile with 1.5 million entries, this speeds up save_map from 3.5
seconds to 3.1.
2015-04-09 20:50:26 -07:00