D5540: histedit: fix --continue and --abort when curses is enabled

2019-01-10 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9bc7ec924234: histedit: fix --continue and --abort when 
curses is enabled (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5540?vs=13136&id=13140

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

AFFECTED FILES
  hgext/histedit.py
  tests/test-histedit-non-commute.t

CHANGE DETAILS

diff --git a/tests/test-histedit-non-commute.t 
b/tests/test-histedit-non-commute.t
--- a/tests/test-histedit-non-commute.t
+++ b/tests/test-histedit-non-commute.t
@@ -161,7 +161,10 @@
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
   Fix up the change (pick 7b4e2f4b7bcd)
   (hg histedit --continue to resume)
-  $ hg histedit --continue 2>&1 | fixbundle
+We forcibly enable curses here so we can verify that continuing works
+with curses enabled.
+  $ hg histedit --continue --config ui.interactive=true \
+  >   --config ui.interface=curses 2>&1 | fixbundle
   abort: unresolved merge conflicts (see 'hg help resolve')
 
 This failure is caused by 7b4e2f4b7bcd "e" not rebasing the non commutative
diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1593,7 +1593,10 @@
 for intentional "edit" command, but also for resolving unexpected
 conflicts).
 """
-if ui.interface('histedit') == 'curses':
+# kludge: _chistedit only works for starting an edit, not aborting
+# or continuing, so fall back to regular _texthistedit for those
+# operations.
+if ui.interface('histedit') == 'curses' and  _getgoal(opts) == goalnew:
 return _chistedit(ui, repo, *freeargs, **opts)
 return _texthistedit(ui, repo, *freeargs, **opts)
 



To: durin42, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5540: histedit: fix --continue and --abort when curses is enabled

2019-01-10 Thread durin42 (Augie Fackler)
durin42 updated this revision to Diff 13136.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5540?vs=13112&id=13136

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

AFFECTED FILES
  hgext/histedit.py
  tests/test-histedit-non-commute.t

CHANGE DETAILS

diff --git a/tests/test-histedit-non-commute.t 
b/tests/test-histedit-non-commute.t
--- a/tests/test-histedit-non-commute.t
+++ b/tests/test-histedit-non-commute.t
@@ -161,7 +161,10 @@
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
   Fix up the change (pick 7b4e2f4b7bcd)
   (hg histedit --continue to resume)
-  $ hg histedit --continue 2>&1 | fixbundle
+We forcibly enable curses here so we can verify that continuing works
+with curses enabled.
+  $ hg histedit --continue --config ui.interactive=true \
+  >   --config ui.interface=curses 2>&1 | fixbundle
   abort: unresolved merge conflicts (see 'hg help resolve')
 
 This failure is caused by 7b4e2f4b7bcd "e" not rebasing the non commutative
diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1599,7 +1599,10 @@
 for intentional "edit" command, but also for resolving unexpected
 conflicts).
 """
-if ui.interface('histedit') == 'curses':
+# kludge: _chistedit only works for starting an edit, not aborting
+# or continuing, so fall back to regular _texthistedit for those
+# operations.
+if ui.interface('histedit') == 'curses' and  _getgoal(opts) == goalnew:
 return _chistedit(ui, repo, *freeargs, **opts)
 return _texthistedit(ui, repo, *freeargs, **opts)
 



To: durin42, #hg-reviewers
Cc: martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5540: histedit: fix --continue and --abort when curses is enabled

2019-01-09 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> histedit.py:1605-1606
> +# operations.
> +if ui.interface('histedit') == 'curses' and not (
> +opts.get( b'continue', False) or opts.get( b'abort', False)):
>  return _chistedit(ui, repo, *freeargs, **opts)

Maybe use `... and _getgoal(opts) == goalnew` instead? In addition to being 
simpler, that seems like it would also correctly handle the `--edit-plan` 
option (which I didn't even know existed until just now).

REPOSITORY
  rHG Mercurial

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

To: durin42, #hg-reviewers
Cc: martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5540: histedit: fix --continue and --abort when curses is enabled

2019-01-09 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I overlooked this when I did the initial import.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/histedit.py
  tests/test-histedit-non-commute.t

CHANGE DETAILS

diff --git a/tests/test-histedit-non-commute.t 
b/tests/test-histedit-non-commute.t
--- a/tests/test-histedit-non-commute.t
+++ b/tests/test-histedit-non-commute.t
@@ -161,7 +161,10 @@
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
   Fix up the change (pick 7b4e2f4b7bcd)
   (hg histedit --continue to resume)
-  $ hg histedit --continue 2>&1 | fixbundle
+We forcibly enable curses here so we can verify that continuing works
+with curses enabled.
+  $ hg histedit --continue --config ui.interactive=true \
+  >   --config ui.interface=curses 2>&1 | fixbundle
   abort: unresolved merge conflicts (see 'hg help resolve')
 
 This failure is caused by 7b4e2f4b7bcd "e" not rebasing the non commutative
diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1599,7 +1599,11 @@
 for intentional "edit" command, but also for resolving unexpected
 conflicts).
 """
-if ui.interface('histedit') == 'curses':
+# kludge: _chistedit only works for starting an edit, not aborting
+# or continuing, so fall back to regular _texthistedit for those
+# operations.
+if ui.interface('histedit') == 'curses' and not (
+opts.get( b'continue', False) or opts.get( b'abort', False)):
 return _chistedit(ui, repo, *freeargs, **opts)
 return _texthistedit(ui, repo, *freeargs, **opts)
 



To: durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel