summaryrefslogtreecommitdiff
path: root/contrib/remote-helpers
AgeCommit message (Collapse)Author
2013-05-28remote-hg: trivial cleanupFelipe Contreras
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>
2013-05-28remote-helpers: improve marks usageFelipe Contreras
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>
2013-05-28remote-hg: add check_push() helperFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: add setup_big_push() helperFelipe Contreras
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>
2013-05-28remote-hg: remove files before modificationsFelipe Contreras
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>
2013-05-28remote-hg: improve lightweight tag authorFelipe Contreras
Use git's committer. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: use remote 'default' not local oneFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: improve branch listingFelipe Contreras
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>
2013-05-28remote-hg: simplify branch_tip()Felipe Contreras
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>
2013-05-28remote-hg: check diverged bookmarksFelipe Contreras
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>
2013-05-28remote-hg: pass around revision refsFelipe Contreras
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>
2013-05-28remote-hg: implement custom checkheads()Felipe Contreras
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>
2013-05-28remote-hg: implement custom push()Felipe Contreras
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>
2013-05-28remote-hg: only update necessary revisionsFelipe Contreras
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>
2013-05-28remote-hg: force remote bookmark push selectivelyFelipe Contreras
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>
2013-05-28remote-hg: reorganize bookmark handlingFelipe Contreras
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>
2013-05-28remote-hg: add test for failed double pushFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: add test for big pushFelipe Contreras
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>
2013-05-28remote-hg: add test for new bookmark specialFelipe Contreras
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>
2013-05-28remote-hg: add test for bookmark divergeFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: add test for diverged pushFelipe Contreras
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>
2013-05-28remote-hg: add test to push new bookmarkFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: add remote testsFelipe Contreras
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>
2013-05-28remote-hg: update bookmarks when using a remoteFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: add check_bookmark() test helperFelipe Contreras
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>
2013-05-28remote-bzr: simplify test checksFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: add tests for 'master' bookmarkFelipe Contreras
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>
2013-05-28remote-hg: always point HEAD to masterFelipe Contreras
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>
2013-05-28remote-hg: improve progress calculationFelipe Contreras
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>
2013-05-28remote-hg: trivial cleanupsFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: ensure remote rebasing worksFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: upgrade version 1 marksFelipe Contreras
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>
2013-05-28remote-hg: switch from revisions to SHA-1 noteidsFelipe Contreras
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>
2013-05-28remote-hg: add version checks to the marksFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: improve node traversingFelipe Contreras
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>
2013-05-28remote-hg: shuffle some codeFelipe Contreras
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>
2013-05-28remote-hg: use a shared repository storeFelipe Contreras
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>
2013-05-28remote-hg: load all extensionsFelipe Contreras
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>
2013-05-28remote-hg: test: simplify previous branch checkoutFelipe Contreras
@{-1} does the same thing. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-helpers: test: simplify remote URLsFelipe Contreras
No need to specify $PWD any more. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-helpers: tests: general improvementsFelipe Contreras
So that we don't need a temporary directory. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-helpers: test: cleanup styleFelipe Contreras
So it's more standardized between all the tests. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-helpers: test: cleanup white-spacesFelipe Contreras
We prefer tabs to spaces. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: trivial reorganizationFelipe Contreras
We only need to get the remote dict once. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-hg: test: be a little more quietFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-bzr: add fallback check for a partial cloneFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-bzr: reorganize the way 'wanted' worksFelipe Contreras
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>
2013-05-28remote-bzr: trivial cleanupsFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-bzr: change global repoFelipe Contreras
It's not used anyway. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-28remote-bzr: delay cloning/pullingFelipe Contreras
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>