mercurial/revset.py
changeset 29238 e150c1d5f262
parent 29216 ead25aa27a43
child 29264 22625884b15c
equal deleted inserted replaced
29237:ee935a6e1ea2 29238:e150c1d5f262
  1845     - ``branch`` for the branch name,
  1845     - ``branch`` for the branch name,
  1846     - ``desc`` for the commit message (description),
  1846     - ``desc`` for the commit message (description),
  1847     - ``user`` for user name (``author`` can be used as an alias),
  1847     - ``user`` for user name (``author`` can be used as an alias),
  1848     - ``date`` for the commit date
  1848     - ``date`` for the commit date
  1849     """
  1849     """
  1850     # i18n: "sort" is a keyword
  1850     args = getargsdict(x, 'sort', 'set keys')
  1851     l = getargs(x, 1, 2, _("sort requires one or two arguments"))
  1851     if 'set' not in args:
       
  1852         # i18n: "sort" is a keyword
       
  1853         raise error.ParseError(_('sort requires one or two arguments'))
  1852     keys = "rev"
  1854     keys = "rev"
  1853     if len(l) == 2:
  1855     if 'keys' in args:
  1854         # i18n: "sort" is a keyword
  1856         # i18n: "sort" is a keyword
  1855         keys = getstring(l[1], _("sort spec must be a string"))
  1857         keys = getstring(args['keys'], _("sort spec must be a string"))
  1856 
  1858 
  1857     s = l[0]
  1859     s = args['set']
  1858     keys = keys.split()
  1860     keys = keys.split()
  1859     revs = getset(repo, subset, s)
  1861     revs = getset(repo, subset, s)
  1860     if keys == ["rev"]:
  1862     if keys == ["rev"]:
  1861         revs.sort()
  1863         revs.sort()
  1862         return revs
  1864         return revs