D2692: merge: return an attrs class from update() and applyupdates()

2018-03-24 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG71543b942eea: merge: return an attrs class from update() and applyupdates() (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D2692: merge: return an attrs class from update() and applyupdates()

2018-03-21 Thread indygreg (Gregory Szorc)
indygreg added a comment. `__slots__` allocates enough space for the exact set of attributes specified rather than backing object instances by `__dict__`. If you create thousands of small objects that all have the same fields, `__slots__` can yield some performance wins. REPOSITORY rHG

D2692: merge: return an attrs class from update() and applyupdates()

2018-03-21 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments. INLINE COMMENTS > merge.py:1403-1404 > > +@attr.s(frozen=True) > +class updateresult(object): > +updatedcount = attr.ib() mpm made me use a tuple with __slots__ for scmutil.status. Any idea when that's better? I think it was something about performance,

D2692: merge: return an attrs class from update() and applyupdates()

2018-03-12 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6969. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2692?vs=6652=6969 REVISION DETAIL https://phab.mercurial-scm.org/D2692 AFFECTED FILES mercurial/hg.py mercurial/merge.py CHANGE DETAILS diff --git

D2692: merge: return an attrs class from update() and applyupdates()

2018-03-04 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Previously, we returned a tuple containing counts. The result of an update is kind of complex and the use of tuples with nameless fields made the code a bit