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, |