summaryrefslogtreecommitdiff
path: root/contrib/remote-helpers
AgeCommit message (Collapse)Author
2017-03-03contrib: git-remote-{bzr,hg} placeholders don't need PythonSebastian Schuberth
It does not make sense for these placeholder scripts to depend on Python just because the real scripts do. At the example of Git for Windows, we would not even be able to see those warnings as it does not ship with Python. So just use plain shell scripts instead. Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-20Revert "Merge branch 'jc/graduate-remote-hg-bzr' (early part)"Junio C Hamano
Instead of showing a warning and working as before, fail and show the message and force immediate upgrade from their upstream repositories when these tools are run, per request from their primary author. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-20remote-helpers: point at their upstream repositoriesJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-05-20contrib: remote-helpers: add move warnings (v2.0)Felipe Contreras
The tools are now maintained out-of-tree, and they have a regression in v2.0. It's better to start warning the users as soon as possible. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-04-18Merge branch 'fc/remote-helper-fixes'Junio C Hamano
* fc/remote-helper-fixes: remote-bzr: trivial test fix remote-bzr: include authors field in pushed commits remote-bzr: add support for older versions remote-hg: always normalize paths remote-helpers: allow all tests running from any dir
2014-04-14remote-bzr: trivial test fixFelipe Contreras
So that the committer is reset properly. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-04-09remote-bzr: include authors field in pushed commitsdequis
Tests-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-04-09remote-bzr: add support for older versionsFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-04-09remote-hg: always normalize pathsFelipe Contreras
Apparently Mercurial can have paths such as 'foo//bar', so normalize all paths. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-04-09remote-helpers: allow all tests running from any dirFelipe Contreras
Commit d3243d7 (test-bzr.sh, test-hg.sh: allow running from any dir) allowed the tests to run from any directory, however, it didn't update all the tests. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-04-02Merge branch 'ap/remote-hg-skip-null-bookmarks'Junio C Hamano
* ap/remote-hg-skip-null-bookmarks: remote-hg: do not fail on invalid bookmarks
2014-03-25remote-hg: do not fail on invalid bookmarksMax Horn
Mercurial can have bookmarks pointing to "nullid" (the empty root revision), while Git can not have references to it. When cloning or fetching from a Mercurial repository that has such a bookmark, the import failed because git-remote-hg was not be able to create the corresponding reference. Warn the user about the invalid reference, and do not advertise these bookmarks as head refs, but otherwise continue the import. In particular, we still keep track of the fact that the remote repository has a bookmark of the given name, in case the user wants to modify that bookmark. Also add some test cases for this issue. Reported-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Max Horn <max@quendi.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-18Merge branch 'fc/transport-helper-fixes'Junio C Hamano
Updates transport-helper, fast-import and fast-export to allow the ref mapping and ref deletion in a way similar to the natively supported transports. * fc/transport-helper-fixes: remote-bzr: support the new 'force' option test-hg.sh: tests are now expected to pass transport-helper.c: do not overwrite forced bit transport-helper: check for 'forced update' message transport-helper: add 'force' to 'export' helpers transport-helper: don't update refs in dry-run transport-helper: mismerge fix
2014-02-24remote-bzr: support the new 'force' optionRichard Hansen
Signed-off-by: Richard Hansen <rhansen@bbn.com> Acked-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-02-24test-hg.sh: tests are now expected to passRichard Hansen
Signed-off-by: Richard Hansen <rhansen@bbn.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-26remote-hg: test 'shared_path' in a moved cloneAntoine Pelisse
Since e71d1378 (remote-hg: fix 'shared path' path, 2013-12-07), Mercurial 'shared_path' file is correctly updated whenever a clone is moved. Make sure it keeps working, especially as this is depending on a private Mercurial file. Signed-off-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-09remote-hg: add tests for special filenamesFelipe Contreras
So that we check that UTF-8 and spaces work fine. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-09remote-hg: fix 'shared path' pathFelipe Contreras
If the repository is moved, the absolute path of the shared repository would fail. Make sure it's always up-to-date. Reported-by: Michael Davis <mjmdavis@gmail.com> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-09remote-helpers: add extra safety checksFelipe Contreras
Suggested-by: Roman Ovchinnikov <coolthecold@gmail.com> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-09remote-hg: avoid buggy strftime()jcb91
error on pull: fatal: Invalid raw date "" in ident: remote-hg <> Neither %s nor %z are officially supported by python, they may work on some (most?) platforms, but not all. removed strftime use of %s and %z, which are not officially supported by python, with standard formats Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-18remote-bzr, remote-hg: fix email address regular expressionRichard Hansen
Before, strings like "foo.bar@example.com" would be converted to "foo. <bar@example.com>" when they should be "unknown <foo.bar@example.com>". Signed-off-by: Richard Hansen <rhansen@bbn.com> Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-18test-hg.sh: help user correlate verbose output with email testRichard Hansen
It's hard to tell which author conversion test failed when the email addresses look similar. Signed-off-by: Richard Hansen <rhansen@bbn.com> Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-18test-hg.sh: fix duplicate content strings in author testsRichard Hansen
"beta" was used twice. Change the second copy to "gamma" and increment the remaining content strings. Signed-off-by: Richard Hansen <rhansen@bbn.com> Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-18test-hg.sh: avoid obsolete 'test' syntaxRichard Hansen
The POSIX spec says that the '-a', '-o', and parentheses operands to the 'test' utility are obsolete extensions due to the potential for ambiguity. Replace '-o' with '|| test' to avoid unspecified behavior. Signed-off-by: Richard Hansen <rhansen@bbn.com> Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-18test-hg.sh: eliminate 'local' bashismRichard Hansen
Unlike bash, POSIX shell does not specify a 'local' command for declaring function-local variable scope. Except for IFS, the variable names are not used anywhere else in the script so simply remove the 'local'. For IFS, move the assignment to the 'read' command to prevent it from affecting code outside the function. Signed-off-by: Richard Hansen <rhansen@bbn.com> Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-18test-bzr.sh, test-hg.sh: prepare for change to push.default=simpleRichard Hansen
Change 'git push <remote>' to 'git push <remote> <branch>' in one of the test-bzr.sh tests to ensure that the test continues to pass when the default value of push.default changes to simple. Signed-off-by: Richard Hansen <rhansen@bbn.com> Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-18test-bzr.sh, test-hg.sh: allow running from any dirFelipe Contreras
Set TEST_DIRECTORY to the t/ directory (if TEST_DIRECTORY is not already set) so that the user doesn't already have to be in the test directory to run these test scripts. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Based-on-patch-by: Richard Hansen <rhansen@bbn.com> Reviewed-by: Richard Hansen <rhansen@bbn.com> Signed-off-by: Richard Hansen <rhansen@bbn.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-18remote-hg: don't decode UTF-8 paths into Unicode objectsRichard Hansen
The internal mercurial API expects ordinary 8-bit string objects, not Unicode string objects. With this change, the test-hg.sh unit tests pass again. Signed-off-by: Richard Hansen <rhansen@bbn.com> Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-01Merge branch 'ap/remote-hg-unquote-cquote'Junio C Hamano
A fast-import stream expresses a pathname with funny characters by quoting them in C style; remote-hg remote helper forgot to unquote such a path. * ap/remote-hg-unquote-cquote: remote-hg: unquote C-style paths when exporting
2013-10-23remote-hg: unquote C-style paths when exportingAntoine Pelisse
git-fast-import documentation says that paths can be C-style quoted. Unfortunately, the current remote-hg helper doesn't unquote quoted path and pass them as-is to Mercurial when the commit is created. This results in the following situation: - clone a mercurial repository with git - add a file with space in a directory: `>dir/foo\ bar` - commit that new file, and push the change to mercurial - the mercurial repository now has a new directory named '"dir', which contains a file named 'foo bar"' Use Python str.decode('string-escape') to unquote the string if it starts and ends with ". It has been tested with quotes, spaces, and utf-8 encoded file-names. Signed-off-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-18Merge branch 'fc/contrib-bzr-hg-fixes'Junio C Hamano
* fc/contrib-bzr-hg-fixes: contrib/remote-helpers: quote variable references in redirection targets contrib/remote-helpers: style updates for test scripts remote-hg: use notes to keep track of Hg revisions remote-helpers: cleanup more global variables remote-helpers: trivial style fixes remote-hg: improve basic test remote-hg: add missing &&s in the test remote-hg: fix test remote-bzr: make bzr branches configurable per-repo remote-bzr: fix export of utf-8 authors
2013-09-08remote-bzr: reuse bzrlib transports when possibleRichard Hansen
Pass a list of open bzrlib.transport.Transport objects to each bzrlib function that might create a transport. This enables bzrlib to reuse existing transports when possible, avoiding multiple concurrent connections to the same remote server. If the remote server is accessed via ssh, this fixes a couple of problems: * If the user does not have keys loaded into an ssh agent, the user may be prompted for a password multiple times. * If the user is using OpenSSH and the ControlMaster setting is set to auto, git-remote-bzr might hang. This is because bzrlib closes the multiple ssh sessions in an undefined order and might try to close the master ssh session before the other sessions. The master ssh process will not exit until the other sessions have exited, causing a deadlock. (The ssh sessions are closed in an undefined order because bzrlib relies on the Python garbage collector to trigger ssh session termination.) Signed-off-by: Richard Hansen <rhansen@bbn.com> Acked-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-04Merge branch 'fc/remote-hg-shared-setup'Junio C Hamano
* fc/remote-hg-shared-setup: remote-hg: add shared repo upgrade remote-hg: ensure shared repo is initialized
2013-09-03contrib/remote-helpers: quote variable references in redirection targetsJunio C Hamano
Even though it is not required by POSIX to double-quote the redirection target in a variable, our code does so because some versions of bash issue a warning without the quotes. Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-03contrib/remote-helpers: style updates for test scriptsJunio C Hamano
During the review of the main series it was noticed that these test scripts can use updates to conform to our coding style better, but fixing the style should be done in a patch separate from the main series. This updates the test-*.sh scripts only for style issues: * We do not leave SP between a redirection operator and the filename; * We change line before "then", "do", etc. rather than terminating the condition for "if"/"while" and list for "for" with a semicolon; * When HERE document does not use any expansion, we quote the end marker (e.g. "cat <<\EOF" not "cat <<EOF") to signal the readers that there is no funny substitution to worry about when reading the code. * We use "test" rather than "[". Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-30remote-hg: use notes to keep track of Hg revisionsFelipe Contreras
Keep track of Mercurial revisions as Git notes under the 'refs/notes/hg' ref. This way, the user can easily see which Mercurial revision corresponds to certain Git commit. Unfortunately, there's no way to efficiently update the notes after doing an export (push), so they'll have to be updated when importing (fetching). Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29remote-helpers: cleanup more global variablesFelipe Contreras
They don't need to be specified if they are not going to be set. Suggested-by: Dusty Phillips <dusty@linux.ca> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29remote-helpers: trivial style fixesFelipe Contreras
In accordance with pep8. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29remote-hg: improve basic testFelipe Contreras
It appears 'let' is not present in all shells. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29remote-hg: add missing &&s in the testFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29remote-hg: fix testFelipe Contreras
It wasn't being checked properly before; those refs never existed. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29remote-bzr: make bzr branches configurable per-repoFelipe Contreras
Different repositories have different branches, some are are even branches themselves. Reported-by: Peter Niederlag <netservice@niekom.de> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29remote-bzr: fix export of utf-8 authorsFelipe Contreras
Reported-by: Joakim Verona <joakim@verona.se> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-12remote-hg: add shared repo upgradeFelipe Contreras
If we have an old organization (v1.8.3), and want to upgrade to a newer one (v1.8.4), the user would have to fetch the whole repository, instead we can just move the repository, so the user would not notice any difference. Also, remove other clones, so in time they get set up as shared. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Reviewed-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-12remote-hg: ensure shared repo is initializedFelipe Contreras
6796d49 (remote-hg: use a shared repository store) introduced a bug by making the shared repository '.git/hg', which is already used before that patch, so clones that happened before that patch, fail after that patch, because there's no shared Mercurial repo. So, instead of simply checking if the directory exists, let's always try to create an empty shared repository to ensure it's there. This works because we don't need the initial clone, if the repository is shared, pulling from the child updates the parent's storage; it's exactly the same as cloning, so we can simplify the shared repo setup this way while at the same time fixing the problem. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Reviewed-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-09remote-hg: fix path when cloning with tilde expansionAntoine Pelisse
The current code fixes the path to make it absolute when cloning, but doesn't consider tilde expansion, so that scenario fails throwing an exception because /home/myuser/~/my/repository doesn't exists: $ git clone hg::~/my/repository && cd repository && git fetch Expand the tilde when checking if the path is absolute, so that we don't fix a path that doesn't need to be. Signed-off-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-11Merge branch 'fc/remote-bzr'Junio C Hamano
* fc/remote-bzr: remote-bzr: add fallback check for a partial clone remote-bzr: reorganize the way 'wanted' works remote-bzr: trivial cleanups remote-bzr: change global repo remote-bzr: delay cloning/pulling remote-bzr: simplify get_remote_branch() remote-bzr: fix for files with spaces remote-bzr: recover from failed clones
2013-05-28remote-hg: add support for --forceFelipe Contreras
And get rid of the remote-hg.force-push option hack. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: add support for --dry-runFelipe Contreras
This needs a specific patch from Git not applied yet. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: check if a fetch is neededFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>