mercurial/cmdutil.py
changeset 35746 e5b6ba786d83
parent 35745 3bd8ab4c80a5
child 35874 1bee7762fd46
child 36844 eeb87b24aea7
equal deleted inserted replaced
35745:3bd8ab4c80a5 35746:e5b6ba786d83
   725             raise error.Abort("empty revision set")
   725             raise error.Abort("empty revision set")
   726         roots = repo.revs('roots(%ld)', revs)
   726         roots = repo.revs('roots(%ld)', revs)
   727         if len(roots) > 1:
   727         if len(roots) > 1:
   728             raise error.Abort(_("cannot change branch of non-linear revisions"))
   728             raise error.Abort(_("cannot change branch of non-linear revisions"))
   729         rewriteutil.precheck(repo, revs, 'change branch of')
   729         rewriteutil.precheck(repo, revs, 'change branch of')
       
   730 
       
   731         root = repo[roots.first()]
       
   732         if not root.p1().branch() == label and label in repo.branchmap():
       
   733             raise error.Abort(_("a branch of the same name already exists"))
       
   734 
   730         if repo.revs('merge() and %ld', revs):
   735         if repo.revs('merge() and %ld', revs):
   731             raise error.Abort(_("cannot change branch of a merge commit"))
   736             raise error.Abort(_("cannot change branch of a merge commit"))
   732         if repo.revs('obsolete() and %ld', revs):
   737         if repo.revs('obsolete() and %ld', revs):
   733             raise error.Abort(_("cannot change branch of a obsolete changeset"))
   738             raise error.Abort(_("cannot change branch of a obsolete changeset"))
   734 
   739