This is an archive of the discontinued Mercurial Phabricator instance.

rebase: support "history-editing-backup" config option
ClosedPublic

Authored by khanchi97 on Jul 5 2018, 1:38 AM.

Details

Summary

If you don't want to store any backup while rebasing, you can
use history-editing-backup config option.
[ui]
history-editing-backup = # True or False

Current status of list of commands which supports this config:

  1. histedit
  2. rebase

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

khanchi97 created this revision.Jul 5 2018, 1:38 AM
yuja added a subscriber: yuja.Jul 5 2018, 9:07 AM
Added --no-backup option which gives functionality to
not save backup copies of files.

Can you elaborate why we want this option?

I'm -0 on this because it's unclear when the --no-backup option makes a
difference. --abort isn't the only way to strip revisions while rebasing.

In D3887#60749, @yuja wrote:
Added --no-backup option which gives functionality to
not save backup copies of files.

Can you elaborate why we want this option?

The idea was to add --no-backup option in all those commands which alter history. For this one, let say if someone wants to abort a rebase in between then a --no-backup option should be available (same as histedit)

I'm -0 on this because it's unclear when the --no-backup option makes a
difference. --abort isn't the only way to strip revisions while rebasing.

Oh, I thought --abort is the only way to strip revisions. Shall I try to cover all other cases also where we strip csets; Or If it is not required I can leave it here.

yuja added a comment.Jul 5 2018, 10:41 AM

The idea was to add --no-backup option in all those commands which alter
history. For this one, let say if someone wants to abort a rebase in between
then a --no-backup option should be available (same as histedit)

If he don't want any backup bundle on history editing, it might be better
to add a config knob to turn off the feature than forcing him to always
specify --no-backup.

histedit and rebase are different from strip in that the user doesn't intend
to "remove" changesets.

Oh, I thought --abort is the only way to strip revisions.

Pre-obsmarker rebase will strip rebased revisions.

Shall I try to cover all other cases also where we strip csets; Or If it is
not required I can leave it here.

I don't have strong opinion about that, but it's probably better to add a
test with some comment saying --no-backup doesn't work and should be fixed
later.

pulkit added a subscriber: pulkit.Jul 5 2018, 2:41 PM
In D3887#60752, @yuja wrote:

The idea was to add --no-backup option in all those commands which alter
history. For this one, let say if someone wants to abort a rebase in between
then a --no-backup option should be available (same as histedit)

If he don't want any backup bundle on history editing, it might be better
to add a config knob to turn off the feature than forcing him to always
specify --no-backup.

I agree with Yuya here that a config option is better here.

@yuja @pulkit Definitely, adding a config option is better than any other alternative. Can I start to work on this? (I mean adding config option which will work for all history editing commands)

yuja added a comment.Jul 6 2018, 10:51 PM
@yuja @pulkit Definitely, adding a config option is better than any other alternative. Can I start to work on this? (I mean adding config option which will work for all history editing commands)

Sounds good to me, though I don't have any good name for the config option.

To be clear, I think hg strip should be out of the control of the config
option to be added, because the strip in that case isn't a side effect of
history editing.

khanchi97 edited the summary of this revision. (Show Details)Jul 20 2018, 4:04 PM
khanchi97 retitled this revision from rebase: add --no-backup option to rebase: support "history-editing-backup" config option.
khanchi97 updated this revision to Diff 9639.
yuja added a comment.Aug 2 2018, 9:49 AM

Queued, thanks.

@@ -829,6 +833,8 @@

userrevs = list(repo.revs(opts.get('auto_orphans')))
opts['rev'] = [revsetlang.formatspec('%ld and orphan()', userrevs)]
opts['dest'] = '_destautoorphanrebase(SRC)'

+ backup = ui.configbool('ui', 'history-editing-backup')
+ opts['backup'] = backup

This seems getting ugly. Maybe the option can be carried by rbsrt instead?

self.backupf = ui.configbool('ui', 'history-editing-backup')
This revision was automatically updated to reflect the committed changes.
In D3887#62825, @yuja wrote:

Queued, thanks.

@@ -829,6 +833,8 @@

userrevs = list(repo.revs(opts.get('auto_orphans')))
opts['rev'] = [revsetlang.formatspec('%ld and orphan()', userrevs)]
opts['dest'] = '_destautoorphanrebase(SRC)'

+ backup = ui.configbool('ui', 'history-editing-backup')
+ opts['backup'] = backup

This seems getting ugly. Maybe the option can be carried by rbsrt instead?

self.backupf = ui.configbool('ui', 'history-editing-backup')

I like Yuya's suggestion here. @khanchi97 can you please follow-up?

In D3887#62850, @pulkit wrote:
In D3887#62825, @yuja wrote:

Queued, thanks.

@@ -829,6 +833,8 @@

userrevs = list(repo.revs(opts.get('auto_orphans')))
opts['rev'] = [revsetlang.formatspec('%ld and orphan()', userrevs)]
opts['dest'] = '_destautoorphanrebase(SRC)'

+ backup = ui.configbool('ui', 'history-editing-backup')
+ opts['backup'] = backup

This seems getting ugly. Maybe the option can be carried by rbsrt instead?

self.backupf = ui.configbool('ui', 'history-editing-backup')

I like Yuya's suggestion here. @khanchi97 can you please follow-up?

Okay, I will send a follow-up.