D3965: histedit: drop --no-backup option

khanchi97 (Sushil khanchi) phabricator at mercurial-scm.org
Thu Jul 19 17:52:31 UTC 2018


khanchi97 created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Dropping this option because now we have a better option
  than passing --no-backup flag every time, now user can
  set a config in hgrc:
  
  [ui]
  history-editing-backup = False
  
  This config aims to operate on every history editing command and
  it is still work in progress. As yuya suggessted it probably to
  late to add full support this config, so making this as
  an experimental config.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3965

AFFECTED FILES
  hgext/histedit.py
  tests/test-histedit-no-backup.t

CHANGE DETAILS

diff --git a/tests/test-histedit-no-backup.t b/tests/test-histedit-no-backup.t
--- a/tests/test-histedit-no-backup.t
+++ b/tests/test-histedit-no-backup.t
@@ -6,6 +6,9 @@
   > histedit=
   > EOF
 
+==========================================
+Test history-editing-backup config option|
+==========================================
 Repo setup:
   $ hg init foo
   $ cd foo
@@ -30,72 +33,6 @@
   o  0   36b4bdd91f5b   1970-01-01 00:00 +0000   test
        one
   
-Check when --no-backup is not passed
-  $ hg histedit -r '36b4bdd91f5b' --commands - << EOF
-  > pick 36b4bdd91f5b 0 one
-  > pick 6153eb23e623 1 two
-  > roll 80d23dfa866d 2 three
-  > edit 7d5187087c79 3 four
-  > EOF
-  merging file
-  Editing (7d5187087c79), you may commit or record as needed now.
-  (hg histedit --continue to resume)
-  [1]
-
-  $ hg histedit --abort
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  saved backup bundle to $TESTTMP/foo/.hg/strip-backup/1d8f701c7b35-cf7be322-backup.hg
-  saved backup bundle to $TESTTMP/foo/.hg/strip-backup/5c0056670bce-b54b65d0-backup.hg
-
-  $ hg st
-  $ hg diff
-  $ hg log -G --style compact
-  @  3[tip]   7d5187087c79   1970-01-01 00:00 +0000   test
-  |    four
-  |
-  o  2   80d23dfa866d   1970-01-01 00:00 +0000   test
-  |    three
-  |
-  o  1   6153eb23e623   1970-01-01 00:00 +0000   test
-  |    two
-  |
-  o  0   36b4bdd91f5b   1970-01-01 00:00 +0000   test
-       one
-  
-
-Check when --no-backup is passed
-  $ hg histedit -r '36b4bdd91f5b' --commands - << EOF
-  > pick 36b4bdd91f5b 0 one
-  > pick 6153eb23e623 1 two
-  > roll 80d23dfa866d 2 three
-  > edit 7d5187087c79 3 four
-  > EOF
-  merging file
-  Editing (7d5187087c79), you may commit or record as needed now.
-  (hg histedit --continue to resume)
-  [1]
-
-  $ hg histedit --abort --no-backup
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-  $ hg st
-  $ hg diff
-  $ hg log -G --style compact
-  @  3[tip]   7d5187087c79   1970-01-01 00:00 +0000   test
-  |    four
-  |
-  o  2   80d23dfa866d   1970-01-01 00:00 +0000   test
-  |    three
-  |
-  o  1   6153eb23e623   1970-01-01 00:00 +0000   test
-  |    two
-  |
-  o  0   36b4bdd91f5b   1970-01-01 00:00 +0000   test
-       one
-  
-==========================================
-Test history-editing-backup config option|
-==========================================
 Test when `history-editing-backup` config option is enabled:
   $ hg histedit -r '36b4bdd91f5b' --commands - << EOF
   > pick 36b4bdd91f5b 0 one
diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -925,7 +925,6 @@
       _("don't strip old nodes after edit is complete")),
      ('', 'abort', False, _('abort an edit in progress')),
      ('o', 'outgoing', False, _('changesets not found in destination')),
-     ('', 'no-backup', False, _('do not save backup copies of files')),
      ('f', 'force', False,
       _('force outgoing even for unrelated repositories')),
      ('r', 'rev', [], _('first revision to be edited'), _('REV'))] +
@@ -1112,8 +1111,7 @@
     goal = _getgoal(opts)
     revs = opts.get('rev', [])
     # experimental config: ui.history-editing-backup
-    nobackup = (opts.get('no_backup') or
-                not ui.configbool('ui', 'history-editing-backup'))
+    nobackup = not ui.configbool('ui', 'history-editing-backup')
     rules = opts.get('commands', '')
     state.keep = opts.get('keep', False)
 



To: khanchi97, durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list