summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)AuthorFilesLines
2013-04-22remote-hg: properly mark branches up-to-dateLibravatar Felipe Contreras1-0/+4
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-22remote-hg: use python urlparseLibravatar Felipe Contreras1-4/+5
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-22remote-hg: safer bookmark pushingLibravatar Felipe Contreras1-0/+2
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-22remote-helpers: avoid has_keyLibravatar Dusty Phillips2-2/+2
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-21Merge branch 'fc/remote-hg'Libravatar Junio C Hamano4-29/+148
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-18Merge branch 'maint'Libravatar Junio C Hamano1-1/+2
* maint: remote-hg: fix commit messages
2013-04-18Merge branch 'fc/completion'Libravatar Junio C Hamano1-45/+33
In addition to a user visible change to offer more options to cherry-pick, generally cleans up and simplifies the code. * fc/completion: completion: small optimization completion: inline __gitcomp_1 to its sole callsite completion: get rid of compgen completion: add __gitcomp_nl tests completion: add new __gitcompadd helper completion: get rid of empty COMPREPLY assignments completion: trivial test improvement completion: add more cherry-pick options
2013-04-17remote-hg: fix commit messagesLibravatar Felipe Contreras1-1/+2
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-15remote-bzr: fix prefix of tagsLibravatar Felipe Contreras1-3/+6
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-14completion: small optimizationLibravatar Felipe Contreras1-4/+4
No need to calculate a new $c with a space if we are not going to do anything it with it. There should be no functional changes, except that a word "foo " with no suffixes can't be matched. But $cur cannot have a space at the end anyway. So it's safe. Based on the code from SZEDER Gábor. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14completion: inline __gitcomp_1 to its sole callsiteLibravatar Felipe Contreras1-15/+11
There is no point in calling a separate function that is only used in one place. Especially considering that there's no need to call compgen, and we traverse the words ourselves both in __gitcompadd, and __gitcomp_1. Let's squash the functions together, and traverse only once. This improves performance. For N number of words: == 1 == original: 0.002s new: 0.000s == 10 == original: 0.005s new: 0.001s == 100 == original: 0.009s new: 0.006s == 1000 == original: 0.027s new: 0.019s == 10000 == original: 0.163s new: 0.151s == 100000 == original: 1.555s new: 1.497s No functional changes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14completion: get rid of compgenLibravatar Felipe Contreras1-5/+10
The functionality we use from compgen is not much, we can do the same manually, with drastic improvements in speed, especially when dealing with only a few words. This patch also has the sideffect that brekage reported by Jeroen Meijer and SZEDER Gábor gets fixed because we no longer expand the resulting words. Here are some numbers filtering N amount of words: == 1 == original: 0.002s new: 0.000s == 10 == original: 0.002s new: 0.000s == 100 == original: 0.003s new: 0.002s == 1000 == original: 0.012s new: 0.011s == 10000 == original: 0.056s new: 0.066s == 100000 == original: 2.669s new: 0.622s If the results are not narrowed: == 1 == original: 0.002s new: 0.000s == 10 == original: 0.002s new: 0.001s == 100 == original: 0.004s new: 0.004s == 1000 == original: 0.020s new: 0.015s == 10000 == original: 0.101s new: 0.355s == 100000 == original: 2.850s new: 31.941s So, unless 'git checkout <tab>' usually gives you more than 10000 results, you'll get an improvement :) Other possible solutions perform better after 1000 words, but worst if less than that: COMPREPLY=($(awk -v cur="$3" -v pre="$2" -v suf="$4" '$0 ~ cur { print pre$0suf }' <<< "$1" )) COMPREPLY=($(printf -- "$2%s$4\n" $1 | grep "^$2$3")) Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-14completion: add new __gitcompadd helperLibravatar Felipe Contreras1-5/+8
The idea is to never touch the COMPREPLY variable directly. This allows other completion systems (i.e. zsh) to override __gitcompadd, and do something different instead. Also, this allows further optimizations down the line. There should be no functional changes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12test-bzr: portable shell and utf-8 strings for Mac OSLibravatar Torsten Bögershausen1-19/+19
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-12Sync with 'maint'Libravatar Junio C Hamano5-15/+15
* maint: Correct common spelling mistakes in comments and tests kwset: fix spelling in comments precompose-utf8: fix spelling of "want" in error message compat/nedmalloc: fix spelling in comments compat/regex: fix spelling and grammar in comments obstack: fix spelling of similar contrib/subtree: fix spelling of accidentally git-remote-mediawiki: spelling fixes doc: various spelling fixes fast-export: fix argument name in error messages Documentation: distinguish between ref and offset deltas in pack-format i18n: make the translation of -u advice in one go
2013-04-12contrib/subtree: fix spelling of accidentallyLibravatar Stefano Lattarini1-1/+1
Noticed with Lucas De Marchi's codespell tool. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12git-remote-mediawiki: spelling fixesLibravatar Stefano Lattarini4-14/+14
Most of these were found using Lucas De Marchi's codespell tool. Others were pointed out by Eric Sunshine. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12completion: get rid of empty COMPREPLY assignmentsLibravatar Felipe Contreras1-21/+0
There's no functional reason for those, the only purpose they are supposed to serve is to say "we don't provide any words here", but even for that it's not used consistently. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12completion: add more cherry-pick optionsLibravatar Felipe Contreras1-1/+6
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11remote-hg: activate graphlog extension for hg_log()Libravatar Antoine Pelisse2-2/+7
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-11remote-hg: fix bad file pathsLibravatar Felipe Contreras1-2/+8
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-11remote-hg: document location of stored hg repositoryLibravatar Simon Ruderich1-0/+3
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-11remote-hg: fix bad state issueLibravatar Felipe Contreras1-1/+7
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-11remote-hg: add 'insecure' optionLibravatar Simon Ruderich1-0/+9
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-11remote-hg: add simple mail testLibravatar Felipe Contreras1-1/+2
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11remote-hg: add basic author testsLibravatar Felipe Contreras1-0/+35
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11remote-hg: show more proper errorsLibravatar Felipe Contreras1-3/+9
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-11remote-hg: force remote pushLibravatar Felipe Contreras1-2/+9
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-11remote-hg: push to the appropriate branchLibravatar Dusty Phillips1-0/+4
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11remote-hg: update tags globallyLibravatar Felipe Contreras1-1/+5
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11remote-hg: update remote bookmarksLibravatar Felipe Contreras1-0/+5
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11remote-hg: refactor exportLibravatar Felipe Contreras1-8/+12
No functional changes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11remote-hg: split bookmark handlingLibravatar Felipe Contreras1-14/+25
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-11remote-hg: redirect buggy mercurial outputLibravatar Felipe Contreras1-0/+1
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-11remote-hg: trivial test cleanupsLibravatar Felipe Contreras2-5/+3
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11remote-hg: make sure fake bookmarks are updatedLibravatar Felipe Contreras3-0/+9
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11remote-hg: fix for files with spacesLibravatar Peter van Zetten1-2/+2
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-11remote-hg: properly report errors on bookmark pushesLibravatar Felipe Contreras1-0/+1
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11remote-hg: add missing config variable in docLibravatar Dusty Phillips1-0/+4
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11remote-hg: trivial cleanupsLibravatar Felipe Contreras1-5/+5
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-08remote-bzr: improve tag handlingLibravatar Felipe Contreras1-9/+16
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-08remote-bzr: fix utf-8 support for fetchingLibravatar Christophe Simonis2-9/+19
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-07Sync with 1.8.2.1Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07Merge branch 'fc/remote-helpers-test-updates'Libravatar Junio C Hamano3-16/+2
* 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-07Sync with 1.8.1.6Libravatar Junio C Hamano1-1/+1
2013-04-07remote-helpers/test-bzr.sh: do not use "grep '\s'"Libravatar Torsten Bögershausen1-1/+1
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-07remote-bzr: add utf-8 support for pushingLibravatar Felipe Contreras2-0/+37
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07remote-bzr: add utf-8 support for fetchingLibravatar Timotheus Pokorra2-2/+27
[fc: added tests] Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07remote-bzr: avoid unreferred tagsLibravatar Felipe Contreras1-0/+4
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-07remote-bzr: only update workingtree on local reposLibravatar Felipe Contreras1-2/+1
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>