mercurial/commands.py
changeset 39552 4c807ec07888
parent 39395 a80b8832720d
child 39624 713085b45810
equal deleted inserted replaced
39551:261f1e8dc300 39552:4c807ec07888
    41     hbisect,
    41     hbisect,
    42     help,
    42     help,
    43     hg,
    43     hg,
    44     logcmdutil,
    44     logcmdutil,
    45     merge as mergemod,
    45     merge as mergemod,
       
    46     narrowspec,
    46     obsolete,
    47     obsolete,
    47     obsutil,
    48     obsutil,
    48     patch,
    49     patch,
    49     phases,
    50     phases,
    50     pycompat,
    51     pycompat,
  1464     """
  1465     """
  1465     opts = pycompat.byteskwargs(opts)
  1466     opts = pycompat.byteskwargs(opts)
  1466     if opts.get('noupdate') and opts.get('updaterev'):
  1467     if opts.get('noupdate') and opts.get('updaterev'):
  1467         raise error.Abort(_("cannot specify both --noupdate and --updaterev"))
  1468         raise error.Abort(_("cannot specify both --noupdate and --updaterev"))
  1468 
  1469 
       
  1470     # --include/--exclude can come from narrow or sparse.
       
  1471     includepats, excludepats = None, None
       
  1472 
       
  1473     # hg.clone() differentiates between None and an empty set. So make sure
       
  1474     # patterns are sets if narrow is requested without patterns.
       
  1475     if opts.get('narrow'):
       
  1476         includepats = set()
       
  1477         excludepats = set()
       
  1478 
       
  1479         if opts.get('include'):
       
  1480             includepats = narrowspec.parsepatterns(opts.get('include'))
       
  1481         if opts.get('exclude'):
       
  1482             excludepats = narrowspec.parsepatterns(opts.get('exclude'))
       
  1483 
  1469     r = hg.clone(ui, opts, source, dest,
  1484     r = hg.clone(ui, opts, source, dest,
  1470                  pull=opts.get('pull'),
  1485                  pull=opts.get('pull'),
  1471                  stream=opts.get('stream') or opts.get('uncompressed'),
  1486                  stream=opts.get('stream') or opts.get('uncompressed'),
  1472                  revs=opts.get('rev'),
  1487                  revs=opts.get('rev'),
  1473                  update=opts.get('updaterev') or not opts.get('noupdate'),
  1488                  update=opts.get('updaterev') or not opts.get('noupdate'),
  1474                  branch=opts.get('branch'),
  1489                  branch=opts.get('branch'),
  1475                  shareopts=opts.get('shareopts'))
  1490                  shareopts=opts.get('shareopts'),
       
  1491                  storeincludepats=includepats,
       
  1492                  storeexcludepats=excludepats)
  1476 
  1493 
  1477     return r is None
  1494     return r is None
  1478 
  1495 
  1479 @command('^commit|ci',
  1496 @command('^commit|ci',
  1480     [('A', 'addremove', None,
  1497     [('A', 'addremove', None,