Commit graph

253 commits

Author SHA1 Message Date
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 0c27c12d21 remote-hg: tests: fix hg merge
Let's specify a merge tool, otherwise mercurial might open one and hang
our tests waiting for user input.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-21 11:59:48 -07:00
Felipe Contreras 02a607260f remote-helpers: tests: use python directly
These remote helpers use 'env python', not PYTHON_PATH, so that's where
we should check for the extensions. Otherwise, if 'python' is not
PYTHON_PATH (e.g. /usr/bin/python: Makefile's default), there will be a
mismatch between the python libraries actually accessible to the remote
helpers.

Suggested by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-21 11:59:44 -07:00
Felipe Contreras 5e49f30c85 remote-hg: fix order of configuration comments
The other configurations were added in the wrong place.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-21 09:33:24 -07:00
Felipe Contreras 92c4369907 remote-hg: trivial configuration note cleanup
Follow the style of the previous configurations.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-21 09:33:21 -07:00
Amit Bakshi 5dbe064d8c remote-hg: set stdout to binary mode on win32
git clone hangs on windows, and file.write would return errno 22 inside
of mercurial's windows.winstdout wrapper class. This patch sets stdout's
mode to binary, fixing both issues.

[fc: cleaned up]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-20 11:18:43 -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 629b60a77d Revert "remote-hg: update bookmarks when pulling"
This reverts commit 24317ef32a.

Different versions of Mercurial have different arguments for
bookmarks.updatefromremote(), while it should be possible to call the
right function with the right arguments depending on the version, it's
safer to restore the old behavior for now.

Reported by Rodney Lorrimar.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 15:54:18 -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
Junio C Hamano 0c2b1cf812 Merge branch 'fc/remote-hg' (early part)
* 'fc/remote-hg' (early part):
  remote-hg: update bookmarks when pulling
  remote-hg: don't push fake 'master' bookmark
  remote-hg: disable forced push by default
  remote-hg: fix new branch creation
  remote-hg: add new get_config_bool() helper
  remote-hg: enable track-branches in hg-git mode
  remote-hg: get rid of unused exception checks
  remote-hg: trivial cleanups
2013-05-15 14:58:56 -07:00
Felipe Contreras 24317ef32a remote-hg: update bookmarks when pulling
Otherwise, the user would never ever see new bookmarks, only the
ones that (s)he initially cloned.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:41:13 -07:00
Felipe Contreras 9ed920a680 remote-hg: don't push fake 'master' bookmark
We skip it locally, but not for the remote, so let's do so.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:40:59 -07:00
Felipe Contreras 06f4213355 remote-hg: disable forced push by default
In certain situations we might end up pushing garbage revisions
(e.g. in a rebase), and the patches to deal with that haven't been
merged yet.  So let's disable forced pushes by default.

We are essentially reverting back to the old v1.8.2 behavior, to
minimize the possibility of regressions, but in a way the user can
configure.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:40:16 -07:00
Felipe Contreras 637333673a remote-hg: fix new branch creation
When a user creates a new branch with git:

 % git checkout -b branches/devel

and then pushes this branch

 % git push origin branches/devel

which is the way to push new mercurial branches, we do want to
create a branch, but the command would fail without newbranch=True.

This only matters when force_push=False, but setting newbranch=True
unconditionally does not hurt.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:35:51 -07:00
Felipe Contreras 760ee1c70a remote-hg: add new get_config_bool() helper
No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:33:39 -07:00
Felipe Contreras 679e87c02b remote-hg: enable track-branches in hg-git mode
The user can turn this off.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:33:15 -07:00
Felipe Contreras 557399e9bd remote-hg: get rid of unused exception checks
Remove try/except check because we are no longer calling
check_output(), which may throw an exception.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:31:54 -07:00
Felipe Contreras eb7976e7dd remote-hg: trivial cleanups
Drop unused "global", and remove redundant comparison of two files.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15 12:30:36 -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
Torsten Bögershausen 8d97506e4b test-bzr: do not use unportable sed '\+'
Using sed -e '/[0-9]\+//' to find "one or more digits" is not
portable.

Use the Basic Regular Expression '/[0-9][0-9]*//' instead.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-11 12:51:19 -07:00
Felipe Contreras 0df860383e remote-helpers: trivial cleanup
The comment was copied from hg-fast-export, not used anymore.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-07 22:42:20 -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
Felipe Contreras c80f4c7763 remote-bzr: cleanup CustomTree
This code was not used at all.

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 877ee9cc7e remote-bzr: strip extra newline
It's added by fast-export, the user didn't type it.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:27 -07:00
Felipe Contreras 4d74cd4725 remote-bzr: tell bazaar to be quiet
Otherwise we get notification, progress bars, and what not.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:27 -07:00
Felipe Contreras d82c912c43 remote-bzr: store converted URL
Bazaar might convert the URL to something more appropriate, like an
absolute path. Lets store that instead of the original URL, which won't
work from a different working directory if it's relative.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:27 -07:00
Felipe Contreras 6134caf2c1 remote-hg: use hashlib instead of hg sha1 util
To be in sync with remote-bzr.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:27 -07:00
Felipe Contreras aa93845661 remote-bzr: add support to push URLs
Just like in remote-hg.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:27 -07:00
Felipe Contreras d6bb9136c9 remote-bzr: fix bad state issue
Carried from remote-hg.

The problem reportedly happened after doing a push that fails, the abort
causes the state of remote-hg to go bad, this happens because
remote-hg's marks are not stored, but 'git fast-export' marks are.

Ensure that the marks are _always_ stored.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:26 -07:00
Felipe Contreras 23df5e40f0 remote-hg: remove extra check
Not needed since we use xrange ourselves.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:26 -07:00
Felipe Contreras 75301a4588 remote-helpers: trivial cleanups
No functional changes. Typos, unused variables, redundant operations,
and white-spaces.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 15:20:26 -07:00
Junio C Hamano c8c82b1ba3 Merge branch 'fc/remote-hg'
* fc/remote-hg:
  remote-hg: strip extra newline
  remote-hg: use marks instead of inlined files
  remote-hg: small performance improvement
  remote-hg: allow refs with spaces
  remote-hg: don't update bookmarks unnecessarily
  remote-hg: add support for schemes extension
  remote-hg: improve email sanitation
  remote-hg: add custom local tag write code
  remote-hg: write tags in the appropriate branch
  remote-hg: custom method to write tags
  remote-hg: add support for tag objects
  remote-hg: add branch_tip() helper
  remote-hg: properly mark branches up-to-date
  remote-hg: use python urlparse
  remote-hg: safer bookmark pushing
  remote-helpers: avoid has_key
2013-04-26 15:19:03 -07:00
Junio C Hamano df8597258e Merge branch 'fc/remote-bzr'
* fc/remote-bzr:
  remote-bzr: use proper push method
2013-04-26 15:18:26 -07:00
Junio C Hamano e27004e341 Sync with 1.8.2.2 2013-04-26 13:00:48 -07:00
Torsten Bögershausen 86c5e148c9 test-hg-hg-git.sh: do not use export X=Y
The shell syntax "export X=Y" is not understood by all shells.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 09:53:52 -07:00
Torsten Bögershausen 93cd8d970b test-hg-bidi.sh: do not use export X=Y
The shell syntax "export X=Y A=B" is not understood by all shells.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-26 09:53:31 -07:00
Felipe Contreras fbd3f0e53c remote-bzr: use proper push method
Do not just randomly synchronize the revisions with no checks at
all.

I don't have any evidence that there's anything wrong with the
current code, which Bazaar seems to use, but for different purposes.
Let's use the logic Bazaar UI uses to avoid surprises.

Also, add a non-ff check.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-25 15:34:37 -07:00
Felipe Contreras 160695949a remote-hg: strip extra newline
There's no functional change since mercurial commit operation strips
that anyway, but that's no excuse for us not to do the right thing. So
let's be explicit about it.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:33:37 -07:00
Felipe Contreras 97253a2332 remote-hg: use marks instead of inlined files
So that we can find already exported ones. We can never be 100% sure
that we already exported such data, due to mercurial design, it at least
sometimes we should detect them, and so should give us some performance
boost.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:33:32 -07:00
Felipe Contreras 1a2636c297 remote-hg: small performance improvement
Load previous manifest first as Mercurial does; for caching reasons.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:55 -07:00
Felipe Contreras b0f6c5835d remote-hg: allow refs with spaces
Mercurial supports them, Git doesn't.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:55 -07:00
Felipe Contreras 7c0580586f remote-hg: don't update bookmarks unnecessarily
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:55 -07:00
Felipe Contreras 891122266f remote-hg: add support for schemes extension
So that we can use shortened URLs, for example 'bb:://felipec/repo'
(Bitbucket).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:55 -07:00
Felipe Contreras a2e462c5b5 remote-hg: improve email sanitation
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:54 -07:00
Felipe Contreras a2f7b6f8a9 remote-hg: add custom local tag write code
There's no point in calling the tag method for such simple action. Not
that we care much about the hg-git compat mode, it's mostly just for
comparison testing purposes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:54 -07:00
Felipe Contreras e1760f8c2c remote-hg: write tags in the appropriate branch
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:54 -07:00
Felipe Contreras 68d4f4f3e9 remote-hg: custom method to write tags
The one from mercurial is meant for users, on top of the latest tip.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:54 -07:00
Felipe Contreras 299789c22c remote-hg: add support for tag objects
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:54 -07:00
Felipe Contreras aeebca0bd2 remote-hg: add branch_tip() helper
Idea from gitifyhg, the backwards compatibility is how Mercurial used to
do it.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:53 -07:00
Felipe Contreras 7e31e1fea5 remote-hg: properly mark branches up-to-date
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:53 -07:00
Felipe Contreras 846cc77676 remote-hg: use python urlparse
It's simpler, and we don't need to depend on certain Mercurial versions.

Also, now we don't update the URL if 'file://' is not present.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:53 -07:00
Felipe Contreras e5ea5e7547 remote-hg: safer bookmark pushing
It is possible that the remote has changed the bookmarks, so let's fetch
them before we make any assumptions, just the way mercurial does.

Probably doesn't make a difference, but better be safe than sorry.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:53 -07:00
Dusty Phillips 3473ecd7ff remote-helpers: avoid has_key
It is deprecated.

[fc: do the same in remote-bzr]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22 15:25:53 -07:00
Junio C Hamano 37d32de72a Merge branch 'fc/remote-hg'
Updates remote-hg helper (in contrib/).

* fc/remote-hg: (21 commits)
  remote-hg: activate graphlog extension for hg_log()
  remote-hg: fix bad file paths
  remote-hg: document location of stored hg repository
  remote-hg: fix bad state issue
  remote-hg: add 'insecure' option
  remote-hg: add simple mail test
  remote-hg: add basic author tests
  remote-hg: show more proper errors
  remote-hg: force remote push
  remote-hg: push to the appropriate branch
  remote-hg: update tags globally
  remote-hg: update remote bookmarks
  remote-hg: refactor export
  remote-hg: split bookmark handling
  remote-hg: redirect buggy mercurial output
  remote-hg: trivial test cleanups
  remote-hg: make sure fake bookmarks are updated
  remote-hg: fix for files with spaces
  remote-hg: properly report errors on bookmark pushes
  remote-hg: add missing config variable in doc
  ...
2013-04-21 18:39:58 -07:00
Junio C Hamano c5926ac377 Merge branch 'maint'
* maint:
  remote-hg: fix commit messages
2013-04-18 12:03:01 -07:00
Felipe Contreras 845241d544 remote-hg: fix commit messages
git fast-import expects an extra newline after the commit message data,
but we are adding it only on hg-git compat mode, which is why the
bidirectionality tests pass.

We should add it unconditionally.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-17 23:41:25 -07:00
Felipe Contreras afad200558 remote-bzr: fix prefix of tags
In the current transport-helper code, refs without namespaced refspecs don't
work correctly, so let's always use them.

Some people reported issues with 'git clone --mirror', and this fixes them, as
well as possibly others.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15 16:08:40 -07:00
Torsten Bögershausen 924f6c3d39 test-bzr: portable shell and utf-8 strings for Mac OS
Make the shell script more portable:
- Split export X=Y into 2 lines
- Use printf instead of echo -e

Use UTF-8 code points which are not decomposed by the filesystem:
 Code points like "á" will be decomposed by Mac OS X.
 bzr is unable to find the file "á" on disk.
 Use code points from unicode which can not be decomposed.
 In other words, the precompsed form use the same bytes as decomposed.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Acked-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12 14:58:08 -07:00
Antoine Pelisse 9a57988b3f remote-hg: activate graphlog extension for hg_log()
The hg_log() test helper uses the "--graph" parameter that is
implemented by the GraphLog extension. If the extension is not activated
by the user, the parameter is not available. Activate the extension in
setup().

Also changes the way we grep the output in hg_log(). The pipe operator
can hide the return code of hg command. As a matter of fact, if log
fails because it doesn't know about "--graph", it doesn't report any
failure and let's you think everything worked.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:48 -07:00
Felipe Contreras 20c4b59c35 remote-hg: fix bad file paths
Mercurial allows absolute file paths, and Git doesn't like that.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:48 -07:00
Simon Ruderich 7b21ec24a5 remote-hg: document location of stored hg repository
Signed-off-by: Simon Ruderich <simon@ruderich.org>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:48 -07:00
Felipe Contreras 2594a79ea9 remote-hg: fix bad state issue
The problem reportedly happened after doing a push that fails, the abort
causes the state of remote-hg to go bad, this happens because
remote-hg's marks are not stored, but 'git fast-export' marks are.

Ensure that the marks are _always_ stored.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Simon Ruderich 2e8e813232 remote-hg: add 'insecure' option
If set to true acts as hg's clone/pull --insecure option.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras b3ab6fd1ac remote-hg: add simple mail test
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras 6181b9a63c remote-hg: add basic author tests
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras cbf6237c2b remote-hg: show more proper errors
When cloning or pushing fails, we don't want to show a stack-trace.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras b0c3db860c remote-hg: force remote push
Ideally we shouldn't do this, as it's not recommended in mercurial
documentation, but there's no other way to push multiple bookmarks (on
the same branch), which would be the behavior most similar to git.

