Patchwork [Bug,5094] New: histedit tip with a last hunk restored from the previous commit is treated as dirty

login
register
mail settings
Submitter mercurial-bugs@selenic.com
Date Feb. 10, 2016, 7:29 p.m.
Message ID <bug-5094-285@https.bz.mercurial-scm.org/>
Download mbox | patch
Permalink /patch/13105/
State Not Applicable
Headers show

Comments

mercurial-bugs@selenic.com - Feb. 10, 2016, 7:29 p.m.
https://bz.mercurial-scm.org/show_bug.cgi?id=5094

            Bug ID: 5094
           Summary: histedit tip with a last hunk restored from the
                    previous commit is treated as dirty
           Product: Mercurial
           Version: 3.7.1
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: histedit
          Assignee: bugzilla@selenic.com
          Reporter: visionofarun@gmail.com
                CC: mercurial-devel@selenic.com

Here is the sequence of steps to reproduce the issue.

23:58:20 ~/temp1 $ ls
23:58:20 ~/temp1 $ hg init
23:58:25 ~/temp1 $ touch main.cpp
23:58:37 ~/temp1 $ hg add main.cpp
23:58:43 ~/temp1 $ vim main.cpp
23:58:59 ~/temp1 $ hg diff main.cpp
00:01:43 ~/temp1 $ hg histe --continue
abort: working copy has pending changes
(amend, commit, or revert them and run histedit --continue, or abort with
histedit --abort)
00:02:01 ~/temp1 $ hg histe --continue
abort: working copy has pending changes
(amend, commit, or revert them and run histedit --continue, or abort with
histedit --abort)
00:02:08 ~/temp1 $ hg histe --continue
abort: working copy has pending changes
(amend, commit, or revert them and run histedit --continue, or abort with
histedit --abort)
00:02:11 ~/temp1 $ hg lg -G
@  4    e904672a1e33   draft    72 seconds ago  commit on feature branch. arun
feature tip
|
o  3    f3b4d5a07866   draft    72 seconds ago  commit on feature branch. arun
feature
|
o  2    3b9ffaef2fd1   draft    72 seconds ago  commit on feature branch. arun
feature
|
| o  1  9c2d715a4c80   draft    72 seconds ago  commit on feature branch. arun
feature
|/
o  0    4fa16df513e2   draft    2 minutes ago   Initial commit on default. arun
default

00:02:17 ~/temp1 $ hg sum
parent: 4:e904672a1e33 tip
 commit on feature branch.
branch: default
commit: (new branch)
update: (current)
phases: 5 draft
hist:   1 remaining (histedit --continue)
00:51:04 ~/temp1 $ hg histedit --abort
00:51:49 ~/temp2 $ hg sum
parent: 4:e904672a1e33 tip
 new branch commit.
branch: default
commit: (new branch)
update: (current)
phases: 5 draft
00:51:52 ~/temp2 $
00:54:58 ~/temp1 $ hg up -C tip
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
00:55:04 ~/temp1 $ hg sum
parent: 4:e904672a1e33 tip
 commit on feature branch.
branch: feature
commit: (clean)
update: 1 new changesets, 2 branch heads (merge)
phases: 5 draft
00:55:06 ~/temp1 $

Patch

diff -r 000000000000 main.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp  Wed Feb 10 23:59:04 2016 +0530
@@ -0,0 +1,4 @@ 
+int main(int argc, const char *argv[])
+{
+    return 0;
+}
23:59:04 ~/temp1 $ hg ci -m "Initial commit on default."
23:59:50 ~/temp1 $ hg branch feature
marked working directory as branch feature
(branches are permanent and global, did you want a bookmark?)
23:59:56 ~/temp1 $ vim main.cpp
00:00:25 ~/temp1 $ hg diff
diff -r 4fa16df513e2 main.cpp
--- a/main.cpp  Wed Feb 10 23:59:50 2016 +0530
+++ b/main.cpp  Thu Feb 11 00:00:32 2016 +0530
@@ -1,4 +1,7 @@ 
+void dummy()
+{
+}
+
 int main(int argc, const char *argv[])
 {
-    return 0;
 }
00:00:32 ~/temp1 $ hg ci -m "commit on feature branch."
00:01:05 ~/temp1 $ hg histedit tip
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
reverting main.cpp
Editing (9c2d715a4c80), you may commit or record as needed now.
(hg histedit --continue to resume)
00:01:21 ~/temp1 $ hg vim main.cpp
2 files to edit
00:01:36 ~/temp1 $ hg diff
diff -r 4fa16df513e2 main.cpp
--- a/main.cpp  Wed Feb 10 23:59:50 2016 +0530
+++ b/main.cpp  Thu Feb 11 00:01:43 2016 +0530
@@ -1,3 +1,7 @@ 
+void dummy()
+{
+}
+
 int main(int argc, const char *argv[])
 {
     return 0;