Makes obs markers for undos more meaningful. When an undo performs a strict one
to one change, the written obs marker reflects that and the user even gets a
helpful ui message in smartlog. One to many undos do not support such obs
markers (currently) because we can't tell splits and divergence apart easily.
Details
Details
- Reviewers
quark - Group Reviewers
Restricted Project - Commits
- rFBHGX80f01f00d59a: undo: meaningful obs markers for undos
Diff Detail
Diff Detail
- Repository
- rFBHGX Facebook Mercurial Extensions
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
Function looks good. But there are some easy wins here.
hgext3rd/undo.py | ||
---|---|---|
547–556 | This is O(N * M) where N = len(related), M = len(destinations). Use set operations to make it something like O(M * log N): related = set(obsutil.allprecursors(unfi.obsstore, [ctx.node()])) related.update(obsutil.allsuccessors(unfi.obsstore, [ctx.node()])) related.intersection_update(x.node() for x in showctxs) (note: ctxs is more common than ctxts in the existing code base) | |
tests/test-undo.t | ||
338 | It's better to show more information about other nodes, like: -T "{node|short} {if(undosuccessors, label('sl.undo', '(Undone as {join(undosuccessors% \'{shortest(undosuccessor, 6)}\', ', ')})'))}" This will show where 1dafc0 is. |
This is O(N * M) where N = len(related), M = len(destinations). Use set operations to make it something like O(M * log N):
(note: ctxs is more common than ctxts in the existing code base)