mercurial/merge.py
changeset 43117 8ff1ecfadcd1
parent 43106 d783f945a701
child 43421 be384a2052aa
equal deleted inserted replaced
43116:defabf63e969 43117:8ff1ecfadcd1
   758     config = repo.ui.config(section, name)
   758     config = repo.ui.config(section, name)
   759     valid = [b'abort', b'ignore', b'warn']
   759     valid = [b'abort', b'ignore', b'warn']
   760     if config not in valid:
   760     if config not in valid:
   761         validstr = b', '.join([b"'" + v + b"'" for v in valid])
   761         validstr = b', '.join([b"'" + v + b"'" for v in valid])
   762         raise error.ConfigError(
   762         raise error.ConfigError(
   763             _(b"%s.%s not valid " b"('%s' is none of %s)")
   763             _(b"%s.%s not valid ('%s' is none of %s)")
   764             % (section, name, config, validstr)
   764             % (section, name, config, validstr)
   765         )
   765         )
   766     return config
   766     return config
   767 
   767 
   768 
   768 
  1046     foldprefix = unfoldprefix = lastfull = b''
  1046     foldprefix = unfoldprefix = lastfull = b''
  1047     for fold, f in sorted(foldmap.items()):
  1047     for fold, f in sorted(foldmap.items()):
  1048         if fold.startswith(foldprefix) and not f.startswith(unfoldprefix):
  1048         if fold.startswith(foldprefix) and not f.startswith(unfoldprefix):
  1049             # the folded prefix matches but actual casing is different
  1049             # the folded prefix matches but actual casing is different
  1050             raise error.Abort(
  1050             raise error.Abort(
  1051                 _(b"case-folding collision between " b"%s and directory of %s")
  1051                 _(b"case-folding collision between %s and directory of %s")
  1052                 % (lastfull, f)
  1052                 % (lastfull, f)
  1053             )
  1053             )
  1054         foldprefix = fold + b'/'
  1054         foldprefix = fold + b'/'
  1055         unfoldprefix = f + b'/'
  1055         unfoldprefix = f + b'/'
  1056         lastfull = f
  1056         lastfull = f
  1223                 _(
  1223                 _(
  1224                     b'merge affects file \'%s\' outside narrow, '
  1224                     b'merge affects file \'%s\' outside narrow, '
  1225                     b'which is not yet supported'
  1225                     b'which is not yet supported'
  1226                 )
  1226                 )
  1227                 % f,
  1227                 % f,
  1228                 hint=_(b'merging in the other direction ' b'may work'),
  1228                 hint=_(b'merging in the other direction may work'),
  1229             )
  1229             )
  1230         else:
  1230         else:
  1231             raise error.Abort(
  1231             raise error.Abort(
  1232                 _(b'conflict in file \'%s\' is outside ' b'narrow clone') % f
  1232                 _(b'conflict in file \'%s\' is outside narrow clone') % f
  1233             )
  1233             )
  1234 
  1234 
  1235 
  1235 
  1236 def manifestmerge(
  1236 def manifestmerge(
  1237     repo,
  1237     repo,
  1990     usemergedriver = not overwrite and mergeactions and ms.mergedriver
  1990     usemergedriver = not overwrite and mergeactions and ms.mergedriver
  1991 
  1991 
  1992     if usemergedriver:
  1992     if usemergedriver:
  1993         if wctx.isinmemory():
  1993         if wctx.isinmemory():
  1994             raise error.InMemoryMergeConflictsError(
  1994             raise error.InMemoryMergeConflictsError(
  1995                 b"in-memory merge does not " b"support mergedriver"
  1995                 b"in-memory merge does not support mergedriver"
  1996             )
  1996             )
  1997         ms.commit()
  1997         ms.commit()
  1998         proceed = driverpreprocess(repo, ms, wctx, labels=labels)
  1998         proceed = driverpreprocess(repo, ms, wctx, labels=labels)
  1999         # the driver might leave some files unresolved
  1999         # the driver might leave some files unresolved
  2000         unresolvedf = set(ms.unresolved())
  2000         unresolvedf = set(ms.unresolved())
  2332                 )
  2332                 )
  2333             elif pas == [p1]:
  2333             elif pas == [p1]:
  2334                 if not mergeancestor and wc.branch() == p2.branch():
  2334                 if not mergeancestor and wc.branch() == p2.branch():
  2335                     raise error.Abort(
  2335                     raise error.Abort(
  2336                         _(b"nothing to merge"),
  2336                         _(b"nothing to merge"),
  2337                         hint=_(b"use 'hg update' " b"or check 'hg heads'"),
  2337                         hint=_(b"use 'hg update' or check 'hg heads'"),
  2338                     )
  2338                     )
  2339             if not force and (wc.files() or wc.deleted()):
  2339             if not force and (wc.files() or wc.deleted()):
  2340                 raise error.Abort(
  2340                 raise error.Abort(
  2341                     _(b"uncommitted changes"),
  2341                     _(b"uncommitted changes"),
  2342                     hint=_(b"use 'hg status' to list changes"),
  2342                     hint=_(b"use 'hg status' to list changes"),