revset: do not rewrite ':y' to '0:y' (
issue5385)
That's no longer valid since the revision 0 may be hidden. Bypass validating
the existence of '0' and filter it by spanset.
revset: extract function that creates range set from computed revisions
So we can pass m=0 to _makerangeset() even if the revision 0 is hidden.
Hidden revisions are filtered by spanset.
hg: set default path correctly when doing a clone+share (
issue5378)
Before, if performing a clone+share from a repo that was itself
using shared storage, the share code would copy paths.default from
the underlying repo being shared, not from the source given by
the user.
This patch teaches hg.clonewithshare to resolve paths.default
and pass it to share so it can be written to the hgrc accordingly.
annotate: calculate line count correctly
Before this patch, the "lines" function inside "annotate" returns 1 for
empty text (''). This patch makes it 0. Because the function should match
mdiff.splitnewlines (used by mdiff.allblocks), or s.splitlines (used at the
end of the "annotate" method). Both len(mdiff.splitnewlines('')) and
len(''.splitlines(True)) are 0.
This issue was discovered while testing fastannotate [1].
I could not find a test case to reveal this issue. However in theory this
could reduce memory usage a little bit, and avoids surprises when people
are touching this area in the future.
[1]: https://bitbucket.org/facebook/hg-experimental/commits/
525b3b98e93a
py3: use unicode in is_frozen()
imp.is_frozen() doesnot accepts bytes on Python 3.
It does accept both bytes and strings on Python 2.
url: fix crash by empty path with #fragments
Before, "#foo" paths made hg crash. We've moved the #fragment parsing at
64fbd0de9773, but we shouldn't set path to None too early. This patch just
removes the "if not path:" block since that's checked a few lines later.