( )⚙ D6069 uncommit: add flag --allow-dirty-working-copy

This is an archive of the discontinued Mercurial Phabricator instance.

uncommit: add flag --allow-dirty-working-copy
ClosedPublic

Authored by navaneeth.suresh on Mar 4 2019, 10:04 AM.

Details

Summary

This adds a flag --allow-dirty-working-copy as an alias for
the experimental config option experimental.uncommitondirtydir.

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

pulkit added a subscriber: pulkit.Mar 4 2019, 10:14 AM
pulkit added inline comments.
hgext/uncommit.py
165

how about making this as:

allowdirty = opts['allow_dirty_working_copy'] or repo.ui.configbool('experimental', 'uncommitondirtywdir')

This will make the if condition more simpler to understand.

navaneeth.suresh marked an inline comment as done.Mar 4 2019, 10:39 AM
navaneeth.suresh updated this revision to Diff 14344.
hgext/uncommit.py
165

Done.

pulkit accepted this revision.Mar 6 2019, 8:04 AM
This revision was automatically updated to reflect the committed changes.
mharbison72 added inline comments.
tests/test-uncommit.t
164

Did we lose test coverage here? The output before the prior patch noted it was keeping an empty commit, so maybe the suggested flag needs to be used after this abort?

tests/test-uncommit.t
164

I'm not quite sure about this. I'll wait for @pulkit. Also, the fix won't be that easy if needed.

pulkit added inline comments.Mar 8 2019, 1:01 PM
tests/test-uncommit.t
164

@mharbison72 I looked at the test file an there are more instances of that being tested. I am not sure whether we test that here also.