mercurial/cffi/diffhelpers.py
author Yuya Nishihara <yuya@tcha.org>
Sun, 18 Jun 2017 00:40:58 +0900
changeset 33019 f63d111258da
parent 32545 0e8b0b9a7acc
permissions -rw-r--r--
revset: add startdepth limit to ancestors() as internal option This is necessary to implement the set{gen} (set subscript) operator. For example, set{-n} will be translated to ancestors(set, depth=n, startdepth=n). https://www.mercurial-scm.org/wiki/RevsetOperatorPlan#ideas_from_mpm The UI is undecided and I doubt if the startdepth option would be actually useful, so the option is hidden for now. 'depth' could be extended to take min:max range, in which case, integer depth should select a single generation. ancestors(set, depth=:y) # scan up to y-th generation ancestors(set, depth=x:) # skip until (x-1)-th generation ancestors(set, depth=x) # select only x-th generation Any ideas are welcomed. # reverse(ancestors(tip)) using hg repo 3) 0.075951 4) 0.076175
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32545
0e8b0b9a7acc cffi: split modules from pure
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     1
# diffhelpers.py - pure Python implementation of diffhelpers.c
0e8b0b9a7acc cffi: split modules from pure
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     2
#
0e8b0b9a7acc cffi: split modules from pure
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     3
# Copyright 2009 Matt Mackall <mpm@selenic.com> and others
0e8b0b9a7acc cffi: split modules from pure
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     4
#
0e8b0b9a7acc cffi: split modules from pure
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     5
# This software may be used and distributed according to the terms of the
0e8b0b9a7acc cffi: split modules from pure
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     6
# GNU General Public License version 2 or any later version.
0e8b0b9a7acc cffi: split modules from pure
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     7
0e8b0b9a7acc cffi: split modules from pure
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     8
from __future__ import absolute_import
0e8b0b9a7acc cffi: split modules from pure
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     9
0e8b0b9a7acc cffi: split modules from pure
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    10
from ..pure.diffhelpers import *