Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHG70f8c64812db: typing: fix directives mangled by black
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- stable
- Lint
No Linters Available - Unit
No Unit Test Coverage
( )
| pulkit |
| hg-reviewers |
| No Linters Available |
| No Unit Test Coverage |
| Path | Packages | |||
|---|---|---|---|---|
| M | mercurial/changegroup.py (7 lines) | |||
| M | mercurial/dagparser.py (24 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| 4f79f998dbcb | b7dee0f79993 | Matt Harbison | Mar 13 2021, 12:41 AM |
| Status | Author | Revision | |
|---|---|---|---|
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 |
| tmfnodes = {b'': manifests} | tmfnodes = {b'': manifests} | ||||
| # Callback for the manifest, used to collect linkrevs for filelog | # Callback for the manifest, used to collect linkrevs for filelog | ||||
| # revisions. | # revisions. | ||||
| # Returns the linkrev node (collected in lookupcl). | # Returns the linkrev node (collected in lookupcl). | ||||
| def makelookupmflinknode(tree, nodes): | def makelookupmflinknode(tree, nodes): | ||||
| if fastpathlinkrev: | if fastpathlinkrev: | ||||
| assert not tree | assert not tree | ||||
| return ( | |||||
| manifests.__getitem__ | # pytype: disable=unsupported-operands | ||||
| ) # pytype: disable=unsupported-operands | return manifests.__getitem__ | ||||
| # pytype: enable=unsupported-operands | |||||
| def lookupmflinknode(x): | def lookupmflinknode(x): | ||||
| """Callback for looking up the linknode for manifests. | """Callback for looking up the linknode for manifests. | ||||
| Returns the linkrev node for the specified manifest. | Returns the linkrev node for the specified manifest. | ||||
| SIDE EFFECT: | SIDE EFFECT: | ||||
| >>> try: list(parsedag(b'+1 bad')) | >>> try: list(parsedag(b'+1 bad')) | ||||
| ... except Exception as e: print(pycompat.sysstr(bytes(e))) | ... except Exception as e: print(pycompat.sysstr(bytes(e))) | ||||
| invalid character in dag description: bad... | invalid character in dag description: bad... | ||||
| ''' | ''' | ||||
| if not desc: | if not desc: | ||||
| return | return | ||||
| wordchars = pycompat.bytestr( | # pytype: disable=wrong-arg-types | ||||
| string.ascii_letters + string.digits | wordchars = pycompat.bytestr(string.ascii_letters + string.digits) | ||||
| ) # pytype: disable=wrong-arg-types | # pytype: enable=wrong-arg-types | ||||
| labels = {} | labels = {} | ||||
| p1 = -1 | p1 = -1 | ||||
| r = 0 | r = 0 | ||||
| def resolve(ref): | def resolve(ref): | ||||
| if not ref: | if not ref: | ||||
| return p1 | return p1 | ||||
| elif ref[0] in pycompat.bytestr( | # pytype: disable=wrong-arg-types | ||||
| string.digits | elif ref[0] in pycompat.bytestr(string.digits): | ||||
| ): # pytype: disable=wrong-arg-types | # pytype: enable=wrong-arg-types | ||||
| return r - int(ref) | return r - int(ref) | ||||
| else: | else: | ||||
| return labels[ref] | return labels[ref] | ||||
| chiter = pycompat.iterbytestr(desc) | chiter = pycompat.iterbytestr(desc) | ||||
| def nextch(): | def nextch(): | ||||
| return next(chiter, b'\0') | return next(chiter, b'\0') | ||||
| def nextstring(c): | def nextstring(c): | ||||
| if c == b'"': | if c == b'"': | ||||
| return nextdelimited(nextch(), b'"', b'\\') | return nextdelimited(nextch(), b'"', b'\\') | ||||
| else: | else: | ||||
| return nextrun(c, wordchars) | return nextrun(c, wordchars) | ||||
| c = nextch() | c = nextch() | ||||
| while c != b'\0': | while c != b'\0': | ||||
| while c in pycompat.bytestr( | # pytype: disable=wrong-arg-types | ||||
| string.whitespace | while c in pycompat.bytestr(string.whitespace): | ||||
| ): # pytype: disable=wrong-arg-types | # pytype: enable=wrong-arg-types | ||||
| c = nextch() | c = nextch() | ||||
| if c == b'.': | if c == b'.': | ||||
| yield b'n', (r, [p1]) | yield b'n', (r, [p1]) | ||||
| p1 = r | p1 = r | ||||
| r += 1 | r += 1 | ||||
| c = nextch() | c = nextch() | ||||
| elif c == b'+': | elif c == b'+': | ||||
| c, digs = nextrun( | # pytype: disable=wrong-arg-types | ||||
| nextch(), pycompat.bytestr(string.digits) | c, digs = nextrun(nextch(), pycompat.bytestr(string.digits)) | ||||
| ) # pytype: disable=wrong-arg-types | # pytype: enable=wrong-arg-types | ||||
| n = int(digs) | n = int(digs) | ||||
| for i in pycompat.xrange(0, n): | for i in pycompat.xrange(0, n): | ||||
| yield b'n', (r, [p1]) | yield b'n', (r, [p1]) | ||||
| p1 = r | p1 = r | ||||
| r += 1 | r += 1 | ||||
| elif c in b'*/': | elif c in b'*/': | ||||
| if c == b'*': | if c == b'*': | ||||
| c = nextch() | c = nextch() | ||||