Patchwork [4,of,4,evolve-ext] metaedit: use faster setparents instead of full update

login
register
mail settings
Submitter Mateusz Kwapich
Date Nov. 16, 2016, 7:56 p.m.
Message ID <539a0ff6a3d6664c2dd1.1479326166@devvm314.lla2.facebook.com>
Download mbox | patch
Permalink /patch/17606/
State Superseded
Headers show

Comments

Mateusz Kwapich - Nov. 16, 2016, 7:56 p.m.
# HG changeset patch
# User Mateusz Kwapich <mitrandir@fb.com>
# Date 1479325623 0
#      Wed Nov 16 19:47:03 2016 +0000
# Branch stable
# Node ID 539a0ff6a3d6664c2dd1fede40ba8e3e2efa9986
# Parent  a10be4e9e682615db89200fbfb9583eaf5e05021
metaedit: use faster setparents instead of full update

The working copy is not changing so there is no need to extra status call.
This makes metaedit work on dirty wc.

Patch

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -3304,7 +3304,7 @@  def metaedit(ui, repo, *revs, **opts):
         if opts['fold']:
             ui.status('%i changesets folded\n' % len(revs))
         if newp1 is not None:
-            hg.update(repo, newp1)
+            repo.setparents(newp1)
     finally:
         lockmod.release(lock, wlock)
 
diff --git a/tests/test-evolve.t b/tests/test-evolve.t
--- a/tests/test-evolve.t
+++ b/tests/test-evolve.t
@@ -1489,7 +1489,6 @@  check that metaedit respects allowunstab
   abort: cannot fold chain not ending with a head or with branching
   [255]
   $ hg metaedit --user foobar
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg log --template '{rev}: {author}\n' -r '42:' --hidden
   42: test
   43: foobar
@@ -1497,7 +1496,6 @@  check that metaedit respects allowunstab
   43: foobar
 
   $ HGEDITOR="sed -i'' -e 's/safely/quickly/g'" hg metaedit '.^::.'
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
   $ HGEDITOR=cat hg metaedit '.^::.' --fold
   HG: This is a fold of 2 changesets.
@@ -1519,7 +1517,6 @@  check that metaedit respects allowunstab
   HG: changed a
   HG: changed newfile
   2 changesets folded
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
   $ glog -r .
   @  45:ca7a9e928b25@default(draft) amended
@@ -1553,7 +1550,6 @@  no new commit is created here because th
 
 TODO: don't create a new commit in this case
   $ hg metaedit --config defaults.metaedit=
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg log -r '.^::.' --template '{rev}: {desc|firstline}\n'
   36: add uu
   46: amended
@@ -1570,8 +1566,11 @@  TODO: don't create a new commit in this 
   47: foobar2
   $ hg diff -r 45 -r 46 --hidden
 
-'fold' one commit
+'fold' one commit with dirty wc
+  $ echo x > newfile
   $ hg metaedit 39 --fold --user foobar3
   1 changesets folded
   $ hg log -r 47 --template '{rev}: {author}\n'
   47: foobar2
+  $ hg st -amr
+  M newfile