Commit graph

79 commits

Author SHA1 Message Date
Sebastian Schuberth b8686c661d contrib: git-remote-{bzr,hg} placeholders don't need Python
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>
2017-03-03 11:09:34 -08:00
Junio C Hamano b2c851a8e6 Revert "Merge branch 'jc/graduate-remote-hg-bzr' (early part)"
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-20 14:48:11 -07:00
Felipe Contreras 0311086351 contrib: remote-helpers: add move warnings (v2.0)
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-05-19 17:10:03 -07:00
Junio C Hamano 8f87d548b6 Merge branch 'fc/remote-helper-fixes'
* 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-18 11:17:40 -07:00
dequis 62210887f7 remote-bzr: include authors field in pushed commits
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-09 14:20:48 -07:00
Felipe Contreras 5ff569908d remote-bzr: add support for older versions
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-04-09 14:20:48 -07:00
Junio C Hamano 90e6255a6d Merge branch 'fc/transport-helper-fixes'
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-03-18 13:49:33 -07:00
Richard Hansen a7cb1276cc remote-bzr: support the new 'force' option
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-24 09:04:27 -08:00
Felipe Contreras 0c0ebc1fdf remote-helpers: add extra safety checks
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-09 13:18:43 -08:00
Richard Hansen 6c68a404e6 remote-bzr, remote-hg: fix email address regular expression
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-18 13:46:00 -08:00
Junio C Hamano 751e2b3718 Merge branch 'fc/contrib-bzr-hg-fixes'
* 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-18 11:45:49 -07:00
Richard Hansen bd5424f0d6 remote-bzr: reuse bzrlib transports when possible
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-08 11:15:33 -07:00
Felipe Contreras 641a2b5bee remote-helpers: cleanup more global variables
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-29 11:40:57 -07:00
Felipe Contreras 670dda85d6 remote-helpers: trivial style fixes
In accordance with pep8.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-29 11:40:56 -07:00
Felipe Contreras a11b0ac9e1 remote-bzr: make bzr branches configurable per-repo
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-29 11:40:51 -07:00
Felipe Contreras a8c0b74718 remote-bzr: fix export of utf-8 authors
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-29 11:39:45 -07:00
Junio C Hamano 221ea21e88 Merge branch 'fc/remote-bzr'
* 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-06-11 13:30:26 -07:00
Felipe Contreras 8316d18da3 remote-helpers: improve marks usage
Always convert to strings (they are unicode because they come from JSON).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 08:02:24 -07:00
Felipe Contreras 85f931d3d5 remote-bzr: add fallback check for a partial clone
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:25 -07:00
Felipe Contreras e56660a73f remote-bzr: reorganize the way 'wanted' works
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>
2013-05-28 07:43:25 -07:00
Felipe Contreras a8ffc3ade2 remote-bzr: trivial cleanups
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:18 -07:00
Felipe Contreras 0454c399c9 remote-bzr: change global repo
It's not used anyway.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:18 -07:00
Felipe Contreras 2ae078e847 remote-bzr: delay cloning/pulling
Until the branch is actually going to be used.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:18 -07:00
Felipe Contreras 1bf09d4fbf remote-bzr: simplify get_remote_branch()
No need for 'origin', it's only needed for the bzrdir 'sprout' method,
which can be greatly simplified.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:18 -07:00
Felipe Contreras ad44a72095 remote-bzr: fix for files with spaces
Set the maximum number of splits to make when dividing the diff stat
lines based on space characters.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:18 -07:00
Felipe Contreras 99a4fdb950 remote-bzr: recover from failed clones
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28 07:43:18 -07:00
Felipe Contreras 31eb360b43 remote-bzr: fixes for older versions of bzr
Down to v2.0, by using older but still valid interfaces.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-17 11:43:36 -07:00
Sandor Bodo-Merle a70ae5873d remote-bzr: fix old organization destroy
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-17 10:59:08 -07:00
Felipe Contreras 4f4e7e9b62 remote-bzr: fix cloning of non-listable repos
Commit 95b0c60 (remote-bzr: add support for bzr repos) introduced a
regression by assuming all bzr remote repos are listable, but they are
not.

If they are not listable they are basically useless, so let's assume
there is no bzr repo.

