Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/bookmarks.py (4 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
de868f1cbd6a | f7172f742b5b | Pierre-Yves David | Nov 8 2019, 7:36 AM |
Status | Author | Revision | |
---|---|---|---|
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute |
""" | """ | ||||
def __init__(self, repo): | def __init__(self, repo): | ||||
self._repo = repo | self._repo = repo | ||||
self._refmap = refmap = {} # refspec: node | self._refmap = refmap = {} # refspec: node | ||||
self._nodemap = nodemap = {} # node: sorted([refspec, ...]) | self._nodemap = nodemap = {} # node: sorted([refspec, ...]) | ||||
self._clean = True | self._clean = True | ||||
self._aclean = True | self._aclean = True | ||||
nm = repo.changelog.nodemap | has_node = repo.changelog.index.has_node | ||||
tonode = bin # force local lookup | tonode = bin # force local lookup | ||||
try: | try: | ||||
with _getbkfile(repo) as bkfile: | with _getbkfile(repo) as bkfile: | ||||
for line in bkfile: | for line in bkfile: | ||||
line = line.strip() | line = line.strip() | ||||
if not line: | if not line: | ||||
continue | continue | ||||
try: | try: | ||||
sha, refspec = line.split(b' ', 1) | sha, refspec = line.split(b' ', 1) | ||||
node = tonode(sha) | node = tonode(sha) | ||||
if node in nm: | if has_node(node): | ||||
refspec = encoding.tolocal(refspec) | refspec = encoding.tolocal(refspec) | ||||
refmap[refspec] = node | refmap[refspec] = node | ||||
nrefs = nodemap.get(node) | nrefs = nodemap.get(node) | ||||
if nrefs is None: | if nrefs is None: | ||||
nodemap[node] = [refspec] | nodemap[node] = [refspec] | ||||
else: | else: | ||||
nrefs.append(refspec) | nrefs.append(refspec) | ||||
if nrefs[-2] > refspec: | if nrefs[-2] > refspec: |