--- a/hgext/shelve.py Wed Oct 08 14:16:53 2014 -0700
+++ b/hgext/shelve.py Fri Oct 10 12:15:46 2014 -0500
@@ -449,10 +449,12 @@
if not shelvectx in state.pendingctx.children():
# rebase was a no-op, so it produced no child commit
shelvectx = state.pendingctx
+ else:
+ # only strip the shelvectx if the rebase produced it
+ state.stripnodes.append(shelvectx.node())
mergefiles(ui, repo, state.wctx, shelvectx)
- state.stripnodes.append(shelvectx.node())
repair.strip(ui, repo, state.stripnodes, backup=False, topic='shelve')
shelvedstate.clear(repo)
unshelvecleanup(ui, repo, state.name, opts)
--- a/mercurial/templater.py Wed Oct 08 14:16:53 2014 -0700
+++ b/mercurial/templater.py Fri Oct 10 12:15:46 2014 -0500
@@ -330,7 +330,8 @@
# Iterating over items gives a formatted string, so we iterate
# directly over the raw values.
- if item in [i.values()[0] for i in items()]:
+ if ((callable(items) and item in [i.values()[0] for i in items()]) or
+ (isinstance(items, str) and item in items)):
yield _evalifliteral(args[2], context, mapping)
elif len(args) == 4:
yield _evalifliteral(args[3], context, mapping)
--- a/tests/test-command-template.t Wed Oct 08 14:16:53 2014 -0700
+++ b/tests/test-command-template.t Fri Oct 10 12:15:46 2014 -0500
@@ -2296,6 +2296,11 @@
Test ifcontains function
+ $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'
+ 2 is in the string
+ 1 is not
+ 0 is in the string
+
$ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n'
2 did not add a
1 did not add a
--- a/tests/test-shelve.t Wed Oct 08 14:16:53 2014 -0700
+++ b/tests/test-shelve.t Fri Oct 10 12:15:46 2014 -0500
@@ -687,6 +687,49 @@
g
$ hg shelve --delete default
+Recreate some conflict again
+
+ $ cd ../repo
+ $ hg up -C -r 3
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (leaving bookmark test)
+ $ echo y >> a/a
+ $ hg shelve
+ shelved as default
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg up test
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (activating bookmark test)
+ $ hg unshelve
+ unshelving change 'default'
+ rebasing shelved changes
+ merging a/a
+ warning: conflicts during merge.
+ merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
+ unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
+ [1]
+
+Test that resolving all conflicts in one direction (so that the rebase
+is a no-op), works (issue4398)
+
+ $ hg revert -a -r .
+ reverting a/a (glob)
+ $ hg resolve -m a/a
+ (no more unresolved files)
+ $ hg unshelve -c
+ unshelve of 'default' complete
+ $ hg diff
+ $ hg status
+ ? a/a.orig
+ ? foo/foo
+ $ hg summary
+ parent: 4:33f7f61e6c5e tip
+ create conflict
+ branch: default
+ bookmarks: *test
+ commit: 2 unknown (clean)
+ update: (current)
+
$ hg shelve --delete --stat
abort: options '--delete' and '--stat' may not be used together
[255]