Patchwork D3986: split: abort if there's an unfinished operation

login
register
mail settings
Submitter phabricator
Date July 30, 2018, 9:45 p.m.
Message ID <differential-rev-PHID-DREV-bojwlnifazlacjhhlsuj-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/32975/
State New
Headers show

Comments

phabricator - July 30, 2018, 9:45 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/split.py
  tests/test-split.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - July 31, 2018, 5:16 a.m.
quark added a comment.


  FB has users reporting they need to split commits in the middle of a histedit. So this might be too restrictive.

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: quark, mercurial-devel
phabricator - July 31, 2018, 5:20 a.m.
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D3986#61989, @quark wrote:
  
  > FB has users reporting they need to split commits in the middle of a histedit. So this might be too restrictive.
  
  
  Two thoughts:
  
  1. We had talked at Google about having the "edit" action create split markers if the user created multiple commits. Do you think that would address the FB users' use case?
  
  2. It seems very dangerous to not have this check at least when not using obsmarkers and there are descendants of the current commit (split then rebases the descendants), so I'd like to keep the check in at least that case.

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: quark, mercurial-devel
phabricator - July 31, 2018, 6:36 a.m.
martinvonz added a comment.


  Oh, I should have said that I agree with not queuing this patch now. We can discuss what we want to do and do it on the default branch later.

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: quark, mercurial-devel
phabricator - Aug. 1, 2018, 3:35 p.m.
quark added a comment.


  I think a most flexible solution is to not do the check if there is nothing to rebase.

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: quark, mercurial-devel

Patch

diff --git a/tests/test-split.t b/tests/test-split.t
--- a/tests/test-split.t
+++ b/tests/test-split.t
@@ -91,6 +91,15 @@ 
   $ hg forget dirty
   $ rm dirty
 
+Cannot split while there's an unfinished operation
+
+  $ touch .hg/graftstate
+  $ hg split .
+  abort: graft in progress
+  (use 'hg graft --continue' or 'hg graft --stop' to stop)
+  [255]
+  $ rm .hg/graftstate
+
 Make a clean directory for future tests to build off of
 
   $ cp -R . ../clean
diff --git a/hgext/split.py b/hgext/split.py
--- a/hgext/split.py
+++ b/hgext/split.py
@@ -108,6 +108,7 @@ 
         if len(ctx.parents()) > 1:
             raise error.Abort(_('cannot split a merge changeset'))
 
+        cmdutil.checkunfinished(repo)
         cmdutil.bailifchanged(repo)
 
         # Deactivate bookmark temporarily so it won't get moved unintentionally