changeset 3514:355f2a85ea23

Merge with crew
author Matt Mackall <mpm@selenic.com>
date Wed, 25 Oct 2006 16:42:52 -0500
parents 72efff4be2ad (current diff) 9383af6f236d (diff)
children f536d1019c8f 54246ac4b652
files
diffstat 6 files changed, 144 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Oct 25 16:30:45 2006 -0500
+++ b/mercurial/commands.py	Wed Oct 25 16:42:52 2006 -0500
@@ -806,20 +806,19 @@
 def bundle(ui, repo, fname, dest=None, **opts):
     """create a changegroup file
 
-    Generate a compressed changegroup file collecting changesets.
-    not found in the other repository.
-
-    If no destination repository is specified the destination is
-    assumed to have all the node specified by --base.
-
-    This file can then be transferred using conventional means and
-    applied to another repository with the unbundle command. This is
-    useful when native push and pull are not available or when
-    exporting an entire repository is undesirable. The standard file
-    extension is ".hg".
-
-    Unlike import/export, this exactly preserves all changeset
-    contents including permissions, rename data, and revision history.
+    Generate a compressed changegroup file collecting changesets not
+    found in the other repository.
+
+    If no destination repository is specified the destination is assumed
+    to have all the nodes specified by one or more --base parameters.
+
+    The bundle file can then be transferred using conventional means and
+    applied to another repository with the unbundle or pull command.
+    This is useful when direct push and pull are not available or when
+    exporting an entire repository is undesirable.
+
+    Applying bundles preserves all changeset contents including
+    permissions, copy/rename information, and revision history.
     """
     revs = opts.get('rev') or None
     if revs:
@@ -840,6 +839,7 @@
             visit = list(revs)
         else:
             visit = repo.changelog.heads()
+        seen = sets.Set(visit)
         while visit:
             n = visit.pop(0)
             parents = [p for p in repo.changelog.parents(n)
@@ -847,7 +847,10 @@
             if len(parents) == 0:
                 o.insert(0, n)
             else:
-                visit.extend(parents)
+                for p in parents:
+                    if p not in seen:
+                        seen.add(p)
+                        visit.append(p)
     else:
         setremoteconfig(ui, opts)
         dest = ui.expandpath(dest or 'default-push', dest or 'default')
@@ -2998,7 +3001,7 @@
           ('', 'style', '', _('display using template map file')),
           ('r', 'rev', '', _('show only heads which are descendants of rev')),
           ('', 'template', '', _('display with template'))],
-         _('hg heads [-r <rev>]')),
+         _('hg heads [-r REV]')),
     "help": (help_, [], _('hg help [COMMAND]')),
     "identify|id": (identify, [], _('hg identify')),
     "import|patch":
--- a/mercurial/localrepo.py	Wed Oct 25 16:30:45 2006 -0500
+++ b/mercurial/localrepo.py	Wed Oct 25 16:42:52 2006 -0500
@@ -1336,6 +1336,13 @@
             return remote.unbundle(cg, remote_heads, 'push')
         return ret[1]
 
