Patchwork [01,of,10] bundlerepo: fix outdated comment

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 16, 2013, 7:57 p.m.
Message ID <528c8be7d397d7c26388.1358366245@mk-desktop>
Download mbox | patch
Permalink /patch/661/
State Accepted
Commit de7dac2a58e8372e3d3c16e678ed99a3d0eae0a7
Headers show

Comments

Mads Kiilerich - Jan. 16, 2013, 7:57 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1358365292 -3600
# Node ID 528c8be7d397d7c2638858006bdd9d55e3e2c314
# Parent  e3f5cef11d6a8eafdbaefa9b6c3d0e91fc3273fc
bundlerepo: fix outdated comment

Comment was made invalid by 01ee43dda681.
tonfa - Jan. 16, 2013, 8:11 p.m.
LGTM


On Wed, Jan 16, 2013 at 8:57 PM, Mads Kiilerich <mads@kiilerich.com> wrote:

> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1358365292 -3600
> # Node ID 528c8be7d397d7c2638858006bdd9d55e3e2c314
> # Parent  e3f5cef11d6a8eafdbaefa9b6c3d0e91fc3273fc
> bundlerepo: fix outdated comment
>
> Comment was made invalid by 01ee43dda681.
>
> diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
> --- a/mercurial/bundlerepo.py
> +++ b/mercurial/bundlerepo.py
> @@ -20,14 +20,14 @@
>  class bundlerevlog(revlog.revlog):
>      def __init__(self, opener, indexfile, bundle, linkmapper):
>          # How it works:
> -        # to retrieve a revision, we need to know the offset of
> +        # basemap which keeps track of which revision the delta of each
> bundle
> +        # revision apply to.
>

This part looks a bit weird though, maybe make it a proper sentence?


> +        #
> +        # To retrieve a revision, we need to know the offset of
>          # the revision in the bundle (an unbundle object).
> -        #
> -        # We store this offset in the index (start), to differentiate a
> -        # rev in the bundle and from a rev in the revlog, we check
> -        # len(index[r]). If the tuple is bigger than 7, it is a bundle
> -        # (it is bigger since we store the node to which the delta is)
> -        #
> +        # We store this offset in the index (start). To differentiate a
> +        # rev in the bundle from a rev in the revlog, we check revision
> +        # against basemap.
>          opener = scmutil.readonlyvfs(opener)
>          revlog.revlog.__init__(self, opener, indexfile)
>          self.bundle = bundle
> @@ -385,4 +385,3 @@
>          other.close()
>
>      return (localrepo, csets, cleanup)
> -
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -20,14 +20,14 @@ 
 class bundlerevlog(revlog.revlog):
     def __init__(self, opener, indexfile, bundle, linkmapper):
         # How it works:
-        # to retrieve a revision, we need to know the offset of
+        # basemap which keeps track of which revision the delta of each bundle
+        # revision apply to.
+        #
+        # To retrieve a revision, we need to know the offset of
         # the revision in the bundle (an unbundle object).
-        #
-        # We store this offset in the index (start), to differentiate a
-        # rev in the bundle and from a rev in the revlog, we check
-        # len(index[r]). If the tuple is bigger than 7, it is a bundle
-        # (it is bigger since we store the node to which the delta is)
-        #
+        # We store this offset in the index (start). To differentiate a
+        # rev in the bundle from a rev in the revlog, we check revision
+        # against basemap.
         opener = scmutil.readonlyvfs(opener)
         revlog.revlog.__init__(self, opener, indexfile)
         self.bundle = bundle
@@ -385,4 +385,3 @@ 
         other.close()
 
     return (localrepo, csets, cleanup)
-