changeset 4830:b68b250f9537

merge with crew-stable
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 06 Jul 2007 08:48:28 +0200
parents 8706e75e6431 (diff) 4da2149b63a1 (current diff)
children 13cb25bb7607 f3f84d5cd268
files
diffstat 6 files changed, 75 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -40,6 +40,9 @@ class changectx(object):
         except AttributeError:
             return False
 
+    def __ne__(self, other):
+        return not (self == other)
+
     def __nonzero__(self):
         return self._rev != nullrev
 
@@ -185,6 +188,9 @@ class filectx(object):
         except AttributeError:
             return False
 
+    def __ne__(self, other):
+        return not (self == other)
+
     def filectx(self, fileid):
         '''opens an arbitrary revision of the file without
         opening a new filelog'''
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -478,6 +478,9 @@ def recordupdates(repo, action, branchme
                     repo.dirstate.forget([f])
         elif m == "d": # directory rename
             f2, fd, flag = a[2:]
+            if not f2 and f not in repo.dirstate:
+                # untracked file moved
+                continue
             if branchmerge:
                 repo.dirstate.update([fd], 'a')
                 if f:
@@ -523,7 +526,7 @@ def update(repo, node, branchmerge, forc
         raise util.Abort(_("outstanding uncommitted merges"))
     if pa == p1 or pa == p2: # is there a linear path from p1 to p2?
         if branchmerge:
-            if p1.branch() != p2.branch():
+            if p1.branch() != p2.branch() and pa != p2:
                 fastforward = True
             else:
                 raise util.Abort(_("there is nothing to merge, just use "
new file mode 100755
--- /dev/null
+++ b/tests/test-issue612
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+mkdir t
+cd t
+
+hg init
+mkdir src
+echo a > src/a.c
+hg ci -Ama -d "10000000 0"
+
+hg mv src source
+hg ci -Ammove -d "1000000 0"
+
+hg co -C 0
+echo new > src/a.c
+echo compiled > src/a.o
+hg ci -mupdate -d "1000000 0"
+
+hg st
+
+hg merge
+
+hg st
+
new file mode 100644
--- /dev/null
+++ b/tests/test-issue612.out
@@ -0,0 +1,11 @@
+adding src/a.c
+copying src/a.c to source/a.c
+removing src/a.c
+1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+? src/a.o
+merging src/a.c and source/a.c
+1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+M source/a.c
+R src/a.c
+? source/a.o
new file mode 100755
--- /dev/null
+++ b/tests/test-issue619
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+mkdir t
+cd t
+hg init
+echo a > a
+hg ci -Ama -d '1000000000 0'
+echo b > b
+hg branch b
+hg ci -Amb -d '1000000000 0'
+hg co -C 0
+
+echo fast-forward
+hg merge b
+hg ci -Ammerge -d '1000000000 0'
+
+echo bogus fast-forward should fail
+hg merge b
+
+echo done
new file mode 100644
--- /dev/null
+++ b/tests/test-issue619.out
@@ -0,0 +1,10 @@
+adding a
+marked working directory as branch b
+adding b
+0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+fast-forward
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+bogus fast-forward should fail
+abort: there is nothing to merge, just use 'hg update' or look at 'hg heads'
+done