D4102: resolve: support confirm config option with --unmark flag

2018-08-05 Thread khanchi97 (Sushil khanchi)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf35f6791595f: resolve: support confirm config option with 
--unmark flag (authored by khanchi97, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4102?vs=9905=9938

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

AFFECTED FILES
  mercurial/commands.py
  tests/test-resolve.t

CHANGE DETAILS

diff --git a/tests/test-resolve.t b/tests/test-resolve.t
--- a/tests/test-resolve.t
+++ b/tests/test-resolve.t
@@ -557,6 +557,35 @@
   R emp2
   R emp3
 
+Test that commands.resolve.confirm respect --unmark option (only when no 
patterns args are given):
+===
+
+  $ hg resolve -u emp1
+
+  $ hg resolve -l
+  U emp1
+  R emp2
+  R emp3
+
+  $ hg resolve -u << EOF
+  > n
+  > EOF
+  mark all resolved files as unresolved (yn)? n
+  abort: user quit
+  [255]
+
+  $ hg resolve -m << EOF
+  > y
+  > EOF
+  mark all unresolved files as resolved (yn)? y
+  (no more unresolved files)
+  continue: hg rebase --continue
+
+  $ hg resolve -l
+  R emp1
+  R emp2
+  R emp3
+
   $ hg rebase --abort
   rebase aborted
   $ cd ..
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4546,10 +4546,15 @@
 if not (all or pats or show or mark or unmark):
 raise error.Abort(_('no files or directories specified'),
  hint=('use --all to re-merge all unresolved files'))
+
 if mark and confirm and not pats:
 if ui.promptchoice(_(b'mark all unresolved files as resolved (yn)?'
  b'$$  $$ ')):
 raise error.Abort(_('user quit'))
+if unmark and confirm and not pats:
+if ui.promptchoice(_(b'mark all resolved files as unresolved (yn)?'
+ b'$$  $$ ')):
+raise error.Abort(_('user quit'))
 
 if show:
 ui.pager('resolve')



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


D4102: resolve: support confirm config option with --unmark flag

2018-08-05 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  Please add about this config option in the releasenotes page for 4.8 at 
https://www.mercurial-scm.org/wiki/Release4.8.

INLINE COMMENTS

> commands.py:4537
>  
>  if all and confirm:
>  if ui.promptchoice(_(b're-merge all unresolved files (yn)?'

This one should be moved after conditional in line 4544. Also we can now better 
organize the three if 'confirm' conditionals now. Can you please follow-up?

REPOSITORY
  rHG Mercurial

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

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


D4102: resolve: support confirm config option with --unmark flag

2018-08-05 Thread pulkit (Pulkit Goyal)
pulkit accepted this revision.
pulkit added inline comments.

INLINE COMMENTS

> khanchi97 wrote in commands.py:4555
> Oops, sorry.

You should not be sorry!

REPOSITORY
  rHG Mercurial

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

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


D4102: resolve: support confirm config option with --unmark flag

2018-08-04 Thread khanchi97 (Sushil khanchi)
khanchi97 updated this revision to Diff 9905.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4102?vs=9899=9905

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

AFFECTED FILES
  mercurial/commands.py
  tests/test-resolve.t

CHANGE DETAILS

diff --git a/tests/test-resolve.t b/tests/test-resolve.t
--- a/tests/test-resolve.t
+++ b/tests/test-resolve.t
@@ -536,6 +536,35 @@
   R emp2
   R emp3
 
+Test that commands.resolve.confirm respect --unmark option (only when no 
patterns args are given):
+===
+
+  $ hg resolve -u emp1
+
+  $ hg resolve -l
+  U emp1
+  R emp2
+  R emp3
+
+  $ hg resolve -u << EOF
+  > n
+  > EOF
+  mark all resolved files as unresolved (yn)? n
+  abort: user quit
+  [255]
+
+  $ hg resolve -m << EOF
+  > y
+  > EOF
+  mark all unresolved files as resolved (yn)? y
+  (no more unresolved files)
+  continue: hg rebase --continue
+
+  $ hg resolve -l
+  R emp1
+  R emp2
+  R emp3
+
   $ hg rebase --abort
   rebase aborted
   $ cd ..
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4546,10 +4546,15 @@
 if not (all or pats or show or mark or unmark):
 raise error.Abort(_('no files or directories specified'),
  hint=('use --all to re-merge all unresolved files'))
+
 if mark and confirm and not pats:
 if ui.promptchoice(_(b'mark all unresolved files as resolved (yn)?'
  b'$$  $$ ')):
 raise error.Abort(_('user quit'))
+if unmark and confirm and not pats:
+if ui.promptchoice(_(b'mark all resolved files as unresolved (yn)?'
+ b'$$  $$ ')):
+raise error.Abort(_('user quit'))
 
 if show:
 ui.pager('resolve')



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


D4102: resolve: support confirm config option with --unmark flag

2018-08-04 Thread khanchi97 (Sushil khanchi)
khanchi97 added inline comments.

INLINE COMMENTS

> pulkit wrote in commands.py:4555
> This should be 'mark all resolved files as unresolved'.

Oops, sorry.

REPOSITORY
  rHG Mercurial

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

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


D4102: resolve: support confirm config option with --unmark flag

2018-08-04 Thread khanchi97 (Sushil khanchi)
khanchi97 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Now, commands.resolve.confirm also respect --unmark option; and
  confirm to unresolve all resolved files.
  It will confirm only when no files pats are passed (same as --mark),
  because when no pats are passed the default is to mark resolved files
  as unresolved.
  And if user has passed file pats then I think there is no need to confirm
  for that.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/commands.py
  tests/test-resolve.t

CHANGE DETAILS

diff --git a/tests/test-resolve.t b/tests/test-resolve.t
--- a/tests/test-resolve.t
+++ b/tests/test-resolve.t
@@ -536,6 +536,35 @@
   R emp2
   R emp3
 
+Test that commands.resolve.confirm respect --unmark option (only when no 
patterns args are given):
+===
+
+  $ hg resolve -u emp1
+
+  $ hg resolve -l
+  U emp1
+  R emp2
+  R emp3
+
+  $ hg resolve -u << EOF
+  > n
+  > EOF
+  unmark all resolved files as unresolved (yn)? n
+  abort: user quit
+  [255]
+
+  $ hg resolve -m << EOF
+  > y
+  > EOF
+  mark all unresolved files as resolved (yn)? y
+  (no more unresolved files)
+  continue: hg rebase --continue
+
+  $ hg resolve -l
+  R emp1
+  R emp2
+  R emp3
+
   $ hg rebase --abort
   rebase aborted
   $ cd ..
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4546,10 +4546,15 @@
 if not (all or pats or show or mark or unmark):
 raise error.Abort(_('no files or directories specified'),
  hint=('use --all to re-merge all unresolved files'))
+
 if mark and confirm and not pats:
 if ui.promptchoice(_(b'mark all unresolved files as resolved (yn)?'
  b'$$  $$ ')):
 raise error.Abort(_('user quit'))
+if unmark and confirm and not pats:
+if ui.promptchoice(_(b'unmark all resolved files as unresolved (yn)?'
+ b'$$  $$ ')):
+raise error.Abort(_('user quit'))
 
 if show:
 ui.pager('resolve')



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