At the same time, add a configuration option for the people that don't
want to risk creating new remote heads.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Dusty Phillips 11dc88f49c remote-hg: push to the appropriate branch
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras 7a6c1859b6 remote-hg: update tags globally
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras d7314b3acf remote-hg: update remote bookmarks
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras 0ff1b61770 remote-hg: refactor export
No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras f04f489f6b remote-hg: split bookmark handling
Will be useful for remote bookmarks.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:47 -07:00
Felipe Contreras 25027b983e remote-hg: redirect buggy mercurial output
Mercurial emits messages like "searching for changes", "no changes
found", etc. meant for the use of its own UI layer, which break the pipe
between transport helper and remote helper.

Since there's no way to silence Mercurial, let's redirect to standard
error.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:46 -07:00
Felipe Contreras 71c6c95c31 remote-hg: trivial test cleanups
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:46 -07:00
Felipe Contreras 8120014e2b remote-hg: make sure fake bookmarks are updated
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:46 -07:00
Peter van Zetten 15a8d901dd remote-hg: 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-04-11 10:46:46 -07:00
Felipe Contreras 031873f8f1 remote-hg: properly report errors on bookmark pushes
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:46 -07:00
Dusty Phillips e1219e45bd remote-hg: add missing config variable in doc
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:46 -07:00
Felipe Contreras a57ad51d1a remote-hg: trivial cleanups
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11 10:46:46 -07:00
Felipe Contreras fa7285dc3d remote-bzr: improve tag handling
revision_history() is deprecated and doesn't do what we want (revno
instead of dotted_revno?).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-08 14:17:07 -07:00
Christophe Simonis 5ff4fc649e remote-bzr: fix utf-8 support for fetching
The previous patches didn't deal with all the scenarios.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-08 14:09:31 -07:00
Junio C Hamano 52a3e011c7 Sync with 1.8.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 15:28:50 -07:00
Junio C Hamano 41e9da40a8 Merge branch 'fc/remote-helpers-test-updates'
* fc/remote-helpers-test-updates:
  remote-hg: fix hg-git test-case
  remote-bzr: remove stale check code for tests
  remote-helpers: fix the run of all tests
  remote-bzr: avoid echo -n
