Patchwork [Bug,5162] New: Quitting `hg split -r <rev>` does not clean working directory

login
register
mail settings
Submitter mercurial-bugs@selenic.com
Date March 29, 2016, 12:50 a.m.
Message ID <bug-5162-285@https.bz.mercurial-scm.org/>
Download mbox | patch
Permalink /patch/14119/
State Not Applicable
Headers show

Comments

mercurial-bugs@selenic.com - March 29, 2016, 12:50 a.m.
https://bz.mercurial-scm.org/show_bug.cgi?id=5162

            Bug ID: 5162
           Summary: Quitting `hg split -r <rev>` does not clean working
                    directory
           Product: Mercurial
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: evolution
          Assignee: bugzilla@selenic.com
          Reporter: hg@pewpew.net
                CC: mercurial-devel@selenic.com,
                    pierre-yves.david@ens-lyon.org

Possible duplicate of: https://bz.mercurial-scm.org/show_bug.cgi?id=3591
("record shouldn't touch the working directory")?

If you use hg split -r <rev>, it looks like it applies <rev> to the working
directory and starts split.  If you quit out of split, it doesn't clean up the
working directory (in the repro below, I'm on revision 1, where 'foo' should
have the contents of 'one'.  I run hg split, quit, and cat foo, and now it has
contents 'two').  Note that it didn't actually check out <rev> so it is now
reporting this as a diff (in the repro below `hg summary` says we are on
revision 1, not revision 2)



spectral@dragonair:~/src/hg/bug_reports/split_r_bug$ export
HGRCPATH=~/src/hg/bug_reports/split_r_bug/hgrc
spectral@dragonair:~/src/hg/bug_reports/split_r_bug$ cat $HGRCPATH
[ui]
username=kyle

[extensions]
evolve=~/src/hg/mutable-history/hgext/evolve.py
spectral@dragonair:~/src/hg/bug_reports/split_r_bug$ hg init repro; cd repro
spectral@dragonair:~/src/hg/bug_reports/split_r_bug/repro$ echo zero > foo; hg
ci -Am zero
adding foo
spectral@dragonair:~/src/hg/bug_reports/split_r_bug/repro$ echo one > foo; hg
ci -Am one
spectral@dragonair:~/src/hg/bug_reports/split_r_bug/repro$ echo two > foo; hg
ci -Am two
spectral@dragonair:~/src/hg/bug_reports/split_r_bug/repro$ hg prev
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
[1] one
spectral@dragonair:~/src/hg/bug_reports/split_r_bug/repro$ cat foo
one


-- bug starts here --
spectral@dragonair:~/src/hg/bug_reports/split_r_bug/repro$ hg split -r 2
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
reverting foo
spectral@dragonair:~/src/hg/bug_reports/split_r_bug/repro$ hg summary
parent: 1:46f160c23203 
 one
branch: default
commit: 1 modified (new branch head)
update: 1 new changesets (update)
phases: 3 draft



-- version information --
spectral@dragonair:~/src/hg/bug_reports/split_r_bug/repro$ hg --version
Mercurial Distributed SCM (version 3.7.1+310-c7f89ad87bae)
(see https://mercurial-scm.org for more information)

Copyright (C) 2005-2016 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
spectral@dragonair:~/src/hg/bug_reports/split_r_bug/repro$ cd
~/src/hg/mutable-history
spectral@dragonair:~/src/hg/mutable-history$ hg summary
parent: 1634:9ae4e79a28f3 tip
 evolve--list: initial implementation
branch: default
commit: (clean)
update: (current)
spectral@dragonair:~/src/hg/mutable-history$

Patch

diff --git a/foo b/foo
1 hunks, 1 lines changed
examine changes to 'foo'? [Ynesfdaq?] q

abort: user quit



-- things aren't the way I would expect them to be --
spectral@dragonair:~/src/hg/bug_reports/split_r_bug/repro$ cat foo
two
spectral@dragonair:~/src/hg/bug_reports/split_r_bug/repro$ hg diff
diff -r 46f160c23203 foo
--- a/foo       Mon Mar 28 17:36:04 2016 -0700
+++ b/foo       Mon Mar 28 17:36:29 2016 -0700
@@ -1,1 +1,1 @@ 
-one
+two