-"""Function/variables commmon to all the commands
+"""Function/variables common to all the commands
"""
__copyright__ = """
return read_string(series.get_base_file())
# anything else failed
- return git.rev_parse(rev)
+ return git.rev_parse(rev + '^{commit}')
def check_local_changes():
if git.local_changes():
if not crt_series.head_top_equal():
raise CmdException, \
'HEAD and top are not the same. You probably committed\n' \
- ' changes to the tree ouside of StGIT. If you know what you\n' \
+ ' changes to the tree outside of StGIT. If you know what you\n' \
' are doing, use the "refresh -f" command'
def check_conflicts():
"""Return a tuple consisting of the name and email parsed from a
standard 'name <email>' string
"""
- address = re.sub('([^\w\s<>@.])', '\\\\\\1', address)
+ address = re.sub('[\\\\"]', '\\\\\g<0>', address)
str_list = re.findall('^(.*)\s*<(.*)>\s*$', address)
if not str_list:
raise CmdException, 'Incorrect "name <email>" string: %s' % address
"""Return a tuple consisting of the name, email and date parsed
from a 'name <email> date' string
"""
- address = re.sub('([^\w\s<>@.])', '\\\\\\1', address)
+ address = re.sub('[\\\\"]', '\\\\\g<0>', address)
str_list = re.findall('^(.*)\s*<(.*)>\s*(.*)\s*$', address)
if not str_list:
raise CmdException, 'Incorrect "name <email> date" string: %s' % address