This reverts commit f53a8653ab.
It turns out Debian and Fedora do provide the C.UTF-8 locale, but other
distributions don't.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Recent versions of Mercurial check if a filectx is the same as the
parents, and avoid creating a new filelog. This is what we want, but
hg-git doesn't do that.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
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>