Commit Graph

50 Commits

Author SHA1 Message Date
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
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
Felipe Contreras
b4e956f7ef remote-hg: add support for remote pushing
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
23b4a11fa4 remote-hg: add support for pushing
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
5085a4e2e8 Add new remote-hg transport helper
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