Commit Graph

464 Commits

Author SHA1 Message Date
Sean Farley
0927a0ce0f util: regularize mercurial imports 2016-01-08 13:57:03 -08:00
Siddharth Agarwal
1636e9e169 version: bump up to 0.8.4 2016-01-02 03:39:18 -08:00
Augie Fackler
2ee07e0b3b git_handler: work around dulwich using unicode for ref names
Dulwich treats ref names internally as unicode strings (probably
because of Python 3?), which means that at some points it tries to do
os.path.join between the repo path and the unicode of the ref name,
which fails miserably if we construct the repo with a str and not a
unicode. Kludge around this problem.

Fixes issue 172.

This is a roll-forward of 3df4d529a2f2, which should be valid now that
the previous change defends against accidentally writing unicode tags
inside the templater.
2015-12-31 18:49:17 -05:00
Augie Fackler
1695f5ea63 hgrepo: ensure all git-origin tags are bytes
If we don't do this we might end up with unicodes being written using
ui, which then breaks in popbuffer in test-encoding.t. This appears to
be an academic concern until we start passing unicode paths to git
repos, which we need to do in order to resolve some other problems. Yay.
2015-12-31 18:48:01 -05:00
Siddharth Agarwal
5b3067b1ca gitdirstate: fix up compat comment
pathutil isn't in 2.8.
2015-12-31 12:56:12 -08:00
Siddharth Agarwal
0b8ebc4c37 gitrepo: clean up compat cruft 2015-12-31 12:54:33 -08:00
Siddharth Agarwal
6b44a596c9 merge 2015-12-31 12:45:30 -08:00
Siddharth Agarwal
4da8faa79d overlay: regularize mercurial imports 2015-12-31 12:37:40 -08:00
Siddharth Agarwal
88776b1c4d gitdirstate: regularize mercurial imports 2015-12-31 12:36:16 -08:00
Siddharth Agarwal
bc415ebbf6 ssh: regularize mercurial imports 2015-12-31 12:34:29 -08:00
Siddharth Agarwal
6e5e1a63de hgrepo: regularize mercurial imports 2015-12-31 12:33:17 -08:00
Siddharth Agarwal
cbe9637432 hg2git: regularize mercurial imports 2015-12-31 12:27:07 -08:00
Siddharth Agarwal
4db39a76a0 init: regularize mercurial imports 2015-12-31 12:26:34 -08:00
Siddharth Agarwal
bd7830175b git_handler: regularize mercurial imports 2015-12-31 12:25:00 -08:00
Laurent Charignon
4ea775d1ba bookmarks: use bookmarks.recordchange instead of bookmarks.write if available
bookmarks.write is deprecated and it was showing warning messages in
test-hg-branch.t with the latest test runner from core mercurial. Tested with
both hg 2.8 and hg tip.
2015-12-30 10:27:24 -08:00
timeless@gmail.com
14a00dff5c init: handle AttributeError in addition to ImportError
If a module doesn't exist, it yields an ImportError,
if an attribtue doesn't exist on a module, it yields an AttributeError
2015-12-29 18:06:14 +00:00
Sean Farley
23cf0f33f3 ssh: fix breakage again with dulwich update
dulwich 0.12.x changed the way they pass parameters around, so we reformat that
to what hg-git expects.

This is just plain ridiculous.
2015-12-14 14:38:42 -08:00
Sean Farley
37c52e3cab push: print messages from the server
Some servers, for example, Bitbucket, output helpful messages. This patch
reports the output, if any exist, to the user.
2015-12-02 17:26:20 -08:00
Sean Farley
fc82883494 init: only activate git ignore logic in reposetup
This will massively speed up 'hg status' on repos that are not git based. On my
macports repo, status went from

Before: 0m0.591s
After:  0m0.297s
2015-10-29 15:57:17 -07:00
Siddharth Agarwal
cfe9c6dc8a Backed out changeset 3df4d529a2f2
This was causing test-encoding.t to fail.
2015-12-01 10:19:50 -08:00
Augie Fackler
28aa302374 git_handler: work around dulwich using unicode for ref names
Dulwich treats ref names internally as unicode strings (probably
because of Python 3?), which means that at some points it tries to do
os.path.join between the repo path and the unicode of the ref name,
which fails miserably if we construct the repo with a str and not a
unicode. Kludge around this problem.

Fixes issue 172.
2015-11-25 17:52:59 -05:00
Siddharth Agarwal
6993d261f6 determine_wants: deal with refs being None
Not clear how this is happening, but this should fix it.

Resolves issue #166.
2015-11-08 21:56:38 -08:00
Siddharth Agarwal
bc11bc247c version: bump up to 0.8.3 2015-11-08 21:41:43 -08:00
Siddharth Agarwal
0daa287392 mark as compatible with Mercurial 3.6 2015-11-08 21:39:00 -08:00
Siddharth Agarwal
3c1f8f5111 push: fix exchangepush for Mercurial 3.2 2015-11-08 21:37:48 -08:00
Durham Goode
fb8f4a418b push: fix exchangepush wrapping
Upstream added opargs to exchange.push and uses it as kwargs to the
pushoperation constructor (59da9543ec6c). There was an attempt to fix this in
hggit (2eb4c0de6bc6) but it passes the exchange.push kwargs directly to
pushoperation(), where we actually need to pull out the opargs and pass them as
kwargs.
2015-10-26 16:00:55 -07:00
Sean Farley
4e3fe9c32a ssh: fix breakage with dulwich update
dulwich 0.11.x changed the way they pass parameters around, so we reformat that
to what hg-git expects.
2015-10-19 11:41:06 -07:00
Sean Farley
8edc804959 hggit: adapt push wrapper function for recent hg
We can just accept-and-forward kwargs, which should be nicely
futureproof for a while.
2015-10-15 13:55:30 -07:00
Sean Farley
2c0ba03a59 init: wrap hgutil.url so that we can use isgitsshuri
Previously, cloning from a git ssh uri (e.g. git@github.com:user/repo.git)
would prepend the local file path because Mercurial classifies this as a path
(since there is no scheme at the beginning of the string). This patch fixes
that by doing the same logic as before in hgutil.url so that the correct hgrc
path is written.
2015-10-15 16:04:15 -07:00
Sean Farley
d11745bc53 revsets: use baseset instead of raw list
We fallback to using a standard set if baseset is not available
2015-09-24 16:54:47 -07:00
Durham Goode
5aff23b3c8 paths: mark git repos as valid paths
The latest version of Mercurial validates that a path contains the .hg
directory. This breaks when pulling/pushing to git repos.

This patch makes a gitrepo a valid path as well.
2015-08-24 19:31:52 -07:00
Durham Goode
43376aba98 paths: refactor gitdir detection to a function
Refactors the logic that decides if a local directory is a git directory into a
separate function. This will let us use it later on to integrate with
Mercurial's new paths component.
2015-08-24 19:30:44 -07:00
Sean Farley
12c6012084 update_hg_bookmarks: add wlock 2015-09-24 16:24:27 -07:00
Sean Farley
22991894df git_handler: rename local variable to not shadow import name 2015-05-14 15:15:37 -07:00
Sean Farley
beecd28ea0 git_handler: remove pre-2.8 code for bookmarks 2015-05-15 14:02:55 -07:00
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
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