Show More
@@ -1881,30 +1881,33 b' def sort(repo, subset, x):' | |||||
1881 | raise error.ParseError(_("unknown sort key %r") % fk) |
|
1881 | raise error.ParseError(_("unknown sort key %r") % fk) | |
1882 | keyflags.append((k, reverse)) |
|
1882 | keyflags.append((k, reverse)) | |
1883 |
|
1883 | |||
1884 | s = args['set'] |
|
|||
1885 | revs = getset(repo, subset, s) |
|
|||
1886 |
|
||||
1887 | if len(keyflags) > 1 and any(k == 'topo' for k, reverse in keyflags): |
|
1884 | if len(keyflags) > 1 and any(k == 'topo' for k, reverse in keyflags): | |
1888 | # i18n: "topo" is a keyword |
|
1885 | # i18n: "topo" is a keyword | |
1889 | raise error.ParseError(_( |
|
1886 | raise error.ParseError(_( | |
1890 | 'topo sort order cannot be combined with other sort keys')) |
|
1887 | 'topo sort order cannot be combined with other sort keys')) | |
1891 |
|
1888 | |||
1892 | firstbranch = () |
|
1889 | opts = {} | |
1893 | if 'topo.firstbranch' in args: |
|
1890 | if 'topo.firstbranch' in args: | |
1894 | if any(k == 'topo' for k, reverse in keyflags): |
|
1891 | if any(k == 'topo' for k, reverse in keyflags): | |
1895 |
firstbranch = |
|
1892 | opts['topo.firstbranch'] = args['topo.firstbranch'] | |
1896 | else: |
|
1893 | else: | |
1897 | # i18n: "topo" and "topo.firstbranch" are keywords |
|
1894 | # i18n: "topo" and "topo.firstbranch" are keywords | |
1898 | raise error.ParseError(_( |
|
1895 | raise error.ParseError(_( | |
1899 | 'topo.firstbranch can only be used when using the topo sort ' |
|
1896 | 'topo.firstbranch can only be used when using the topo sort ' | |
1900 | 'key')) |
|
1897 | 'key')) | |
1901 |
|
1898 | |||
|
1899 | s = args['set'] | |||
|
1900 | revs = getset(repo, subset, s) | |||
|
1901 | ||||
1902 | if not keyflags: |
|
1902 | if not keyflags: | |
1903 | return revs |
|
1903 | return revs | |
1904 | if len(keyflags) == 1 and keyflags[0][0] == "rev": |
|
1904 | if len(keyflags) == 1 and keyflags[0][0] == "rev": | |
1905 | revs.sort(reverse=keyflags[0][1]) |
|
1905 | revs.sort(reverse=keyflags[0][1]) | |
1906 | return revs |
|
1906 | return revs | |
1907 | elif keyflags[0][0] == "topo": |
|
1907 | elif keyflags[0][0] == "topo": | |
|
1908 | firstbranch = () | |||
|
1909 | if 'topo.firstbranch' in opts: | |||
|
1910 | firstbranch = getset(repo, subset, opts['topo.firstbranch']) | |||
1908 | revs = baseset(_toposort(revs, repo.changelog.parentrevs, firstbranch), |
|
1911 | revs = baseset(_toposort(revs, repo.changelog.parentrevs, firstbranch), | |
1909 | istopo=True) |
|
1912 | istopo=True) | |
1910 | if keyflags[0][1]: |
|
1913 | if keyflags[0][1]: |
General Comments 0
You need to be logged in to leave comments.
Login now