This is an archive of the discontinued Mercurial Phabricator instance.

filemerge: fix backing up an in-memory file to a custom location
ClosedPublic

Authored by phillco on Jan 4 2018, 2:36 PM.

Details

Summary

If the user specifies a ui.origbackuppath, we used to always copy the file
there, but if the source file is in memory we must write it instead of copying.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

phillco created this revision.Jan 4 2018, 2:36 PM
phillco edited the summary of this revision. (Show Details)Jan 4 2018, 2:37 PM
durham accepted this revision.Jan 4 2018, 3:17 PM
durham added a subscriber: durham.

Accepting, since it seems more correct than before.

Should we even be calling _makebackup in the case of an inmemory merge? Like, maybe the makebackup should be conditional based on if the source file context is actually a workingctx?

mercurial/filemerge.py
623

I know you're just documenting the parameter that already existed, but might be nice to explain why this is (if you happen to know why right now).

643

s/wherever/whatever/

Should we even be calling _makebackup in the case of an inmemory merge? Like, maybe the makebackup should be conditional based on if the source file context is actually a workingctx?

The merge process itself uses the backup, it's not just for the user.

mercurial/filemerge.py
623

I think I can

phillco edited the summary of this revision. (Show Details)Jan 5 2018, 12:35 AM
phillco updated this revision to Diff 4697.
phillco updated this revision to Diff 4699.Jan 5 2018, 12:38 AM
This revision was automatically updated to reflect the committed changes.