Commit graph

78 commits

Author SHA1 Message Date
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