[PATCH 3 of 3 main-line-of-works (35 more patches to go)] bundle2: handle new line in 'outdebug' function

Augie Fackler raf at durin42.com
Thu May 28 09:25:06 CDT 2015


On Wed, May 27, 2015 at 09:37:28PM -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at fb.com>
> # Date 1432706539 25200
> #      Tue May 26 23:02:19 2015 -0700
> # Node ID 7f1ecb10aae53b99d27961c6eab674735c1c47f6
> # Parent  b300c6a755d23d5b4b4f6df677ebfb3a92bd90d2
> bundle2: handle new line in 'outdebug' function

Queued these, thanks.

Since your backlog is pretty deep, and the queue is pretty empty, why
don't you do something in the 7-10 patches range for the next round?

>
> Now that we have a prefix, it make sense to assume all output will be on a
> single line.
>
> diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
> --- a/mercurial/bundle2.py
> +++ b/mercurial/bundle2.py
> @@ -173,11 +173,11 @@ preferedchunksize = 4096
>
>  _parttypeforbidden = re.compile('[^a-zA-Z0-9_:-]')
>
>  def outdebug(ui, message):
>      """debug regarding output stream (bundling)"""
> -    ui.debug('bundle2-output: %s' % message)
> +    ui.debug('bundle2-output: %s\n' % message)
>
>  def validateparttype(parttype):
>      """raise ValueError if a parttype contains invalid character"""
>      if _parttypeforbidden.search(parttype):
>          raise ValueError(parttype)
> @@ -466,24 +466,24 @@ class bundle20(object):
>          self.addpart(part)
>          return part
>
>      # methods used to generate the bundle2 stream
>      def getchunks(self):
> -        outdebug(self.ui, 'start emission of %s stream\n' % self._magicstring)
> +        outdebug(self.ui, 'start emission of %s stream' % self._magicstring)
>          yield self._magicstring
>          param = self._paramchunk()
> -        outdebug(self.ui, 'bundle parameter: %s\n' % param)
> +        outdebug(self.ui, 'bundle parameter: %s' % param)
>          yield _pack(_fstreamparamsize, len(param))
>          if param:
>              yield param
>
> -        outdebug(self.ui, 'start of parts\n')
> +        outdebug(self.ui, 'start of parts')
>          for part in self._parts:
> -            outdebug(self.ui, 'bundle part: "%s"\n' % part.type)
> +            outdebug(self.ui, 'bundle part: "%s"' % part.type)
>              for chunk in part.getchunks():
>                  yield chunk
> -        outdebug(self.ui, 'end of bundle\n')
> +        outdebug(self.ui, 'end of bundle')
>          yield _pack(_fpartheadersize, 0)
>
>      def _paramchunk(self):
>          """return a encoded version of all stream parameters"""
>          blocks = []
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list