aboutsummaryrefslogtreecommitdiff
path: root/contrib/remote-helpers
Commit message (Collapse)AuthorAge
* Revert "Merge branch 'jc/graduate-remote-hg-bzr' (early part)"Junio C Hamano2014-05-20
| | | | | | | | | 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>
* remote-helpers: point at their upstream repositoriesJunio C Hamano2014-05-19
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* contrib: remote-helpers: add move warnings (v2.0)Felipe Contreras2014-05-19
| | | | | | | | 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>
* Merge branch 'fc/remote-helper-fixes'Junio C Hamano2014-04-18
|\ | | | | | | | | | | | | | | | | * 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
| * remote-bzr: trivial test fixFelipe Contreras2014-04-14
| | | | | | | | | | | | | | 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>
| * remote-bzr: include authors field in pushed commitsdequis2014-04-09
| | | | | | | | | | | | 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>
| * remote-bzr: add support for older versionsFelipe Contreras2014-04-09
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * remote-hg: always normalize pathsFelipe Contreras2014-04-09
| | | | | | | | | | | | | | | | 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>
| * remote-helpers: allow all tests running from any dirFelipe Contreras2014-04-09
| | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'ap/remote-hg-skip-null-bookmarks'Junio C Hamano2014-04-02
|\ \ | | | | | | | | | | | | * ap/remote-hg-skip-null-bookmarks: remote-hg: do not fail on invalid bookmarks
| * | remote-hg: do not fail on invalid bookmarksMax Horn2014-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'fc/transport-helper-fixes'Junio C Hamano2014-03-18
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | remote-bzr: support the new 'force' optionRichard Hansen2014-02-24
| | | | | | | | | | | | | | | | | | 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>
| * | test-hg.sh: tests are now expected to passRichard Hansen2014-02-24
| | | | | | | | | | | | | | | Signed-off-by: Richard Hansen <rhansen@bbn.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | remote-hg: test 'shared_path' in a moved cloneAntoine Pelisse2013-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | remote-hg: add tests for special filenamesFelipe Contreras2013-12-09
| | | | | | | | | | | | | | | | | | | | | 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>
* | | remote-hg: fix 'shared path' pathFelipe Contreras2013-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | remote-helpers: add extra safety checksFelipe Contreras2013-12-09
| | | | | | | | | | | | | | | | | | 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>
* | | remote-hg: avoid buggy strftime()jcb912013-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | remote-bzr, remote-hg: fix email address regular expressionRichard Hansen2013-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | test-hg.sh: help user correlate verbose output with email testRichard Hansen2013-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | test-hg.sh: fix duplicate content strings in author testsRichard Hansen2013-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | "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>
* | | test-hg.sh: avoid obsolete 'test' syntaxRichard Hansen2013-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | test-hg.sh: eliminate 'local' bashismRichard Hansen2013-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | test-bzr.sh, test-hg.sh: prepare for change to push.default=simpleRichard Hansen2013-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | test-bzr.sh, test-hg.sh: allow running from any dirFelipe Contreras2013-11-18
| |/ |/| | | | | | | | | | | | | | | | | | | | | 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>
* | remote-hg: don't decode UTF-8 paths into Unicode objectsRichard Hansen2013-11-18
| | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'ap/remote-hg-unquote-cquote'Junio C Hamano2013-11-01
|\ \ | |/ |/| | | | | | | | | | | | | 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
| * remote-hg: unquote C-style paths when exportingAntoine Pelisse2013-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'fc/contrib-bzr-hg-fixes'Junio C Hamano2013-09-18
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * | contrib/remote-helpers: quote variable references in redirection targetsJunio C Hamano2013-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | contrib/remote-helpers: style updates for test scriptsJunio C Hamano2013-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | remote-hg: use notes to keep track of Hg revisionsFelipe Contreras2013-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | remote-helpers: cleanup more global variablesFelipe Contreras2013-08-29
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | remote-helpers: trivial style fixesFelipe Contreras2013-08-29
| | | | | | | | | | | | | | | | | | | | | In accordance with pep8. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | remote-hg: improve basic testFelipe Contreras2013-08-29
| | | | | | | | | | | | | | | | | | | | | 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>
| * | remote-hg: add missing &&s in the testFelipe Contreras2013-08-29
| | | | | | | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | remote-hg: fix testFelipe Contreras2013-08-29
| | | | | | | | | | | | | | | | | | | | | 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>
| * | remote-bzr: make bzr branches configurable per-repoFelipe Contreras2013-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | remote-bzr: fix export of utf-8 authorsFelipe Contreras2013-08-29
| |/ | | | | | | | | | | 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>
* | remote-bzr: reuse bzrlib transports when possibleRichard Hansen2013-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'fc/remote-hg-shared-setup'Junio C Hamano2013-09-04
|\ \ | | | | | | | | | | | | | | | * fc/remote-hg-shared-setup: remote-hg: add shared repo upgrade remote-hg: ensure shared repo is initialized
| * | remote-hg: add shared repo upgradeFelipe Contreras2013-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | remote-hg: ensure shared repo is initializedFelipe Contreras2013-08-11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | remote-hg: fix path when cloning with tilde expansionAntoine Pelisse2013-08-09
|/ | | | | | | | | | | | | | 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>
* Merge branch 'fc/remote-bzr'Junio C Hamano2013-06-11
|\ | | | | | | | | | | | | | | | | | | | | | | * 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
| * remote-bzr: add fallback check for a partial cloneFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * remote-bzr: reorganize the way 'wanted' worksFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | | | | | | | If the user specified a list of branches, we ignore what the remote repository lists, and simply use the branches directly. Since some remotes don't report the branches correctly, this is useful. Otherwise either fetch the repo, or the branch. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * remote-bzr: trivial cleanupsFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * remote-bzr: change global repoFelipe Contreras2013-05-28
| | | | | | | | | | | | | | It's not used anyway. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>