Development versions have extra stuff in the form of
'version+distance-id'.
Let's assume we are already in the next major version when in
development.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
BSD install doesn't understand the -D option. Use a separate install
command to create the directory (with the -d option) before installing
the file.
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
The en_US.UTF-8 locale is not guaranteed to exist, and if it doesn't,
several tests fail.
Signed-off-by: Paul Wise <pabs3@bonedaddy.net>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Inspired by the tests in gitifyhg.
One test is failing, but that's because of a limitation of
remote-helpers.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
We want to ignore secondary heads, otherwise we will import revisions
that won't have any ref pointing to them and might eventually be pruned,
which would cause problems with the synchronization of marks.
This can only be expressed properly as '::b - ::a', but that's not
efficient, specially in older versions of Mercurial.
'ancestor(a,b)::b - ancestor(a,b)::a' might be better, but it's not
particularly pretty. Mercurial v3.0 will have a new 'only(b, a)' that
does the same, but that hasn't even been released yet. Either way all of
these require repo.revs() which is only available after Mercurial v2.1.
Also, we would need special considerations for when there's no base
revision (importing from root).
It's much better to implement our own function to get a range of
revisions.
The new gitrange() is inspired by Mercurial's revset.missingancestors().
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Mercurial can have bookmarks pointing to "nullid" (the empty root
revision), while Git can not have references to it.
Warn the user about the invalid reference, and do not advertise these
bookmarks as head refs, but otherwise continue the import. In
particular, we still keep track of the fact that the remote repository
has a bookmark of the given name, in case the user wants to modify that
bookmark.
Reported-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Max Horn <max@quendi.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Use the hgrc configuration file in the internal mercurial repository in
addition to the other system wide hgrc files. This is done by using the
'ui' object from the 'repository' object which will have loaded the
repository hgrc file if it exists.
Signed-off-by: Dan Liew <delcypher@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This can happen when there's a synchronization issue between marks-git
and marks-hg; a key is missing in marks-hg, and when we receive a reset
command the value of ctx basically comes from None.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Commit 2594a79 (remote-hg: fix bad state issue) originally introduced
this code in order to avoid synchronization issues while pushing,
because `git fast-export` might end up writing the marks before a crash
in the remote helper occurs.
However, the problem is in `git fast-export`; the marks should only be
written after both have finished successfully.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Other tools use the 'committer' extra field differently, so let's make
the parsing more reliable and don't assume it's in a certain format.
Reported-by: Kevin Cox <kevincox@kevincox.ca>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Since e71d1378 (remote-hg: fix 'shared path' path, 2013-12-07),
Mercurial 'shared_path' file is correctly updated whenever a clone is
moved. Make sure it keeps working, especially as this is depending on a
private Mercurial file.
Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
If the repository is moved, the absolute path of the shared repository
would fail.
Make sure it's always up-to-date.
Reported-by: Michael Davis <mjmdavis@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
error on pull: fatal: Invalid raw date "" in ident: remote-hg <>
Neither %s nor %z are officially supported by python, they may work on
some (most?) platforms, but not all.
removed strftime use of %s and %z, which are not officially supported by python, with standard formats
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>