changeset 5325:5971cfc0a56a

Merge with crew
author Matt Mackall <mpm@selenic.com>
date Mon, 24 Sep 2007 12:34:26 -0500
parents 7b4b874ce12c (current diff) 8409a2e3a78d (diff)
children 319c09685f30
files mercurial/revlog.py
diffstat 8 files changed, 94 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/hbisect.py	Fri Sep 21 17:25:25 2007 -0500
+++ b/hgext/hbisect.py	Mon Sep 24 12:34:26 2007 -0500
@@ -37,10 +37,9 @@
         self.ui = ui
         self.goodrevs = []
         self.badrev = None
-        self.good_dirty = 0
-        self.bad_dirty = 0
         self.good_path = "good"
         self.bad_path = "bad"
+        self.is_reset = False
 
         if os.path.exists(os.path.join(self.path, self.good_path)):
             self.goodrevs = self.opener(self.good_path).read().splitlines()
@@ -51,8 +50,10 @@
                 self.badrev = hg.bin(r.pop(0))
 
     def write(self):
+        if self.is_reset:
+            return
         if not os.path.isdir(self.path):
-            return
+            os.mkdir(self.path)
         f = self.opener(self.good_path, "w")
         f.write("\n".join([hg.hex(r) for r in  self.goodrevs]))
         if len(self.goodrevs) > 0:
@@ -81,6 +82,7 @@
         # Not sure about this
         #self.ui.write("Going back to tip\n")
         #self.repo.update(self.repo.changelog.tip())
+        self.is_reset = True
         return 0
 
     def num_ancestors(self, head=None, stop=None):
@@ -301,10 +303,9 @@
     if len(args) > bisectcmdtable[cmd][1]:
         ui.warn(_("bisect: Too many arguments\n"))
         return help_()
-    try:
-        return bisectcmdtable[cmd][0](*args)
-    finally:
-        b.write()
+    ret = bisectcmdtable[cmd][0](*args)
+    b.write()
+    return ret
 
 cmdtable = {
     "bisect": (bisect_run, [], _("hg bisect [help|init|reset|next|good|bad]")),
--- a/mercurial/localrepo.py	Fri Sep 21 17:25:25 2007 -0500
+++ b/mercurial/localrepo.py	Mon Sep 24 12:34:26 2007 -0500
@@ -1045,14 +1045,14 @@
     def undelete(self, list):
         wlock = None
         try:
-            p = self.dirstate.parents()[0]
-            mn = self.changelog.read(p)[0]
-            m = self.manifest.read(mn)
+            manifests = [self.manifest.read(self.changelog.read(p)[0])
+                         for p in self.dirstate.parents() if p != nullid]
             wlock = self.wlock()
             for f in list:
                 if self.dirstate[f] != 'r':
                     self.ui.warn("%s not removed!\n" % f)
                 else:
+                    m = f in manifests[0] and manifests[0] or manifests[1]
                     t = self.file(f).read(m[f])
                     self.wwrite(f, t, m.flags(f))
                     self.dirstate.normal(f)
--- a/mercurial/revlog.py	Fri Sep 21 17:25:25 2007 -0500
+++ b/mercurial/revlog.py	Mon Sep 24 12:34:26 2007 -0500
@@ -1038,7 +1038,7 @@
             ifh.write(entry)
         else:
             offset += curr * self._io.size
-            transaction.add(self.indexfile, offset, prev)
+            transaction.add(self.indexfile, offset, curr)
             ifh.write(entry)
             ifh.write(data[0])
             ifh.write(data[1])
--- a/mercurial/statichttprepo.py	Fri Sep 21 17:25:25 2007 -0500
+++ b/mercurial/statichttprepo.py	Mon Sep 24 12:34:26 2007 -0500
@@ -33,7 +33,7 @@
         self._url = path
         self.ui = ui
 
-        self.path = (path + "/.hg")
+        self.path = path.rstrip('/') + "/.hg"
         self.opener = opener(self.path)
         # find requirements
         try:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rename-after-merge	Mon Sep 24 12:34:26 2007 -0500
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# Test issue 746: renaming files brought by the
+# second parent of a merge was broken.
+
+echo % create source repository
+hg init t
+cd t
+echo a > a
+hg ci -Am a
+cd ..
+
+echo % fork source repository
+hg clone t t2
+cd t2
+echo b > b
+hg ci -Am b
+
+echo % update source repository
+cd ../t
+echo a >> a
+hg ci -m a2
+
+echo % merge repositories
+hg pull ../t2
+hg merge
+
+echo % rename b as c
+hg mv b c
+hg st
+echo % rename back c as b
+hg mv c b
+hg st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rename-after-merge.out	Mon Sep 24 12:34:26 2007 -0500
@@ -0,0 +1,20 @@
+% create source repository
+adding a
+% fork source repository
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+adding b
+% update source repository
+% merge repositories
+pulling from ../t2
+searching for changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files (+1 heads)
+(run 'hg heads' to see heads, 'hg merge' to merge)
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+% rename b as c
+A c
+R b
+% rename back c as b
--- a/tests/test-static-http	Fri Sep 21 17:25:25 2007 -0500
+++ b/tests/test-static-http	Mon Sep 24 12:34:26 2007 -0500
@@ -49,4 +49,18 @@
 echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
 http_proxy= hg pull
 
+echo '% test with "/" URI (issue 747)'
+cd ..
+hg init
+echo a > a
+hg add a
+hg ci -ma
+
+http_proxy= hg clone static-http://localhost:20059/ local2
+
+cd local2
+hg verify
+cat a
+hg paths
+
 kill $!
--- a/tests/test-static-http.out	Fri Sep 21 17:25:25 2007 -0500
+++ b/tests/test-static-http.out	Mon Sep 24 12:34:26 2007 -0500
@@ -28,3 +28,17 @@
 adding file changes
 added 1 changesets with 1 changes to 1 files
 (run 'hg update' to get a working copy)
+% test with "/" URI (issue 747)
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+checking changesets
+checking manifests
+crosschecking files in changesets and manifests
+checking files
+1 files, 1 changesets, 1 total revisions
+a
+default = static-http://localhost:20059/