Show More
@@ -85,20 +85,20 b' Setup rebase with multiple destinations' | |||||
85 | > from mercurial import registrar, revset, revsetlang, smartset |
|
85 | > from mercurial import registrar, revset, revsetlang, smartset | |
86 | > revsetpredicate = registrar.revsetpredicate() |
|
86 | > revsetpredicate = registrar.revsetpredicate() | |
87 | > cache = {} |
|
87 | > cache = {} | |
88 | > @revsetpredicate('map') |
|
88 | > @revsetpredicate(b'map') | |
89 | > def map(repo, subset, x): |
|
89 | > def map(repo, subset, x): | |
90 | > """(set, mapping)""" |
|
90 | > """(set, mapping)""" | |
91 | > setarg, maparg = revsetlang.getargs(x, 2, 2, '') |
|
91 | > setarg, maparg = revsetlang.getargs(x, 2, 2, b'') | |
92 | > rset = revset.getset(repo, smartset.fullreposet(repo), setarg) |
|
92 | > rset = revset.getset(repo, smartset.fullreposet(repo), setarg) | |
93 | > mapstr = revsetlang.getstring(maparg, '') |
|
93 | > mapstr = revsetlang.getstring(maparg, b'') | |
94 | > map = dict(a.split(':') for a in mapstr.split(',')) |
|
94 | > map = dict(a.split(b':') for a in mapstr.split(b',')) | |
95 | > rev = rset.first() |
|
95 | > rev = rset.first() | |
96 | > desc = repo[rev].description() |
|
96 | > desc = repo[rev].description() | |
97 | > newdesc = map.get(desc) |
|
97 | > newdesc = map.get(desc) | |
98 | > if newdesc == 'null': |
|
98 | > if newdesc == b'null': | |
99 | > revs = [-1] |
|
99 | > revs = [-1] | |
100 | > else: |
|
100 | > else: | |
101 | > query = revsetlang.formatspec('desc(%s)', newdesc) |
|
101 | > query = revsetlang.formatspec(b'desc(%s)', newdesc) | |
102 | > revs = repo.revs(query) |
|
102 | > revs = repo.revs(query) | |
103 | > return smartset.baseset(revs) |
|
103 | > return smartset.baseset(revs) | |
104 | > EOF |
|
104 | > EOF |
General Comments 0
You need to be logged in to leave comments.
Login now