2013-04-07 14:33:02 -07:00
Junio C Hamano 6466fbbeef Sync with 1.8.1.6 2013-04-07 13:17:50 -07:00
Torsten Bögershausen 0e9b327227 remote-helpers/test-bzr.sh: do not use "grep '\s'"
Using grep "devel\s\+3:" to find at least one whitspace is not
portable on all grep versions; not all grep versions understand "\s"
as a "whitespace".

Use a literal TAB followed by SPACE.

The + as a qualifier for "one or more" is not a basic regular
expression; use egrep instead of grep.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 08:41:34 -07:00
Felipe Contreras 6ff8d4e748 remote-bzr: add utf-8 support for pushing
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:39:28 -07:00
Timotheus Pokorra 5445b24e22 remote-bzr: add utf-8 support for fetching
[fc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:39:27 -07:00
Felipe Contreras 8954441ac7 remote-bzr: avoid unreferred tags
They have no content, there's nothing we can do with them.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:39:27 -07:00
Felipe Contreras f00f2511d9 remote-bzr: only update workingtree on local repos
Apparently, that's the only way it's possible.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:39:27 -07:00
David Engster 9d9d698c43 remote-bzr: set author if available
[fc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:39:27 -07:00
Christophe Simonis bc51f7c3e2 remote-bzr: remove files before modifications
Allow re-add of a deleted file in the same commit.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:39:26 -07:00
Christophe Simonis 82447e3361 remote-bzr: fix directory renaming
Git does not handle directories, renaming a directory is renaming every
files in this directory.

[fc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07 00:39:26 -07:00
Felipe Contreras 091e051e88 remote-hg: fix hg-git test-case
There was some lingering code that shouldn't have been there in the
first place.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04 09:35:51 -07:00
Felipe Contreras c0e1ba4e17 remote-bzr: remove stale check code for tests
The fastimport plugin was only required in the early stage of
development.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04 09:35:42 -07:00
Felipe Contreras e4f0e34c89 remote-helpers: fix the run of all tests
We don't need to check for duplicate test numbers, we don't have them,
and either way test-lint-duplicates doesn't work in this situation.

Also, while we are on it, enable test-lint-shell-syntax to check for sh
errors.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04 09:35:20 -07:00
Felipe Contreras afeb525980 remote-bzr: avoid echo -n
It's not portable, as reported by test-lint.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04 09:35:00 -07:00
Junio C Hamano 864b5c41e4 Merge branch 'mh/remote-hg-mode-bits-fix'
Update to the Hg remote helper (in contrib/).

* mh/remote-hg-mode-bits-fix:
  remote-hg: fix handling of file perms when pushing
2013-01-21 20:15:40 -08:00
Max Horn 3968e302f8 remote-hg: fix handling of file perms when pushing
Previously, when changing and committing an executable file, the file
would loose its executable bit on the hg side. Likewise, symlinks ended
up as "normal" files". This was not immediately apparent on the git side
unless one did a fresh clone.

Signed-off-by: Max Horn <max@quendi.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-15 10:01:11 -08:00
Felipe Contreras e6bc8a3328 remote-hg: store converted URL
Mercurial might convert the URL to something more appropriate, like an
absolute path. Lets store that instead of the original URL, which won't
work from a different working directory if it's relative.

Suggested-by: Max Horn <max@quendi.de>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Max Horn <max@quendi.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-15 09:57:57 -08:00
Junio C Hamano a70472f4d6 Merge branch 'fc/remote-bzr'
New remote helper for bzr, with minimum fix squashed in.

* fc/remote-bzr:
  remote-bzr: detect local repositories
  remote-bzr: add support for older versions of bzr
  remote-bzr: add support to push special modes
  remote-bzr: add support for fecthing special modes
  remote-bzr: add simple tests
  remote-bzr: update working tree upon pushing
  remote-bzr: add support for remote repositories
  remote-bzr: add support for pushing
  Add new remote-bzr transport helper
2013-01-09 08:26:26 -08:00
W. Trevor King 831d57a0f5 remote-hg: Fix biridectionality -> bidirectionality typos
Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-08 09:37:05 -08:00
Felipe Contreras 073c3ffa58 remote-bzr: detect local repositories
So we don't create a clone unnecessarily.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-02 20:07:00 -08:00
Felipe Contreras 570e7ecd4a remote-bzr: add support for older versions of bzr
At least as old as 2.0.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-02 20:06:59 -08:00
Felipe Contreras 7edea5c958 remote-bzr: add support to push special modes
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-02 20:06:59 -08:00
Felipe Contreras bdeeb809d7 remote-bzr: add support for fecthing special modes
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-02 20:06:59 -08:00
Felipe Contreras 77b71edfb5 remote-bzr: add simple tests
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-02 20:06:59 -08:00
Felipe Contreras adec972e52 remote-bzr: update working tree upon pushing
A 'git push' doesn't update the working directory on the remote, but
a 'bzr push' does.  Teach the remote helper for bzr to update the
working tree on the bzr side upon pushing via the "export" command.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-13 15:55:41 -08:00
Felipe Contreras dc2177c21c remote-bzr: add support for remote repositories
Strictly speaking bzr doesn't need any changes to interact with remote
repositories, but it's dead slow.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-28 09:39:11 -08:00
Felipe Contreras f04977168f remote-bzr: add support for pushing
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-28 09:39:11 -08:00
Felipe Contreras bee118ec04 Add new remote-bzr transport helper
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-28 09:39:11 -08:00
Felipe Contreras 1e310551e7 remote-hg: fix for older versions of python
As Amit Bakshi reported, older versions of python (< 2.7) don't have
subprocess.check_output, so let's use subprocess.Popen directly as
suggested.

Suggested-by: Amit Bakshi <ambakshi@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-27 18:04:00 -08:00
Felipe Contreras 418673c4bc remote-hg: fix for files with spaces
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-27 18:03:57 -08:00
Felipe Contreras 08c2599c32 remote-hg: avoid bad refs
Turns out fast-export throws bad 'reset' commands because of a behavior
in transport-helper that is not even needed.

Either way, better to ignore them, otherwise the user will get warnings
when we OK them.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-12 15:34:53 -05:00
Felipe Contreras 55dd56e042 remote-hg: try the 'tip' if no checkout present
There's no concept of HEAD in mercurial, but let's try our best to do
something sensible.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-12 15:34:53 -05:00
Felipe Contreras cc8433fad1 remote-hg: fix compatibility with older versions of hg
Turns out repo.revs was introduced quite late, and it doesn't do
anything fancy for our refspec; only list all the numbers in that range.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-12 15:34:53 -05:00
Ramkumar Ramachandra 7241a9ffab remote-hg: add missing config for basic tests
'hg commit' fails otherwise in some versions of mercurial because of
the missing user information. Other versions simply throw a warning and
guess though.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-12 15:34:53 -05:00
Felipe Contreras 12ba4bd4ec remote-hg: the author email can be null
Like 'Foo <>'.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-04 08:35:21 -05:00
Felipe Contreras e30473c185 remote-hg: add option to not track branches
Some people prefer it this way.

 % git config --global remote-hg.track-branches false

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-04 08:35:21 -05:00
Felipe Contreras aefc605ada remote-hg: add extra author test
For hg.hg.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-04 08:35:21 -05:00
Felipe Contreras bb8a956409 remote-hg: add tests to compare with hg-git
The base commands come from the tests of the hg-git project.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-04 08:35:21 -05:00
Felipe Contreras 74954ee8aa remote-hg: add bidirectional tests
Base commands from hg-git tests:
https://bitbucket.org/durin42/hg-git/src

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-04 08:35:21 -05:00
Felipe Contreras 7ee719e180 remote-hg: add basic tests
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-04 08:35:20 -05:00
Felipe Contreras 46cc3adb60 remote-hg: fake bookmark when there's none
Or at least no current bookmark.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-04 08:35:20 -05:00
Felipe Contreras 9490bd04fe remote-hg: add compat for hg-git author fixes
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-04 08:35:20 -05:00
Felipe Contreras 422ab5beb2 remote-hg: add support for hg-git compat mode
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-04 08:35:20 -05:00
Felipe Contreras 6497a2bab5 remote-hg: match hg merge behavior
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-04 08:35:20 -05:00
Felipe Contreras ff247d9e56 remote-hg: make sure the encoding is correct
Independently of the environment.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-04 08:35:20 -05:00
Felipe Contreras ffaf84c663 remote-hg: add support to push URLs
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
2012-11-04 08:35:20 -05:00