import re


def reported_br_diff(path1, path2=None):
  """Return expected header lines for diff of a branch, or subtree in a branch.

     PATH1 is the 'left' and PATH2 the 'right' side path. Both are full paths
     from the repo root. If PATH2 is None, the branch ids and paths are
     expected to be *the same* on both sides; otherwise the branch ids and/or
     paths are expected to be *different* on each side.
  """
  if path2 is None:
    return [r'--- diff branch [rBe:0-9.]+ at /%s' % (re.escape(path1),)]
  return [r'--- diff branch [rBe:0-9.]+ at /%s : [rBe:0-9.]+ at /%s' % (
           re.escape(path1), re.escape(path2))]