mercurial/cmdutil.py
changeset 45812 976b26bdd0d8
parent 45796 e9555305c5c6
child 45827 8d72e29ad1e0
equal deleted inserted replaced
45811:4404f129341e 45812:976b26bdd0d8
  3111     edittext.append(b"")
  3111     edittext.append(b"")
  3112 
  3112 
  3113     return b"\n".join(edittext)
  3113     return b"\n".join(edittext)
  3114 
  3114 
  3115 
  3115 
  3116 def commitstatus(repo, node, branch, bheads=None, opts=None):
  3116 def commitstatus(repo, node, branch, bheads=None, tip=None, opts=None):
  3117     if opts is None:
  3117     if opts is None:
  3118         opts = {}
  3118         opts = {}
  3119     ctx = repo[node]
  3119     ctx = repo[node]
  3120     parents = ctx.parents()
  3120     parents = ctx.parents()
  3121 
  3121 
  3122     if (
  3122     if tip is not None and repo.changelog.tip() == tip:
       
  3123         # avoid reporting something like "committed new head" when
       
  3124         # recommitting old changesets, and issue a helpful warning
       
  3125         # for most instances
       
  3126         repo.ui.warn(_("warning: commit already existed in the repository!\n"))
       
  3127     elif (
  3123         not opts.get(b'amend')
  3128         not opts.get(b'amend')
  3124         and bheads
  3129         and bheads
  3125         and node not in bheads
  3130         and node not in bheads
  3126         and not any(
  3131         and not any(
  3127             p.node() in bheads and p.branch() == branch for p in parents
  3132             p.node() in bheads and p.branch() == branch for p in parents