Reported-by: Thorsten Kranzkowski <dl8bcu@dl8bcu.de>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 09:29:26 -07:00
Felipe Contreras 6a3ac18ba3 remote-bzr: update old organization
If a clone exists with the old organization (v1.8.2) it will prevent
the new shared bzr repository organization from working, so let's
remove this repository, which is not used any more.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-14 15:51:00 -07:00
Felipe Contreras 435f39a3e8 remote-bzr: fix for disappeared revisions
It's possible that the previous tip goes away, we should not assume it's
always present. Fortunately we are only using it to calculate the
progress to display to the user, so only that needs to be fixed.

Also, add a test that triggers this issue.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-07 22:38:40 -07:00
Felipe Contreras 4c00819910 remote-bzr: avoid bad refs
Versions of fast-export before v1.8.2 throws a bad 'reset' commands
because of a behavior in transport-helper that is not even needed.
We should ignore them, otherwise we will treat them as branches and
fail.

This was fixed in v1.8.2, but some people use this script in older
versions of git.

Also, check if the ref was a tag, and skip it for now.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-06 18:19:55 -07:00
Felipe Contreras 081811216e remote-bzr: convert all unicode keys to str
Otherwise some versions of bazaar might barf.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-06 09:18:52 -07:00
Felipe Contreras d421c02b41 remote-bzr: access branches only when needed
Bazaar doesn't seem to be tested for multiple usage of branches, so
resources seem to be leaked all over. Let's try to minimize this by
accessing the Branch objects only when needed.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 747c9a377f remote-bzr: delay peer branch usage
So it doesn't time out.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 38cecbdf52 remote-bzr: iterate revisions properly
This way we don't need to store the list of all the revisions, which
doesn't seem to be very memory efficient with bazaar's design, for
whatever reason.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras a397699950 remote-bzr: improve progress reporting
No need to manually count the revisions, and also, this would help to
iterate more properly.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 248663c4ff remote-bzr: add option to specify branches
We might not want all the branches. And branch handling in bazaar is
rather tricky, so it's safer to simply specify them.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 850dd25c9a remote-bzr: add custom method to find branches
The official method is incredibly inefficient and slow.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 3f6e7c0af1 remote-bzr: improve author sanitazion
So that we don't end up with '<None>', and also synchronize it with the
one from remote-hg.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras c95c35f4b8 remote-bzr: add support for shared repo
This way all the remotes share the same data, so adding multiple
remotes, or renaming them doesn't create extra overhead.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 42b48ef25d remote-bzr: fix branch names
When branches have '/' in their name (aka. sub-branches), bazaar seems
to choke while creating the new directory.

Also, git cannot have both 'foo' and 'foo/bar'.

So let's replace slashes with a plus sign.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 95b0c60831 remote-bzr: add support for bzr repos
In bazaar, a repository can contain multiple branches, and previously we
were supporting only one branch at a time. Now we fetch them all.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 5df4fad319 remote-bzr: use branch variable when appropriate
There should be no functional changes. Basically we want to reserve the
'repo' variable.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras b25df87fad remote-bzr: fix partially pushed merge
If part of the merge was already pushed, we don't have the blob_marks
available, however, the commits are already stored in bazaar, so we can
use the revision_tree to fetch the contents.

We want to do this only when there's no other option.

There's no easy way to test this.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras 38e7167e9b remote-bzr: fixes for branch diverge
If the branches diverge we want to reset the pointer to where the remote
actually is. Since we can access remote branches just as easily as local
ones, let's do so.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:47 -07:00
Felipe Contreras f38dfc4c32 remote-bzr: add support to push merges
In order to do that, we need to store the marks of every file, so that
they can be fetched when needed. Unfortunately we can't tell bazaar that
nothing changed, we need to send the data so that it can figure it out
by itself.

And since it will be requesting a bunch of information by the file_id,
it's better to have a helper dict (rev_files), so that we can fetch it
quickly.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:46 -07:00
Felipe Contreras 715d64fe99 remote-bzr: always try to update the worktree
And fail properly when we can't.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:46 -07:00
Felipe Contreras aa12a431f3 remote-bzr: fix order of locking in CustomTree
It doesn't seem to make any difference, but revision_tree() requires a
lock.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:46 -07:00
Felipe Contreras 1816620800 remote-bzr: delay blob fetching until the very end
Might be more efficient, but the real reason to use the marks will be
revealed in upcoming patches.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-30 22:06:46 -07:00