##// END OF EJS Templates
update: resurrect bare update from null parent to tip-most branch head...
update: resurrect bare update from null parent to tip-most branch head The situation is tricky if repository has no "default" branch, because "null" revision belongs to non-existent "default" branch. Before e1dd0de26557, bare update from null would bring us to the tip-most non-closed branch head. e1dd0de26557 removed the special handling of missing "default" branch since we wanted to stick to the uncommitted branch in that case. But, if the parent is "null" revision, and if the missing branch is "default", it shouldn't be an uncommitted branch. In this case, bare update should bring us to the tip-most head as before. This should fix the test breakage introduced by e1dd0de26557.

File last commit:

r25979:b723f05e default
r28924:d9539959 default
Show More
strutil.py
36 lines | 953 B | text/x-python | PythonLexer
# strutil.py - string utilities for Mercurial
#
# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
def findall(haystack, needle, start=0, end=None):
if end is None:
end = len(haystack)
if end < 0:
end += len(haystack)
if start < 0:
start += len(haystack)
while start < end:
c = haystack.find(needle, start, end)
if c == -1:
break
yield c
start = c + 1
def rfindall(haystack, needle, start=0, end=None):
if end is None:
end = len(haystack)
if end < 0:
end += len(haystack)
if start < 0:
start += len(haystack)
while end >= 0:
c = haystack.rfind(needle, start, end)
if c == -1:
break
yield c
end = c - 1