mercurial/commands.py
changeset 50831 afddb0d5be4f
parent 50830 f5d16c4caae2
child 50832 7d54b877782e
equal deleted inserted replaced
50830:f5d16c4caae2 50831:afddb0d5be4f
  1963 
  1963 
  1964     See :hg:`help urls` for details on specifying URLs.
  1964     See :hg:`help urls` for details on specifying URLs.
  1965 
  1965 
  1966     Returns 0 on success.
  1966     Returns 0 on success.
  1967     """
  1967     """
  1968     opts = pycompat.byteskwargs(opts)
  1968     cmdutil.check_at_most_one_arg(opts, 'noupdate', 'updaterev')
  1969     cmdutil.check_at_most_one_arg(opts, b'noupdate', b'updaterev')
       
  1970 
  1969 
  1971     # --include/--exclude can come from narrow or sparse.
  1970     # --include/--exclude can come from narrow or sparse.
  1972     includepats, excludepats = None, None
  1971     includepats, excludepats = None, None
  1973 
  1972 
  1974     # hg.clone() differentiates between None and an empty set. So make sure
  1973     # hg.clone() differentiates between None and an empty set. So make sure
  1975     # patterns are sets if narrow is requested without patterns.
  1974     # patterns are sets if narrow is requested without patterns.
  1976     if opts.get(b'narrow'):
  1975     if opts.get('narrow'):
  1977         includepats = set()
  1976         includepats = set()
  1978         excludepats = set()
  1977         excludepats = set()
  1979 
  1978 
  1980         if opts.get(b'include'):
  1979         if opts.get('include'):
  1981             includepats = narrowspec.parsepatterns(opts.get(b'include'))
  1980             includepats = narrowspec.parsepatterns(opts.get('include'))
  1982         if opts.get(b'exclude'):
  1981         if opts.get('exclude'):
  1983             excludepats = narrowspec.parsepatterns(opts.get(b'exclude'))
  1982             excludepats = narrowspec.parsepatterns(opts.get('exclude'))
  1984 
  1983 
  1985     r = hg.clone(
  1984     r = hg.clone(
  1986         ui,
  1985         ui,
  1987         opts,
  1986         pycompat.byteskwargs(opts),
  1988         source,
  1987         source,
  1989         dest,
  1988         dest,
  1990         pull=opts.get(b'pull'),
  1989         pull=opts.get('pull'),
  1991         stream=opts.get(b'stream') or opts.get(b'uncompressed'),
  1990         stream=opts.get('stream') or opts.get('uncompressed'),
  1992         revs=opts.get(b'rev'),
  1991         revs=opts.get('rev'),
  1993         update=opts.get(b'updaterev') or not opts.get(b'noupdate'),
  1992         update=opts.get('updaterev') or not opts.get('noupdate'),
  1994         branch=opts.get(b'branch'),
  1993         branch=opts.get('branch'),
  1995         shareopts=opts.get(b'shareopts'),
  1994         shareopts=opts.get('shareopts'),
  1996         storeincludepats=includepats,
  1995         storeincludepats=includepats,
  1997         storeexcludepats=excludepats,
  1996         storeexcludepats=excludepats,
  1998         depth=opts.get(b'depth') or None,
  1997         depth=opts.get('depth') or None,
  1999     )
  1998     )
  2000 
  1999 
  2001     return r is None
  2000     return r is None
  2002 
  2001 
  2003 
  2002