##// END OF EJS Templates
revset: unindent "if True" block in sort()...
Yuya Nishihara -
r29002:ea794f2e stable
parent child Browse files
Show More
@@ -1868,30 +1868,29 b' def sort(repo, subset, x):'
1868 return revs
1868 return revs
1869 # sort() is guaranteed to be stable
1869 # sort() is guaranteed to be stable
1870 ctxs = [repo[r] for r in revs]
1870 ctxs = [repo[r] for r in revs]
1871 if True:
1871 for k in reversed(keys):
1872 for k in reversed(keys):
1872 if k == 'rev':
1873 if k == 'rev':
1873 ctxs.sort(key=lambda c: c.rev())
1874 ctxs.sort(key=lambda c: c.rev())
1874 elif k == '-rev':
1875 elif k == '-rev':
1875 ctxs.sort(key=lambda c: c.rev(), reverse=True)
1876 ctxs.sort(key=lambda c: c.rev(), reverse=True)
1876 elif k == 'branch':
1877 elif k == 'branch':
1877 ctxs.sort(key=lambda c: c.branch())
1878 ctxs.sort(key=lambda c: c.branch())
1878 elif k == '-branch':
1879 elif k == '-branch':
1879 ctxs.sort(key=lambda c: c.branch(), reverse=True)
1880 ctxs.sort(key=lambda c: c.branch(), reverse=True)
1880 elif k == 'desc':
1881 elif k == 'desc':
1881 ctxs.sort(key=lambda c: c.description())
1882 ctxs.sort(key=lambda c: c.description())
1882 elif k == '-desc':
1883 elif k == '-desc':
1883 ctxs.sort(key=lambda c: c.description(), reverse=True)
1884 ctxs.sort(key=lambda c: c.description(), reverse=True)
1884 elif k in 'user author':
1885 elif k in 'user author':
1885 ctxs.sort(key=lambda c: c.user())
1886 ctxs.sort(key=lambda c: c.user())
1886 elif k in '-user -author':
1887 elif k in '-user -author':
1887 ctxs.sort(key=lambda c: c.user(), reverse=True)
1888 ctxs.sort(key=lambda c: c.user(), reverse=True)
1888 elif k == 'date':
1889 elif k == 'date':
1889 ctxs.sort(key=lambda c: c.date()[0])
1890 ctxs.sort(key=lambda c: c.date()[0])
1890 elif k == '-date':
1891 elif k == '-date':
1891 ctxs.sort(key=lambda c: c.date()[0], reverse=True)
1892 ctxs.sort(key=lambda c: c.date()[0], reverse=True)
1892 else:
1893 else:
1893 raise error.ParseError(_("unknown sort key %r") % k)
1894 raise error.ParseError(_("unknown sort key %r") % k)
1895 return baseset([c.rev() for c in ctxs])
1894 return baseset([c.rev() for c in ctxs])
1896
1895
1897 @predicate('subrepo([pattern])')
1896 @predicate('subrepo([pattern])')
General Comments 0
You need to be logged in to leave comments. Login now