changeset 15890:e234eda20984

revlog: make addgroup returns a list of node contained in the added source This list will contains any node see in the source, not only the added one. This is intended to allow phase to be move according what was pushed by client not only what was added.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 13 Jan 2012 01:29:03 +0100
parents 816209eaf963
children 249d3420ec9c
files mercurial/localrepo.py mercurial/revlog.py
diffstat 2 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Thu Jan 12 01:25:57 2012 +0100
+++ b/mercurial/localrepo.py	Fri Jan 13 01:29:03 2012 +0100
@@ -2015,8 +2015,8 @@
             source.callback = pr
 
             source.changelogheader()
-            if (cl.addgroup(source, csmap, trp) is None
-                and not emptyok):
+            srccontent = cl.addgroup(source, csmap, trp)
+            if not (srccontent or emptyok):
                 raise util.Abort(_("received changelog group is empty"))
             clend = len(cl)
             changesets = clend - clstart
@@ -2064,7 +2064,7 @@
                 pr()
                 fl = self.file(f)
                 o = len(fl)
-                if fl.addgroup(source, revmap, trp) is None:
+                if not fl.addgroup(source, revmap, trp):
                     raise util.Abort(_("received file revlog group is empty"))
                 revisions += len(fl) - o
                 files += 1
--- a/mercurial/revlog.py	Thu Jan 12 01:25:57 2012 +0100
+++ b/mercurial/revlog.py	Fri Jan 13 01:29:03 2012 +0100
@@ -1131,6 +1131,7 @@
         """
 
         # track the base of the current delta log
+        content = []
         node = None
 
         r = len(self)
@@ -1161,6 +1162,8 @@
                 deltabase = chunkdata['deltabase']
                 delta = chunkdata['delta']
 
+                content.append(node)
+
                 link = linkmapper(cs)
                 if node in self.nodemap:
                     # this can happen if two branches make the same change
@@ -1190,7 +1193,7 @@
                 dfh.close()
             ifh.close()
 
-        return node
+        return content
 
     def strip(self, minlink, transaction):
         """truncate the revlog on the first revision with a linkrev >= minlink