aboutsummaryrefslogtreecommitdiff
path: root/contrib/remote-helpers
Commit message (Collapse)AuthorAge
* Merge branch 'fc/remote-bzr'Junio C Hamano2013-06-11
|\ | | | | | | | | | | | | | | | | | | | | | | * fc/remote-bzr: remote-bzr: add fallback check for a partial clone remote-bzr: reorganize the way 'wanted' works remote-bzr: trivial cleanups remote-bzr: change global repo remote-bzr: delay cloning/pulling remote-bzr: simplify get_remote_branch() remote-bzr: fix for files with spaces remote-bzr: recover from failed clones
| * remote-bzr: add fallback check for a partial cloneFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * remote-bzr: reorganize the way 'wanted' worksFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | | | | | | | If the user specified a list of branches, we ignore what the remote repository lists, and simply use the branches directly. Since some remotes don't report the branches correctly, this is useful. Otherwise either fetch the repo, or the branch. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * remote-bzr: trivial cleanupsFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * remote-bzr: change global repoFelipe Contreras2013-05-28
| | | | | | | | | | | | | | It's not used anyway. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * remote-bzr: delay cloning/pullingFelipe Contreras2013-05-28
| | | | | | | | | | | | | | Until the branch is actually going to be used. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * remote-bzr: simplify get_remote_branch()Felipe Contreras2013-05-28
| | | | | | | | | | | | | | | | 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>
| * remote-bzr: fix for files with spacesFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | 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>
| * remote-bzr: recover from failed clonesFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: add support for --forceFelipe Contreras2013-05-28
| | | | | | | | | | | | | | And get rid of the remote-hg.force-push option hack. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: add support for --dry-runFelipe Contreras2013-05-28
| | | | | | | | | | | | | | This needs a specific patch from Git not applied yet. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: check if a fetch is neededFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: trivial cleanupFelipe Contreras2013-05-28
| | | | | | | | | | | | | | It's better to catch the exception later on. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-helpers: improve marks usageFelipe Contreras2013-05-28
| | | | | | | | | | | | | | Always convert to strings (they are unicode because they come from JSON). Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: add check_push() helperFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: add setup_big_push() helperFelipe Contreras2013-05-28
| | | | | | | | | | | | | | So we don't duplicate these commands. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: remove files before modificationsFelipe Contreras2013-05-28
| | | | | | | | | | | | | | Otherwise replacing a file with a directory doesn't work. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: improve lightweight tag authorFelipe Contreras2013-05-28
| | | | | | | | | | | | | | Use git's committer. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: use remote 'default' not local oneFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: improve branch listingFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | We want to show the remote heads, not the internal ones, which might have garbage. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: simplify branch_tip()Felipe Contreras2013-05-28
| | | | | | | | | | | | | | | | It simply picks the last head that is not closed, but we have a stored list of open heads. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: check diverged bookmarksFelipe Contreras2013-05-28
| | | | | | | | | | | | | | So that we can report a proper error. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: pass around revision refsFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | | | | | | | So that when a diverge is detected, we know which ref to report an error for. Also, since we are not throwing an exception, return a proper error code. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: implement custom checkheads()Felipe Contreras2013-05-28
| | | | | | | | | | | | | | | | | | | | The version from Mercurial is extremely inefficient and convoluted, this version achieves basically the same, at least for our purposes. No functional changes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: implement custom push()Felipe Contreras2013-05-28
| | | | | | | | | | | | | | | | | | | | | | | | The one from mercurial does a ton of things we are not interested in, and we need some special modifications which are impossible otherwise. Most of the code is borrowed from Mercurial, and cleaned up, but should be functionally the same for our purposes, except that multiple heads are not detected. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: only update necessary revisionsFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | We don't care about the rest, and in fact, we shouldn't try to push everything, as there might be garbage from previous failed pushes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: force remote bookmark push selectivelyFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | | | | | | | If we update the 'old' node, we might be updating the remote bookmark even when our 'new' node is not related at all to what the remote has, effectively forcing an update. Let's do that only when forced push is configured. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: reorganize bookmark handlingFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | We don't need to update both internal and remote bookmarks, so let's do one or the other, and move the shared code earlier, so it's simpler. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: add test for failed double pushFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: add test for big pushFelipe Contreras2013-05-28
| | | | | | | | | | | | | | With lots branches and bookmarks, non-ff, updated and new. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: add test for new bookmark specialFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | | | | | | | From the point of view of Mercurial, this creates a new branch head, and requires a forced push. Ideally, however, we would want it to work just like in git; new branches can be pushed without problems. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: add test for bookmark divergeFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: add test for diverged pushFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | | | | | Neither mercurial nor git allows pushing to a remote when it's a non-fast-forward push. We should be able to detect these errors and report them properly, as opposed to throwing an exception stack-trace. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: add test to push new bookmarkFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: add remote testsFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | | | | | | | | | The logic when working with a local repository is totally different from the one where we work with a remote repository; we need to pull and push from it. All this logic is currently not tested at all, so let's introduce a variable to force the remote behavior. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: update bookmarks when using a remoteFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: add check_bookmark() test helperFelipe Contreras2013-05-28
| | | | | | | | | | | | | | And check in a more proper way. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-bzr: simplify test checksFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: add tests for 'master' bookmarkFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | We want to make sure everything works correctly, even if there's a 'master' bookmark in Mercurial. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: always point HEAD to masterFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mercurial always checks out the 'default' branch, so there's no point in complicating our lives trying to do something fancier, which causes different behavior depending on whether the repository is local or remote. So let's always use 'default' (which we translate to 'master'), unless we are in hg-git mode, which expects us to use the 'master' bookmark instead. Also, update the tests that used to check for different checkout behaviors to simply check that the refs are there, remove unnecessary ones, and fix the ones that expect something different. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: improve progress calculationFelipe Contreras2013-05-28
| | | | | | | | | | | | | | No need to manually keep track of the revision count. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: trivial cleanupsFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: ensure remote rebasing worksFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: upgrade version 1 marksFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | As suggested by Jed Brown; there's no need to re-import all the commits. Cc: Jed Brown <jed@59a2.org> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: switch from revisions to SHA-1 noteidsFelipe Contreras2013-05-28
| | | | | | | | | | | | | | Otherwise we won't know if revisions are replaced. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: add version checks to the marksFelipe Contreras2013-05-28
| | | | | | | | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: improve node traversingFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | We won't be able to count the unmarked commits, but we are not going to be able to do that anyway when we switch to SHA-1 ids. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: shuffle some codeFelipe Contreras2013-05-28
| | | | | | | | | | | | | | In preparation to shift to SHA-1's. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: use a shared repository storeFelipe Contreras2013-05-28
| | | | | | | | | | | | | | This way we don't have to have duplicated Mercurial objects. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | remote-hg: load all extensionsFelipe Contreras2013-05-28
| | | | | | | | | | | | | | | | The user might have then configured differently, plus, all of them will be loaded anyway later on. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>