+    def changegroupinfo(self, nodes):
+        self.ui.note(_("%d changesets found\n") % len(nodes))
+        if self.ui.debugflag:
+            self.ui.debug(_("List of changesets:\n"))
+            for node in nodes:
+                self.ui.debug("%s\n" % hex(node))
+
     def changegroupsubset(self, bases, heads, source):
         """This function generates a changegroup consisting of all the nodes
         that are descendents of any of the bases, and ancestors of any of
@@ -1356,6 +1363,7 @@
         # msng is short for missing - compute the list of changesets in this
         # changegroup.
         msng_cl_lst, bases, heads = cl.nodesbetween(bases, heads)
+        self.changegroupinfo(msng_cl_lst)
         # Some bases may turn out to be superfluous, and some heads may be
         # too.  nodesbetween will return the minimal set of bases and heads
         # necessary to re-create the changegroup.
@@ -1619,6 +1627,7 @@
         cl = self.changelog
         nodes = cl.nodesbetween(basenodes, None)[0]
         revset = dict.fromkeys([cl.rev(n) for n in nodes])
+        self.changegroupinfo(nodes)
 
         def identity(x):
             return x
--- a/mercurial/revlog.py	Wed Oct 25 16:30:45 2006 -0500
+++ b/mercurial/revlog.py	Wed Oct 25 16:42:52 2006 -0500
@@ -481,13 +481,13 @@
         d = self.index[r][-3:-1]
         if self.version == REVLOGV0:
             return d
-        return [ self.node(x) for x in d ]
+        return (self.node(d[0]), self.node(d[1]))
     def parentrevs(self, rev):
         if rev == -1:
             return (-1, -1)
         d = self.index[rev][-3:-1]
         if self.version == REVLOGV0:
-            return [ self.rev(x) for x in d ]
+            return (self.rev(d[0]), self.rev(d[1]))
         return d
     def start(self, rev):
         if rev < 0:
--- a/tests/test-acl.out	Wed Oct 25 16:30:45 2006 -0500
+++ b/tests/test-acl.out	Wed Oct 25 16:42:52 2006 -0500
@@ -16,6 +16,11 @@
 pushing to ../b
 searching for changes
 common changesets up to 6675d58eff77
+3 changesets found
+List of changesets:
+ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+911600dab2ae7a9baff75958b84fe606851ce955
 adding changesets
 add changeset ef1ea85a6374
 add changeset f9cafe1212c8
@@ -38,6 +43,11 @@
 pushing to ../b
 searching for changes
 common changesets up to 6675d58eff77
+3 changesets found
+List of changesets:
+ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+911600dab2ae7a9baff75958b84fe606851ce955
 adding changesets
 add changeset ef1ea85a6374
 add changeset f9cafe1212c8
@@ -66,6 +76,11 @@
 pushing to ../b
 searching for changes
 common changesets up to 6675d58eff77
+3 changesets found
+List of changesets:
+ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+911600dab2ae7a9baff75958b84fe606851ce955
 adding changesets
 add changeset ef1ea85a6374
 add changeset f9cafe1212c8
@@ -97,6 +112,11 @@
 pushing to ../b
 searching for changes
 common changesets up to 6675d58eff77
+3 changesets found
+List of changesets:
+ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+911600dab2ae7a9baff75958b84fe606851ce955
 adding changesets
 add changeset ef1ea85a6374
 add changeset f9cafe1212c8
@@ -131,6 +151,11 @@
 pushing to ../b
 searching for changes
 common changesets up to 6675d58eff77
+3 changesets found
+List of changesets:
+ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+911600dab2ae7a9baff75958b84fe606851ce955
 adding changesets
 add changeset ef1ea85a6374
 add changeset f9cafe1212c8
@@ -168,6 +193,11 @@
 pushing to ../b
 searching for changes
 common changesets up to 6675d58eff77
+3 changesets found
+List of changesets:
+ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+911600dab2ae7a9baff75958b84fe606851ce955
 adding changesets
 add changeset ef1ea85a6374
 add changeset f9cafe1212c8
@@ -204,6 +234,11 @@
 pushing to ../b
 searching for changes
 common changesets up to 6675d58eff77
+3 changesets found
+List of changesets:
+ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+911600dab2ae7a9baff75958b84fe606851ce955
 adding changesets
 add changeset ef1ea85a6374
 add changeset f9cafe1212c8
@@ -243,6 +278,11 @@
 pushing to ../b
 searching for changes
 common changesets up to 6675d58eff77
+3 changesets found
+List of changesets:
+ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+911600dab2ae7a9baff75958b84fe606851ce955
 adding changesets
 add changeset ef1ea85a6374
 add changeset f9cafe1212c8
@@ -281,6 +321,11 @@
 pushing to ../b
 searching for changes
 common changesets up to 6675d58eff77
+3 changesets found
+List of changesets:
+ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+911600dab2ae7a9baff75958b84fe606851ce955
 adding changesets
 add changeset ef1ea85a6374
 add changeset f9cafe1212c8
@@ -320,6 +365,11 @@
 pushing to ../b
 searching for changes
 common changesets up to 6675d58eff77
+3 changesets found
+List of changesets:
+ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+911600dab2ae7a9baff75958b84fe606851ce955
 adding changesets
 add changeset ef1ea85a6374
 add changeset f9cafe1212c8
@@ -358,6 +408,11 @@
 pushing to ../b
 searching for changes
 common changesets up to 6675d58eff77
+3 changesets found
+List of changesets:
+ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+911600dab2ae7a9baff75958b84fe606851ce955
 adding changesets
 add changeset ef1ea85a6374
 add changeset f9cafe1212c8
@@ -402,6 +457,11 @@
 pushing to ../b
 searching for changes
 common changesets up to 6675d58eff77
+3 changesets found
+List of changesets:
+ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+911600dab2ae7a9baff75958b84fe606851ce955
 adding changesets
 add changeset ef1ea85a6374
 add changeset f9cafe1212c8
@@ -446,6 +506,11 @@
 pushing to ../b
 searching for changes
 common changesets up to 6675d58eff77
+3 changesets found
+List of changesets:
+ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+911600dab2ae7a9baff75958b84fe606851ce955
 adding changesets
 add changeset ef1ea85a6374
 add changeset f9cafe1212c8
@@ -496,6 +561,11 @@
 pushing to ../b
 searching for changes
 common changesets up to 6675d58eff77
+3 changesets found
+List of changesets:
+ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+911600dab2ae7a9baff75958b84fe606851ce955
 adding changesets
 add changeset ef1ea85a6374
 add changeset f9cafe1212c8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-empty-file	Wed Oct 25 16:42:52 2006 -0500
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+hg init a
+cd a
+touch empty1
+hg add empty1
+hg commit -m 'add empty1' -d '1000000 0'
+
+touch empty2
+hg add empty2
+hg commit -m 'add empty2' -d '1000000 0'
+
+hg up -C 0
+touch empty3
+hg add empty3
+hg commit -m 'add empty3' -d '1000000 0'
+
+hg heads
+
+hg merge 1
+# before changeset 05257fd28591, we didn't notice the 
+# empty file that came from rev 1.
+hg status
+hg commit -m merge -d '1000000 0'
+hg manifest tip
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-empty-file.out	Wed Oct 25 16:42:52 2006 -0500
@@ -0,0 +1,19 @@
+0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+changeset:   2:62ec0e86d1e5
+tag:         tip
+parent:      0:567dde5e6e98
+user:        test
+date:        Mon Jan 12 13:46:40 1970 +0000
+summary:     add empty3
+
+changeset:   1:41ab7b321727
+user:        test
+date:        Mon Jan 12 13:46:40 1970 +0000
+summary:     add empty2
+
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+M empty2
+b80de5d138758541c5f05265ad144ab9fa86d1db 644 empty1
+b80de5d138758541c5f05265ad144ab9fa86d1db 644 empty2
+b80de5d138758541c5f05265ad144ab9fa86d1db 644 empty3