Mercurial > hg
comparison tests/test-revset2.t @ 38125:6ef01102ebff
py3: add b'' prefixes in tests/test-revset2.t
# skip-blame because just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D3637
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 20 May 2018 18:53:03 +0530 |
parents | d2c912836465 |
children | f1d55ae2c5c8 |
comparison
equal
deleted
inserted
replaced
38124:282f3daac1d7 | 38125:6ef01102ebff |
---|---|
1587 $ cat <<EOF > $TESTTMP/custompredicate.py | 1587 $ cat <<EOF > $TESTTMP/custompredicate.py |
1588 > from mercurial import error, registrar, revset | 1588 > from mercurial import error, registrar, revset |
1589 > | 1589 > |
1590 > revsetpredicate = registrar.revsetpredicate() | 1590 > revsetpredicate = registrar.revsetpredicate() |
1591 > | 1591 > |
1592 > @revsetpredicate('custom1()') | 1592 > @revsetpredicate(b'custom1()') |
1593 > def custom1(repo, subset, x): | 1593 > def custom1(repo, subset, x): |
1594 > return revset.baseset([1]) | 1594 > return revset.baseset([1]) |
1595 > | 1595 > |
1596 > raise error.Abort('intentional failure of loading extension') | 1596 > raise error.Abort(b'intentional failure of loading extension') |
1597 > EOF | 1597 > EOF |
1598 $ cat <<EOF > .hg/hgrc | 1598 $ cat <<EOF > .hg/hgrc |
1599 > [extensions] | 1599 > [extensions] |
1600 > custompredicate = $TESTTMP/custompredicate.py | 1600 > custompredicate = $TESTTMP/custompredicate.py |
1601 > EOF | 1601 > EOF |
1609 | 1609 |
1610 $ cat > $TESTTMP/printprevset.py <<EOF | 1610 $ cat > $TESTTMP/printprevset.py <<EOF |
1611 > from mercurial import encoding, registrar | 1611 > from mercurial import encoding, registrar |
1612 > cmdtable = {} | 1612 > cmdtable = {} |
1613 > command = registrar.command(cmdtable) | 1613 > command = registrar.command(cmdtable) |
1614 > @command('printprevset') | 1614 > @command(b'printprevset') |
1615 > def printprevset(ui, repo): | 1615 > def printprevset(ui, repo): |
1616 > alias = {} | 1616 > alias = {} |
1617 > p = encoding.environ.get('P') | 1617 > p = encoding.environ.get(b'P') |
1618 > if p: | 1618 > if p: |
1619 > alias['P'] = p | 1619 > alias[b'P'] = p |
1620 > revs = repo.anyrevs(['P'], user=True, localalias=alias) | 1620 > revs = repo.anyrevs([b'P'], user=True, localalias=alias) |
1621 > ui.write('P=%r\n' % list(revs)) | 1621 > ui.write(b'P=%r\n' % list(revs)) |
1622 > EOF | 1622 > EOF |
1623 | 1623 |
1624 $ cat >> .hg/hgrc <<EOF | 1624 $ cat >> .hg/hgrc <<EOF |
1625 > custompredicate = ! | 1625 > custompredicate = ! |
1626 > printprevset = $TESTTMP/printprevset.py | 1626 > printprevset = $TESTTMP/printprevset.py |