Skip to content
Snippets Groups Projects
Commit 7e9cbb9c authored by Matt Mackall's avatar Matt Mackall
Browse files

dirstate: use 'm' state in otherparent to reduce ambiguity

In rebase-like operations where we abandon the second parent, we can
correctly fix up the state in setparents.
parent dfa44e25
No related branches found
No related tags found
No related merge requests found
......@@ -415,7 +415,13 @@
if self._pl[1] == nullid:
raise util.Abort(_("setting %r to other parent "
"only allowed in merges") % f)
self._addpath(f, 'n', 0, -2, -1)
if f in self and self[f] == 'n':
# merge-like
self._addpath(f, 'm', 0, -2, -1)
else:
# add-like
self._addpath(f, 'n', 0, -2, -1)
if f in self._copymap:
del self._copymap[f]
......
......@@ -66,11 +66,6 @@
$ echo 2b > baz
$ echo new > quux
We shouldn't have anything but foo in merge state here:
$ hg debugstate --nodates | grep "^m"
m 644 3 foo
$ hg ci -m "merge"
main: we should have a merge here:
......
......@@ -38,7 +38,7 @@
(branch merge, don't forget to commit)
$ hg debugstate | grep foo
n 0 -2 unset foo
m 0 -2 unset foo
$ hg st -A foo
M foo
......
......@@ -21,7 +21,7 @@
(branch merge, don't forget to commit)
$ hg debugstate --nodates
n 0 -2 bar
m 0 -2 bar
m 644 14 foo1
copy: foo -> foo1
......@@ -37,7 +37,7 @@
$ hg rm -f foo1 bar
$ hg debugstate --nodates
r 0 -2 bar
r 0 -1 bar
r 0 -1 foo1
copy: foo -> foo1
......@@ -55,7 +55,7 @@
adding foo1
$ hg debugstate --nodates
n 0 -2 bar
m 644 5 bar
m 644 14 foo1
copy: foo -> foo1
......@@ -74,7 +74,7 @@
reverting foo1
$ hg debugstate --nodates
n 0 -2 bar
m 644 5 bar
m 644 14 foo1
copy: foo -> foo1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment