--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -203,7 +203,7 @@ class filectx(object):
def data(self): return self._filelog.read(self._filenode)
def renamed(self): return self._filelog.renamed(self._filenode)
def path(self): return self._path
- def size(self): return self._filelog.len(self._filerev)
+ def size(self): return self._filelog.size(self._filerev)
def cmp(self, text): return self._filelog.cmp(self._filenode, text)
--- a/mercurial/filelog.py
+++ b/mercurial/filelog.py
@@ -65,15 +65,15 @@ class filelog(revlog):
return (m["copy"], bin(m["copyrev"]))
return False
- def len(self, rev):
- """return the len of a given revision"""
+ def size(self, rev):
+ """return the size of a given revision"""
# for revisions with renames, we have to go the slow way
node = self.node(rev)
if self.renamed(node):
return len(self.read(node))
- return self.size(rev)
+ return revlog.size(self, rev)
def cmp(self, node, text):
"""compare text with a given file revision"""
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -384,13 +384,9 @@ def update(repo, node, branchmerge, forc
if branchmerge:
raise util.Abort(_("there is nothing to merge, just use "
"'hg update' or look at 'hg heads'"))
- elif not branchmerge:
- if not overwrite:
- if wc.files():
- raise util.Abort(_("outstanding uncommited changes, use "
- "'hg update -C' to lose changes"))
- else:
- overwrite = True
+ elif not (overwrite or branchmerge):
+ raise util.Abort(_("update spans branches, use 'hg merge' "
+ "or 'hg update -C' to lose changes"))
if branchmerge and not forcemerge:
if wc.files():
raise util.Abort(_("outstanding uncommitted changes"))
--- a/tests/test-merge5
+++ b/tests/test-merge5
@@ -12,13 +12,9 @@ hg commit -m"comment #1" -d "1000000 0"
hg update 0
rm b
hg commit -A -m"comment #2" -d "1000000 0"
-
-echo This is file a > a
# in theory, we shouldn't need the "-y" below, but it prevents
# this test from hanging when "hg update" erroneously prompts the
# user for "keep or delete"
-hg update -y 1 # should fail (unclean repo)
-hg revert a
hg update -y 1
exit 0
--- a/tests/test-merge5.out
+++ b/tests/test-merge5.out
@@ -1,4 +1,3 @@
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
removing b
-abort: outstanding uncommited changes, use 'hg update -C' to lose changes
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+abort: update spans branches, use 'hg merge' or 'hg update -C' to lose changes
--- a/tests/test-up-local-change.out
+++ b/tests/test-up-local-change.out
@@ -93,7 +93,7 @@ user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: 2
-abort: outstanding uncommited changes, use 'hg update -C' to lose changes
+abort: update spans branches, use 'hg merge' or 'hg update -C' to lose changes
failed
abort: outstanding uncommitted changes
failed