This is an archive of the discontinued Mercurial Phabricator instance.

narrow: mark the critical chunks of narrowing/widening as unsafe
ClosedPublic

Authored by durin42 on Jun 12 2018, 11:31 AM.

Details

Summary

I'm _mostly_ sure these are the only unsafe chunks here.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

durin42 created this revision.Jun 12 2018, 11:31 AM
martinvonz added inline comments.
hgext/narrow/narrowcommands.py
248

Perhaps for another patch, but we could probably move this to before the transaction that starts on line 238 and then move the transaction outside of the unsafeoperation(). The repo won't be more broken if the user interrupts while we delete or add files from the working copy or dirstate here than it could be if they interrupt while doing the same things because of an hg update (right?).

I guess it depends on what we consider unsafe. Is it just things that would result in lost commits or errors from hg verify that we consider unsafe? That seems like a reasonable definition to me.

250

nit: the previous patch left this line outside of the block. make consistent? doesn't really matter, though...

284–296

similar here: i think this could be left outside the unsafeoperation()

durin42 updated this revision to Diff 9328.Jun 27 2018, 11:47 AM
This revision was automatically updated to reflect the committed changes.