D7200: histedit: restore hex nodeids to be 12 digits long

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
Closed by commit rHGb27cf9f52194: histedit: restore hex nodeids to be 12 digits 
long (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs 
Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7200?vs=17497=17498

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7200/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7200

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1402,7 +1402,7 @@
 maxy, maxx = win.getmaxyx()
 length = maxx - 3
 
-line = b"changeset: %d:%s" % (ctx.rev(), ctx.hex())
+line = b"changeset: %d:%s" % (ctx.rev(), ctx.hex()[:12])
 win.addstr(1, 1, line[:length])
 
 line = b"user:  %s" % ctx.user()
@@ -1432,7 +1432,7 @@
 
 conflicts = rule.conflicts
 if len(conflicts) > 0:
-conflictstr = b','.join(map(lambda r: r.ctx.hex(), conflicts))
+conflictstr = b','.join(map(lambda r: r.ctx.hex()[:12], conflicts))
 conflictstr = b"changed files overlap with %s" % conflictstr
 else:
 conflictstr = b'no overlap'



To: martinvonz, durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7200: histedit: restore hex nodeids to be 12 digits long

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I accidentally switched from 12 digits to 40 digits while making the
  code py3-compatible. Thanks to Yuya for noticing.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7200

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1402,7 +1402,7 @@
 maxy, maxx = win.getmaxyx()
 length = maxx - 3
 
-line = b"changeset: %d:%s" % (ctx.rev(), ctx.hex())
+line = b"changeset: %d:%s" % (ctx.rev(), ctx.hex()[:12])
 win.addstr(1, 1, line[:length])
 
 line = b"user:  %s" % ctx.user()
@@ -1432,7 +1432,7 @@
 
 conflicts = rule.conflicts
 if len(conflicts) > 0:
-conflictstr = b','.join(map(lambda r: r.ctx.hex(), conflicts))
+conflictstr = b','.join(map(lambda r: r.ctx.hex()[:12], conflicts))
 conflictstr = b"changed files overlap with %s" % conflictstr
 else:
 conflictstr = b'no overlap'



To: martinvonz, durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7183: py3: render message about conflicts in chistedit code

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In D7183#105654 , @martinvonz 
wrote:
  
  > In D7183#105653 , @yuja wrote:
  >
  >>>   if len(conflicts) > 0:
  >>>
  >>> - conflictstr = b','.join(map(lambda r: str(r.ctx), conflicts))
  >>>
  >>> +conflictstr = b','.join(map(lambda r: r.ctx.hex(), 
conflicts))
  >>
  >> Seems okay, but it was previously a short hash.
  >
  > Oh, good point, I had forgotten that `hex()` is the full hash. I'll send a 
patch to switch to `short()`. The full hash is actually used a little further 
up in the UI, but I'll leave that since it's (probably) been like that for a 
long time.
  
  Nope, it hasn't been like that for a long time, I just changed that in this 
series :( Sorry, I had tried to verify, but I had forgotten that I had aliased 
hg to be the new version. I'll fix that instance too.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7183/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7183

To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: yuja, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7183: py3: render message about conflicts in chistedit code

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In D7183#105653 , @yuja wrote:
  
  >>   if len(conflicts) > 0:
  >>
  >> - conflictstr = b','.join(map(lambda r: str(r.ctx), conflicts))
  >>
  >> +conflictstr = b','.join(map(lambda r: r.ctx.hex(), conflicts))
  >
  > Seems okay, but it was previously a short hash.
  
  Oh, good point, I had forgotten that `hex()` is the full hash. I'll send a 
patch to switch to `short()`. The full hash is actually used a little further 
up in the UI, but I'll leave that since it's (probably) been like that for a 
long time.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7183/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7183

To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: yuja, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@43375: 14 new changesets (14 on stable)

2019-11-01 Thread Mercurial Commits
14 new changesets (14 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/ddfd0f3956f4
changeset:   43362:ddfd0f3956f4
branch:  stable
user:Emmanuel Leblond 
date:Fri Nov 01 10:57:31 2019 -0700
summary: py3: fix fsmonitor's _handleunavailable exception message encoding

https://www.mercurial-scm.org/repo/hg/rev/2ded39ef5bf7
changeset:   43363:2ded39ef5bf7
branch:  stable
user:Emmanuel Leblond 
date:Fri Nov 01 17:39:17 2019 +0100
summary: py3: fix exception message encoding in infinitepush

https://www.mercurial-scm.org/repo/hg/rev/dd64e229c46b
changeset:   43364:dd64e229c46b
branch:  stable
user:Emmanuel Leblond 
date:Fri Nov 01 17:38:07 2019 +0100
summary: py3: fix crecord.py's editpatchwitheditor exception message 
encoding

https://www.mercurial-scm.org/repo/hg/rev/899e55e2d375
changeset:   43365:899e55e2d375
branch:  stable
user:Emmanuel Leblond 
date:Fri Nov 01 17:35:36 2019 +0100
summary: py3: fix exception message encoding in scmutil.py's 
simplekeyvaluefile.read

https://www.mercurial-scm.org/repo/hg/rev/ee3a55c8fd0f
changeset:   43366:ee3a55c8fd0f
branch:  stable
user:Emmanuel Leblond 
date:Fri Nov 01 17:31:47 2019 +0100
summary: py3: fix exception message check in test-linerange.py's 
testOutOfRange

https://www.mercurial-scm.org/repo/hg/rev/3c2799cbace4
changeset:   43367:3c2799cbace4
branch:  stable
user:Emmanuel Leblond 
date:Fri Nov 01 17:23:02 2019 +0100
summary: py3: fix exception display encoding in contrib/simplemerge.py

https://www.mercurial-scm.org/repo/hg/rev/d8215ff082da
changeset:   43368:d8215ff082da
branch:  stable
user:Martin von Zweigbergk 
date:Thu Oct 31 14:25:51 2019 -0700
summary: py3: make chistedit render

https://www.mercurial-scm.org/repo/hg/rev/8aa54c5a2577
changeset:   43369:8aa54c5a2577
branch:  stable
user:Martin von Zweigbergk 
date:Thu Oct 31 14:46:17 2019 -0700
summary: py3: handle keypresses in chistedit

https://www.mercurial-scm.org/repo/hg/rev/7f56b0cbd245
changeset:   43370:7f56b0cbd245
branch:  stable
user:Martin von Zweigbergk 
date:Thu Oct 31 15:02:03 2019 -0700
summary: py3: render message about conflicts in chistedit code

https://www.mercurial-scm.org/repo/hg/rev/85ab79bc7dab
changeset:   43371:85ab79bc7dab
branch:  stable
user:Martin von Zweigbergk 
date:Thu Oct 31 15:02:48 2019 -0700
summary: py3: avoid another b''.format() in chistedit

https://www.mercurial-scm.org/repo/hg/rev/66a0c5faed1e
changeset:   43372:66a0c5faed1e
branch:  stable
user:Martin von Zweigbergk 
date:Thu Oct 31 15:00:49 2019 -0700
summary: py3: open chistedit file in binary mode using vfs

https://www.mercurial-scm.org/repo/hg/rev/de2c8722a787
changeset:   43373:de2c8722a787
branch:  stable
user:Martin von Zweigbergk 
date:Thu Oct 31 15:03:12 2019 -0700
summary: py3: use native strings as keys into **opts in chistedit

https://www.mercurial-scm.org/repo/hg/rev/65c37b431e76
changeset:   43374:65c37b431e76
branch:  stable
user:Emmanuel Leblond 
date:Fri Nov 01 11:02:47 2019 -0700
summary: py3: fix fsmonitor's _watchmantofsencoding exception message 
encoding

https://www.mercurial-scm.org/repo/hg/rev/c2c3ee8794dd
changeset:   43375:c2c3ee8794dd
branch:  stable
bookmark:@
tag: tip
user:Martin von Zweigbergk 
date:Tue Oct 29 10:54:08 2019 -0700
summary: tests: fix typo "includfe"

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7183: py3: render message about conflicts in chistedit code

2019-11-01 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >   if len(conflicts) > 0:
  >
  > - conflictstr = b','.join(map(lambda r: str(r.ctx), conflicts))
  >
  > +conflictstr = b','.join(map(lambda r: r.ctx.hex(), conflicts))
  
  Seems okay, but it was previously a short hash.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7183/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7183

To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: yuja, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D7183: py3: render message about conflicts in chistedit code

2019-11-01 Thread Yuya Nishihara
>  if len(conflicts) > 0:
> -conflictstr = b','.join(map(lambda r: str(r.ctx), conflicts))
> +conflictstr = b','.join(map(lambda r: r.ctx.hex(), conflicts))

Seems okay, but it was previously a short hash.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7199: lock: fix race in lock-breaking code

2019-11-01 Thread valentin.gatienbaron (Valentin Gatien-Baron)
valentin.gatienbaron created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  With low frequency, I see hg pulls fail with output like:
  abort: no such file or directory: .hg/store/lock
  
  I think what happens is, in lock.py, in:
  
def _testlock(self, locker):
if not self._lockshouldbebroken(locker):
return locker

# if locker dead, break lock.  must do this with another lock
# held, or can race and break valid lock.
  
  1. MARK try: with lock(self.vfs, self.f + b'.break', timeout=0): 
self.vfs.unlink(self.f) except error.LockError: return locker
  
  if a lock is breakable on disk, and two hg processes concurrently get
  to MARK, a possible interleaving is: process1 finishes executing the
  function and then process2 finishes executing the function. If that
  happens, process2 will either get ENOENT in self.vfs.unlink (resulting
  in the spurious failure above), or break a valid lock and potentially
  cause repository corruption.
  
  The fix is simple enough: make sure the lock is breakable _inside_ the
  critical section, because only then can we know that no other process
  can invalidate our knowledge on the lock on disk.
  
  I don't think there are tests for this. I've tested this manually
  with:
  
  diff --git a/mercurial/lock.py b/mercurial/lock.py
  
  - a/mercurial/lock.py
  
  +++ b/mercurial/lock.py
  @@ -351,6 +351,8 @@ class lock(object):
  
if not self._lockshouldbebroken(locker):
return locker
  
  +import random
  +time.sleep(1. + random.random())
  
  1. if locker dead, break lock.  must do this with another lock
  2. held, or can race and break valid lock. try:
  
  @@ -358,6 +360,7 @@ class lock(object):
  
self.vfs.unlink(self.f)
except error.LockError:
return locker
  
  +time.sleep(1)
  
def testlock(self):
"""return id of locker if lock is valid, else None.
  
  and I see this change of behavior before/after this commit:
  
  $ $hg init repo
   $ cd repo
   $ ln -s $HOSTNAME/effc:987654321 .hg/wlock
   $ touch a
   $ $hg commit -Am_ & $hg commit -Am _; wait
  -abort: No such file or directory: '/tmp/repo/.hg/wlock'
   adding a
  +warning: ignoring unknown working parent 679a8959a8ca!
  +nothing changed

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7199

AFFECTED FILES
  mercurial/lock.py

CHANGE DETAILS

diff --git a/mercurial/lock.py b/mercurial/lock.py
--- a/mercurial/lock.py
+++ b/mercurial/lock.py
@@ -355,6 +355,9 @@
 # held, or can race and break valid lock.
 try:
 with lock(self.vfs, self.f + b'.break', timeout=0):
+locker = self._readlock()
+if not self._lockshouldbebroken(locker):
+return locker
 self.vfs.unlink(self.f)
 except error.LockError:
 return locker



To: valentin.gatienbaron, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7198: lock: refactor in preparation for next commit

2019-11-01 Thread valentin.gatienbaron (Valentin Gatien-Baron)
valentin.gatienbaron created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7198

AFFECTED FILES
  mercurial/lock.py

CHANGE DETAILS

diff --git a/mercurial/lock.py b/mercurial/lock.py
--- a/mercurial/lock.py
+++ b/mercurial/lock.py
@@ -330,27 +330,32 @@
 return None
 raise
 
-def _testlock(self, locker):
+def _lockshouldbebroken(self, locker):
 if locker is None:
-return None
+return False
 try:
 host, pid = locker.split(b":", 1)
 except ValueError:
-return locker
+return False
 if host != lock._host:
-return locker
+return False
 try:
 pid = int(pid)
 except ValueError:
-return locker
+return False
 if procutil.testpid(pid):
+return False
+return True
+
+def _testlock(self, locker):
+if not self._lockshouldbebroken(locker):
 return locker
+
 # if locker dead, break lock.  must do this with another lock
 # held, or can race and break valid lock.
 try:
-l = lock(self.vfs, self.f + b'.break', timeout=0)
-self.vfs.unlink(self.f)
-l.release()
+with lock(self.vfs, self.f + b'.break', timeout=0):
+self.vfs.unlink(self.f)
 except error.LockError:
 return locker
 



To: valentin.gatienbaron, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7134: phabricator: use context manager form of progress in uploadchunks

2019-11-01 Thread Kwan (Ian Moody)
Kwan added a comment.
Kwan updated this revision to Diff 17494.


  Rebase onto stable

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7134?vs=17336=17494

BRANCH
  stable

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7134/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7134

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -609,26 +609,25 @@
 """
 ui = fctx.repo().ui
 chunks = callconduit(ui, b'file.querychunks', {b'filePHID': fphid})
-progress = ui.makeprogress(
+with ui.makeprogress(
 _(b'uploading file chunks'), unit=_(b'chunks'), total=len(chunks)
-)
-for chunk in chunks:
-progress.increment()
-if chunk[b'complete']:
-continue
-bstart = int(chunk[b'byteStart'])
-bend = int(chunk[b'byteEnd'])
-callconduit(
-ui,
-b'file.uploadchunk',
-{
-b'filePHID': fphid,
-b'byteStart': bstart,
-b'data': base64.b64encode(fctx.data()[bstart:bend]),
-b'dataEncoding': b'base64',
-},
-)
-progress.complete()
+) as progress:
+for chunk in chunks:
+progress.increment()
+if chunk[b'complete']:
+continue
+bstart = int(chunk[b'byteStart'])
+bend = int(chunk[b'byteEnd'])
+callconduit(
+ui,
+b'file.uploadchunk',
+{
+b'filePHID': fphid,
+b'byteStart': bstart,
+b'data': base64.b64encode(fctx.data()[bstart:bend]),
+b'dataEncoding': b'base64',
+},
+)
 
 
 def uploadfile(fctx):



To: Kwan, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@43361: 8 new changesets (8 on stable)

2019-11-01 Thread Mercurial Commits
8 new changesets (8 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/166808ff91de
changeset:   43354:166808ff91de
branch:  stable
user:Mads Kiilerich 
date:Thu Oct 31 11:53:11 2019 +0100
summary: packaging: drop "support" for unsupported Fedora versions

https://www.mercurial-scm.org/repo/hg/rev/433cdcb37321
changeset:   43355:433cdcb37321
branch:  stable
user:Mads Kiilerich 
date:Fri Nov 01 12:18:17 2019 +0100
summary: packaging: move dockerrpm output directory creation to dockerrpm

https://www.mercurial-scm.org/repo/hg/rev/5989f697890a
changeset:   43356:5989f697890a
branch:  stable
user:Mads Kiilerich 
date:Fri Nov 01 12:34:08 2019 +0100
summary: packaging: fix docker-centos5 - use pythonexe and set to "python" 
as before

https://www.mercurial-scm.org/repo/hg/rev/90dc0d3111d0
changeset:   43357:90dc0d3111d0
branch:  stable
user:Mads Kiilerich 
date:Fri Nov 01 12:47:38 2019 +0100
summary: packaging: use "--python python" for centos7 to avoid explicit 
"python2"

https://www.mercurial-scm.org/repo/hg/rev/518655314fc5
changeset:   43358:518655314fc5
branch:  stable
user:Mads Kiilerich 
date:Fri Nov 01 12:59:22 2019 +0100
summary: packaging: use "python3" for fedora29 ... and as buildrpm default

https://www.mercurial-scm.org/repo/hg/rev/e66a3bfcb19b
changeset:   43359:e66a3bfcb19b
branch:  stable
user:Mads Kiilerich 
date:Fri Nov 01 15:29:14 2019 +0100
summary: packaging: make dockerrpm fedora target more generic

https://www.mercurial-scm.org/repo/hg/rev/0b65f18edc4f
changeset:   43360:0b65f18edc4f
branch:  stable
user:Mads Kiilerich 
date:Fri Nov 01 13:51:44 2019 +0100
summary: packaging: refactor "fedora29" target to a single more generic 
"fedora" target

https://www.mercurial-scm.org/repo/hg/rev/9892599de2dc
changeset:   43361:9892599de2dc
branch:  stable
bookmark:@
tag: tip
user:Mads Kiilerich 
date:Fri Nov 01 14:54:08 2019 +0100
summary: packaging: update built-in Fedora support to Fedora 31

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 8 stable] packaging: drop "support" for unsupported Fedora versions

2019-11-01 Thread Gregory Szorc
On Fri, Nov 1, 2019 at 7:49 AM Mads Kiilerich  wrote:

> # HG changeset patch
> # User Mads Kiilerich 
> # Date 1572519191 -3600
> #  Thu Oct 31 11:53:11 2019 +0100
> # Branch stable
> # Node ID a29e42f5492266b779ab24ac4496211c947c6601
> # Parent  fdc3af52305b805863d0178b9e8c7150b2495479
> packaging: drop "support" for unsupported Fedora versions
>

Queued for stable.


>
> Fedora 31 has just been released, and Fedora 29 will be EOL in a month.
> Don't
> spend any time thinking about dead stuff.
>
> diff --git a/Makefile b/Makefile
> --- a/Makefile
> +++ b/Makefile
> @@ -189,9 +189,6 @@ packaging_targets := \
>docker-centos7 \
>docker-debian-jessie \
>docker-debian-stretch \
> -  docker-fedora20 \
> -  docker-fedora21 \
> -  docker-fedora28 \
>docker-fedora29 \
>docker-ubuntu-trusty \
>docker-ubuntu-trusty-ppa \
> @@ -201,9 +198,6 @@ packaging_targets := \
>docker-ubuntu-artful-ppa \
>docker-ubuntu-bionic \
>docker-ubuntu-bionic-ppa \
> -  fedora20 \
> -  fedora21 \
> -  fedora28 \
>fedora29 \
>linux-wheels \
>linux-wheels-x86_64 \
> diff --git a/contrib/packaging/Makefile b/contrib/packaging/Makefile
> --- a/contrib/packaging/Makefile
> +++ b/contrib/packaging/Makefile
> @@ -12,9 +12,6 @@ UBUNTU_CODENAMES := \
>disco
>
>  FEDORA_RELEASES := \
> -  20 \
> -  21 \
> -  28 \
>29
>
>  CENTOS_RELEASES := \
> diff --git a/contrib/packaging/docker/fedora20
> b/contrib/packaging/docker/fedora20
> deleted file mode 100644
> --- a/contrib/packaging/docker/fedora20
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -FROM fedora:20
> -
> -RUN groupadd -g 1000 build && \
> -useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
> -
> -RUN yum install -y \
> -   gcc \
> -   gettext \
> -   make \
> -   python-devel \
> -   python-docutils \
> -   rpm-build
> -
> -# For creating repo meta data
> -RUN yum install -y createrepo
> diff --git a/contrib/packaging/docker/fedora21
> b/contrib/packaging/docker/fedora21
> deleted file mode 100644
> --- a/contrib/packaging/docker/fedora21
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -FROM fedora:21
> -
> -RUN groupadd -g 1000 build && \
> -useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
> -
> -RUN yum install -y \
> -   gcc \
> -   gettext \
> -   make \
> -   python-devel \
> -   python-docutils \
> -   rpm-build
> -
> -# For creating repo meta data
> -RUN yum install -y createrepo
> diff --git a/contrib/packaging/docker/fedora28
> b/contrib/packaging/docker/fedora28
> deleted file mode 100644
> --- a/contrib/packaging/docker/fedora28
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -FROM fedora:28
> -
> -RUN groupadd -g 1000 build && \
> -useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
> -
> -RUN dnf install -y \
> -   gcc \
> -   gettext \
> -   make \
> -   python-devel \
> -   python-docutils \
> -   rpm-build
> -
> -# For creating repo meta data
> -RUN dnf install -y createrepo
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7180: tests: fix typo "includfe"

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
Closed by commit rHG815218e71ae9: tests: fix typo includfe 
(authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7180?vs=17414=17465

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7180/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7180

AFFECTED FILES
  tests/test-match.py

CHANGE DETAILS

diff --git a/tests/test-match.py b/tests/test-match.py
--- a/tests/test-match.py
+++ b/tests/test-match.py
@@ -316,7 +316,7 @@
 
 # We're using includematcher instead of patterns because it behaves 
slightly
 # better (giving narrower results) than patternmatcher.
-def testVisitdirIncludeIncludfe(self):
+def testVisitdirIncludeInclude(self):
 m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
 m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
 dm = matchmod.differencematcher(m1, m2)
@@ -430,7 +430,7 @@
 
 # We're using includematcher instead of patterns because it behaves 
slightly
 # better (giving narrower results) than patternmatcher.
-def testVisitdirIncludeIncludfe(self):
+def testVisitdirIncludeInclude(self):
 m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
 m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
 im = matchmod.intersectmatchers(m1, m2)
@@ -644,7 +644,7 @@
 
 # We're using includematcher instead of patterns because it behaves 
slightly
 # better (giving narrower results) than patternmatcher.
-def testVisitdirIncludeIncludfe(self):
+def testVisitdirIncludeInclude(self):
 m1 = matchmod.match(b'', b'', include=[b'path:dir/subdir'])
 m2 = matchmod.match(b'', b'', include=[b'rootfilesin:dir'])
 um = matchmod.unionmatcher([m1, m2])



To: martinvonz, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7190: py3: fix fsmonitor's _watchmantofsencoding exception message encoding

2019-11-01 Thread touilleMan (Leblond Emmanuel)
Closed by commit rHG29e75689d4a2: py3: fix fsmonitors 
_watchmantofsencoding exception message encoding (authored by touilleMan).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7190?vs=17444=17464

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7190/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7190

AFFECTED FILES
  hgext/fsmonitor/__init__.py

CHANGE DETAILS

diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -245,12 +245,12 @@
 try:
 decoded = path.decode(_watchmanencoding)
 except UnicodeDecodeError as e:
-raise error.Abort(str(e), hint=b'watchman encoding error')
+raise error.Abort(forcebytestr(e), hint=b'watchman encoding error')
 
 try:
 encoded = decoded.encode(_fsencoding, 'strict')
 except UnicodeEncodeError as e:
-raise error.Abort(str(e))
+raise error.Abort(forcebytestr(e))
 
 return encoded
 



To: touilleMan, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7197: automation: install black

2019-11-01 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This should unblock us from running the code formatting test in
  our automated environment.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D7197

AFFECTED FILES
  contrib/automation/linux-requirements-py3.txt
  contrib/automation/linux-requirements.txt.in

CHANGE DETAILS

diff --git a/contrib/automation/linux-requirements.txt.in 
b/contrib/automation/linux-requirements.txt.in
--- a/contrib/automation/linux-requirements.txt.in
+++ b/contrib/automation/linux-requirements.txt.in
@@ -1,3 +1,5 @@
+# black pulls in typed-ast, which doesn't install on PyPy.
+black ; python_version >= '3.6' and platform_python_implementation != 'PyPy'
 # Bazaar doesn't work with Python 3 nor PyPy.
 bzr ; python_version <= '2.7' and platform_python_implementation == 'CPython'
 docutils
diff --git a/contrib/automation/linux-requirements-py3.txt 
b/contrib/automation/linux-requirements-py3.txt
--- a/contrib/automation/linux-requirements-py3.txt
+++ b/contrib/automation/linux-requirements-py3.txt
@@ -4,10 +4,25 @@
 #
 #pip-compile --generate-hashes 
--output-file=contrib/automation/linux-requirements-py3.txt 
contrib/automation/linux-requirements.txt.in
 #
+appdirs==1.4.3 \
+
--hash=sha256:9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92 \
+
--hash=sha256:d8b24664561d0d34ddfaec54636d502d7cea6e29c3eaf68f3df6180863e2166e \
+# via black
 astroid==2.2.5 \
 
--hash=sha256:6560e1e1749f68c64a4b5dee4e091fce798d2f0d84ebe638cf0e0585a343acf4 \
 
--hash=sha256:b65db1bbaac9f9f4d190199bb8680af6f6f84fd3769a5ea883df8a91fe68b4c4 \
 # via pylint
+attrs==19.3.0 \
+
--hash=sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c \
+
--hash=sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72 \
+# via black
+black==19.10b0 ; python_version >= "3.6" and platform_python_implementation != 
"PyPy" \
+
--hash=sha256:1b30e59be925fafc1ee4565e5e08abef6b03fe455102883820fe5ee2e4734e0b \
+
--hash=sha256:c2edb73a08e9e0e6f65a0e6af18b059b8b1cdd5bef997d7a0b181df93dc81539
+click==7.0 \
+
--hash=sha256:2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13 \
+
--hash=sha256:5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7 \
+# via black
 docutils==0.15.2 \
 
--hash=sha256:6c4f696463b79f1fb8ba0c594b63840ebd41f059e92b31957c46b74a4599b6d0 \
 
--hash=sha256:9e4d7ecfc600058e07ba661411a2b7de2fd0fafa17d1a7f7361cd47b1175c827 \
@@ -78,6 +93,9 @@
 
--hash=sha256:d3be11ac43ab1a3e979dac80843b42226d5d3cccd3986f2e03152720a4297cd7 \
 
--hash=sha256:db603a1c235d110c860d5f39988ebc8218ee028f07a7cbc056ba6424372ca31b \
 # via yarl
+pathspec==0.6.0 \
+
--hash=sha256:e285ccc8b0785beadd4c18e5708b12bb8fcf529a1e61215b3feff1d1e559ea5c \
+# via black
 pyflakes==2.1.1 \
 
--hash=sha256:17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0 \
 
--hash=sha256:d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2
@@ -104,10 +122,27 @@
 
--hash=sha256:bf47c0607522fdbca6c9e817a6e81b08491de50f3766a7a0e6a5be7905961b41 \
 
--hash=sha256:f81025eddd0327c7d4cfe9b62cf33190e1e736cc6e97502b3ec425f574b3e7a8 \
 # via vcrpy
+regex==2019.11.1 \
+
--hash=sha256:15454b37c5a278f46f7aa2d9339bda450c300617ca2fca6558d05d870245edc7 \
+
--hash=sha256:1ad40708c255943a227e778b022c6497c129ad614bb7a2a2f916e12e8a359ee7 \
+
--hash=sha256:5e00f65cc507d13ab4dfa92c1232d004fa202c1d43a32a13940ab8a5afe2fb96 \
+
--hash=sha256:604dc563a02a74d70ae1f55208ddc9bfb6d9f470f6d1a5054c4bd5ae58744ab1 \
+
--hash=sha256:720e34a539a76a1fedcebe4397290604cc2bdf6f81eca44adb9fb2ea071c0c69 \
+
--hash=sha256:7caf47e4a9ac6ef08cabd3442cc4ca3386db141fb3c8b2a7e202d0470028e910 \
+
--hash=sha256:c31eaf28c6fe75ea329add0022efeed249e37861c19681960f99bbc7db981fb2 \
+
--hash=sha256:c7393597191fc2043c744db021643549061e12abe0b3ff5c429d806de7b93b66 \
+
--hash=sha256:d2b302f8cdd82c8f48e9de749d1d17f85ce9a0f082880b9a4859f66b07037dc6 \
+
--hash=sha256:e3d8dd0ec0ea280cf89026b0898971f5750a7bd92cb62c51af5a52abd020054a \
+
--hash=sha256:ec032cbfed59bd5a4b8eab943c310acfaaa81394e14f44454ad5c9eba4f24a74 \
+# via black
 six==1.12.0 \
 
--hash=sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c \
 
--hash=sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73 \
 # via astroid, vcrpy
+toml==0.10.0 \
+
--hash=sha256:229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c \
+
--hash=sha256:235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e \
+# via black
 typed-ast==1.4.0 ; python_version >= "3.0" and platform_python_implementation 
!= "PyPy" \
 
--hash=sha256:18511a0b3e7922276346bcb47e2ef9f38fb90fd31cb9223eed42c85d1312344e \
 

D7186: py3: use native strings as keys into **opts in chistedit

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
Closed by commit rHGca1398169a73: py3: use native strings as keys into **opts 
in chistedit (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7186?vs=17441=17462

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7186/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7186

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1680,7 +1680,7 @@
 with repo.vfs(b'chistedit', b'w+') as fp:
 for r in rules:
 fp.write(r)
-opts[b'commands'] = fp.name
+opts['commands'] = fp.name
 return _texthistedit(ui, repo, *freeargs, **opts)
 except KeyboardInterrupt:
 pass



To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7185: py3: open chistedit file in binary mode using vfs

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
Closed by commit rHG093b85e2db05: py3: open chistedit file in binary mode using 
vfs (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7185?vs=17440=17461

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7185/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7185

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1677,11 +1677,10 @@
 if type(rc) is list:
 ui.status(_(b"performing changes\n"))
 rules = makecommands(rc)
-filename = repo.vfs.join(b'chistedit')
-with open(filename, b'w+') as fp:
+with repo.vfs(b'chistedit', b'w+') as fp:
 for r in rules:
 fp.write(r)
-opts[b'commands'] = filename
+opts[b'commands'] = fp.name
 return _texthistedit(ui, repo, *freeargs, **opts)
 except KeyboardInterrupt:
 pass



To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7184: py3: avoid another b''.format() in chistedit

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
Closed by commit rHG45ec06859354: py3: avoid another b.format() in 
chistedit (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7184?vs=17439=17460

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7184/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7184

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1317,7 +1317,7 @@
 our list of rules"""
 commands = []
 for rules in rules:
-commands.append(b"{0} {1}\n".format(rules.action, rules.ctx))
+commands.append(b'%s %s\n' % (rules.action, rules.ctx))
 return commands
 
 



To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7183: py3: render message about conflicts in chistedit code

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
Closed by commit rHG9acc86e812b8: py3: render message about conflicts in 
chistedit code (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7183?vs=17438=17459

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7183/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7183

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1427,7 +1427,7 @@
 
 conflicts = rule.conflicts
 if len(conflicts) > 0:
-conflictstr = b','.join(map(lambda r: str(r.ctx), conflicts))
+conflictstr = b','.join(map(lambda r: r.ctx.hex(), conflicts))
 conflictstr = b"changed files overlap with %s" % conflictstr
 else:
 conflictstr = b'no overlap'
@@ -1466,7 +1466,7 @@
 
 conflicts = [r.ctx for r in rules if r.conflicts]
 if len(conflicts) > 0:
-line = b"potential conflict in %s" % b','.join(map(str, conflicts))
+line = b"potential conflict in %s" % 
b','.join(map(pycompat.bytestr, conflicts))
 addln(rulesscr, -1, 0, line, curses.color_pair(COLOR_WARN))
 
 for y, rule in enumerate(rules[start:]):



To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7182: py3: handle keypresses in chistedit

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
Closed by commit rHGbddc0ee684ae: py3: handle keypresses in chistedit (authored 
by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7182?vs=17437=17458

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7182/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7182

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1603,7 +1603,7 @@
 renderhelp(helpwin, state)
 curses.doupdate()
 # done rendering
-ch = stdscr.getkey()
+ch = encoding.strtolocal(stdscr.getkey())
 except curses.error:
 pass
 



To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7193: py3: fix exception message encoding in scmutil.py's simplekeyvaluefile.read

2019-11-01 Thread touilleMan (Leblond Emmanuel)
Closed by commit rHG8a1d9e252ea4: py3: fix exception message encoding in 
scmutil.pys simplekeyvaluefile.read (authored by touilleMan).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7193?vs=17447=17454

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7193/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7193

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1854,7 +1854,7 @@
 raise error.CorruptedState(e % self.firstlinekey)
 d.update(updatedict)
 except ValueError as e:
-raise error.CorruptedState(str(e))
+raise error.CorruptedState(stringutil.forcebytestr(e))
 return d
 
 def write(self, data, firstline=None):



To: touilleMan, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7194: py3: fix crecord.py's editpatchwitheditor exception message encoding

2019-11-01 Thread touilleMan (Leblond Emmanuel)
Closed by commit rHGd5437bf42e37: py3: fix crecord.pys 
editpatchwitheditor exception message encoding (authored by touilleMan).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7194?vs=17448=17453

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7194/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7194

AFFECTED FILES
  mercurial/crecord.py

CHANGE DETAILS

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -1816,7 +1816,7 @@
 try:
 patch = self.ui.edit(patch.getvalue(), b"", action=b"diff")
 except error.Abort as exc:
-self.errorstr = str(exc)
+self.errorstr = stringutil.forcebytestr(exc)
 return None
 finally:
 self.stdscr.clear()



To: touilleMan, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7191: py3: fix exception display encoding in contrib/simplemerge.py

2019-11-01 Thread touilleMan (Leblond Emmanuel)
Closed by commit rHGe54da18c421e: py3: fix exception display encoding in 
contrib/simplemerge.py (authored by touilleMan).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7191?vs=17445=17456

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7191/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7191

AFFECTED FILES
  contrib/simplemerge

CHANGE DETAILS

diff --git a/contrib/simplemerge b/contrib/simplemerge
--- a/contrib/simplemerge
+++ b/contrib/simplemerge
@@ -18,6 +18,7 @@
 )
 from mercurial.utils import (
 procutil,
+stringutil
 )
 
 options = [(b'L', b'label', [], _(b'labels to use on conflict markers')),
@@ -75,8 +76,7 @@
  context.arbitraryfilectx(other),
  **pycompat.strkwargs(opts)))
 except ParseError as e:
-if pycompat.ispy3:
-e = str(e).encode('utf8')
+e = stringutil.forcebytestr(e)
 pycompat.stdout.write(b"%s: %s\n" % (sys.argv[0].encode('utf8'), e))
 showhelp()
 sys.exit(1)



To: touilleMan, #hg-reviewers, indygreg
Cc: mjpieters, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7195: py3: fix exception message encoding in infinitepush

2019-11-01 Thread touilleMan (Leblond Emmanuel)
Closed by commit rHGf8e10e3e001f: py3: fix exception message encoding in 
infinitepush (authored by touilleMan).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7195?vs=17449=17452

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7195/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7195

AFFECTED FILES
  hgext/infinitepush/__init__.py

CHANGE DETAILS

diff --git a/hgext/infinitepush/__init__.py b/hgext/infinitepush/__init__.py
--- a/hgext/infinitepush/__init__.py
+++ b/hgext/infinitepush/__init__.py
@@ -959,7 +959,7 @@
 service,
 eventtype=b'failure',
 elapsedms=(time.time() - start) * 1000,
-errormsg=str(e),
+errormsg=stringutil.forcebytestr(e),
 **kwargs
 )
 raise
@@ -1223,7 +1223,7 @@
 scratchbranchparttype,
 eventtype=b'failure',
 elapsedms=(time.time() - parthandlerstart) * 1000,
-errormsg=str(e),
+errormsg=stringutil.forcebytestr(e),
 )
 raise
 finally:



To: touilleMan, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7192: py3: fix exception message check in test-linerange.py's testOutOfRange

2019-11-01 Thread touilleMan (Leblond Emmanuel)
Closed by commit rHG5c12a381fab3: py3: fix exception message check in 
test-linerange.pys testOutOfRange (authored by touilleMan).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7192?vs=17446=17455

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7192/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7192

AFFECTED FILES
  tests/test-linerange.py

CHANGE DETAILS

diff --git a/tests/test-linerange.py b/tests/test-linerange.py
--- a/tests/test-linerange.py
+++ b/tests/test-linerange.py
@@ -2,6 +2,7 @@
 
 import unittest
 from mercurial import error, mdiff
+from mercurial.utils import stringutil
 
 # for readability, line numbers are 0-origin
 text1 = b'''
@@ -228,7 +229,7 @@
 try:
 mdiff.blocksinrange(self.blocks, linerange2)
 except exctype as exc:
-self.assertTrue('line range exceeds file size' in str(exc))
+self.assertTrue(b'line range exceeds file size' in 
stringutil.forcebytestr(exc))
 else:
 self.fail('%s not raised' % exctype.__name__)
 



To: touilleMan, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7196: py3: fix fsmonitor's _handleunavailable exception message encoding

2019-11-01 Thread touilleMan (Leblond Emmanuel)
Closed by commit rHGb567c4365974: py3: fix fsmonitors _handleunavailable 
exception message encoding (authored by touilleMan).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7196?vs=17450=17451

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7196/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7196

AFFECTED FILES
  hgext/fsmonitor/__init__.py

CHANGE DETAILS

diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -207,8 +207,8 @@
 if isinstance(ex, watchmanclient.Unavailable):
 # experimental config: fsmonitor.verbose
 if ex.warn and ui.configbool(b'fsmonitor', b'verbose'):
-if b'illegal_fstypes' not in str(ex):
-ui.warn(str(ex) + b'\n')
+if b'illegal_fstypes' not in forcebytestr(ex):
+ui.warn(forcebytestr(ex) + b'\n')
 if ex.invalidate:
 state.invalidate()
 # experimental config: fsmonitor.verbose



To: touilleMan, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7187: py3: fix fsmonitor error message formatting under Python3

2019-11-01 Thread indygreg (Gregory Szorc)
This revision now requires changes to proceed.
indygreg added inline comments.
indygreg requested changes to this revision.

INLINE COMMENTS

> watchmanclient.py:26
>  
> -def __str__(self):
> +def __bytes__(self):
>  if self.warn:

There's no `__bytes__` on Python 2. So we'll want to preserve an implementation 
for Python 2.

This is typically something like `__str__ = encoding.strmethod(__bytes__)`

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7187/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7187

To: touilleMan, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7195: py3: fix exception message encoding in infinitepush

2019-11-01 Thread touilleMan (Leblond Emmanuel)
touilleMan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7195

AFFECTED FILES
  hgext/infinitepush/__init__.py

CHANGE DETAILS

diff --git a/hgext/infinitepush/__init__.py b/hgext/infinitepush/__init__.py
--- a/hgext/infinitepush/__init__.py
+++ b/hgext/infinitepush/__init__.py
@@ -959,7 +959,7 @@
 service,
 eventtype=b'failure',
 elapsedms=(time.time() - start) * 1000,
-errormsg=str(e),
+errormsg=stringutil.forcebytestr(e),
 **kwargs
 )
 raise
@@ -1223,7 +1223,7 @@
 scratchbranchparttype,
 eventtype=b'failure',
 elapsedms=(time.time() - parthandlerstart) * 1000,
-errormsg=str(e),
+errormsg=stringutil.forcebytestr(e),
 )
 raise
 finally:



To: touilleMan, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7194: py3: fix crecord.py's editpatchwitheditor exception message encoding

2019-11-01 Thread touilleMan (Leblond Emmanuel)
touilleMan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7194

AFFECTED FILES
  mercurial/crecord.py

CHANGE DETAILS

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -1816,7 +1816,7 @@
 try:
 patch = self.ui.edit(patch.getvalue(), b"", action=b"diff")
 except error.Abort as exc:
-self.errorstr = str(exc)
+self.errorstr = stringutil.forcebytestr(exc)
 return None
 finally:
 self.stdscr.clear()



To: touilleMan, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7193: py3: fix exception message encoding in scmutil.py's simplekeyvaluefile.read

2019-11-01 Thread touilleMan (Leblond Emmanuel)
touilleMan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7193

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1854,7 +1854,7 @@
 raise error.CorruptedState(e % self.firstlinekey)
 d.update(updatedict)
 except ValueError as e:
-raise error.CorruptedState(str(e))
+raise error.CorruptedState(stringutil.forcebytestr(e))
 return d
 
 def write(self, data, firstline=None):



To: touilleMan, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7192: py3: fix exception message check in test-linerange.py's testOutOfRange

2019-11-01 Thread touilleMan (Leblond Emmanuel)
touilleMan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7192

AFFECTED FILES
  tests/test-linerange.py

CHANGE DETAILS

diff --git a/tests/test-linerange.py b/tests/test-linerange.py
--- a/tests/test-linerange.py
+++ b/tests/test-linerange.py
@@ -2,6 +2,7 @@
 
 import unittest
 from mercurial import error, mdiff
+from mercurial.utils import stringutil
 
 # for readability, line numbers are 0-origin
 text1 = b'''
@@ -228,7 +229,7 @@
 try:
 mdiff.blocksinrange(self.blocks, linerange2)
 except exctype as exc:
-self.assertTrue('line range exceeds file size' in str(exc))
+self.assertTrue(b'line range exceeds file size' in 
stringutil.forcebytestr(exc))
 else:
 self.fail('%s not raised' % exctype.__name__)
 



To: touilleMan, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7191: py3: fix exception display encoding in contrib/simplemerge.py

2019-11-01 Thread touilleMan (Leblond Emmanuel)
touilleMan created this revision.
Herald added subscribers: mercurial-devel, mjpieters.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7191

AFFECTED FILES
  contrib/simplemerge

CHANGE DETAILS

diff --git a/contrib/simplemerge b/contrib/simplemerge
--- a/contrib/simplemerge
+++ b/contrib/simplemerge
@@ -18,6 +18,7 @@
 )
 from mercurial.utils import (
 procutil,
+stringutil
 )
 
 options = [(b'L', b'label', [], _(b'labels to use on conflict markers')),
@@ -75,8 +76,7 @@
  context.arbitraryfilectx(other),
  **pycompat.strkwargs(opts)))
 except ParseError as e:
-if pycompat.ispy3:
-e = str(e).encode('utf8')
+e = stringutil.forcebytestr(e)
 pycompat.stdout.write(b"%s: %s\n" % (sys.argv[0].encode('utf8'), e))
 showhelp()
 sys.exit(1)



To: touilleMan, #hg-reviewers
Cc: mjpieters, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7190: py3: fix fsmonitor's _watchmantofsencoding exception message encoding

2019-11-01 Thread touilleMan (Leblond Emmanuel)
touilleMan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7190

AFFECTED FILES
  hgext/fsmonitor/__init__.py

CHANGE DETAILS

diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -246,12 +246,12 @@
 try:
 decoded = path.decode(_watchmanencoding)
 except UnicodeDecodeError as e:
-raise error.Abort(str(e), hint=b'watchman encoding error')
+raise error.Abort(forcebytestr(e), hint=b'watchman encoding error')
 
 try:
 encoded = decoded.encode(_fsencoding, 'strict')
 except UnicodeEncodeError as e:
-raise error.Abort(str(e))
+raise error.Abort(forcebytestr(e))
 
 return encoded
 



To: touilleMan, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7189: git: use bytes in command name, not unicode

2019-11-01 Thread maho (Maho)
maho created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7189

AFFECTED FILES
  hgext/git/__init__.py

CHANGE DETAILS

diff --git a/hgext/git/__init__.py b/hgext/git/__init__.py
--- a/hgext/git/__init__.py
+++ b/hgext/git/__init__.py
@@ -225,5 +225,5 @@
 extensions.wrapfunction(localrepo, 'makestore', _makestore)
 extensions.wrapfunction(localrepo, 'makefilestorage', _makefilestorage)
 # Inject --git flag for `hg init`
-entry = extensions.wrapcommand(commands.table, 'init', init)
+entry = extensions.wrapcommand(commands.table, b'init', init)
 entry[1].extend([('', 'git', None, 'setup up a git repository instead of 
hg')])



To: maho, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7188: git: force using bytes in command name

2019-11-01 Thread maho (Maho)
maho created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7188

AFFECTED FILES
  mercurial/extensions.py

CHANGE DETAILS

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -549,6 +549,8 @@
   extensions.wrapcommand(commands.table, 'bookmarks', exbookmarks,
  synopsis, docstring)
 '''
+assert command == stringutil.forcebytestr(command), \
+"`command` should be bytes(python3)/str(python2)"
 assert callable(wrapper)
 aliases, entry = cmdutil.findcmd(command, table)
 for alias, e in pycompat.iteritems(table):



To: maho, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7186: py3: use native strings as keys into **opts in chistedit

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 17441.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7186?vs=17433=17441

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7186/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7186

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1680,7 +1680,7 @@
 with repo.vfs(b'chistedit', b'w+') as fp:
 for r in rules:
 fp.write(r)
-opts[b'commands'] = fp.name
+opts['commands'] = fp.name
 return _texthistedit(ui, repo, *freeargs, **opts)
 except KeyboardInterrupt:
 pass



To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7185: py3: open chistedit file in binary mode using vfs

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 17440.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7185?vs=17432=17440

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7185/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7185

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1677,11 +1677,10 @@
 if type(rc) is list:
 ui.status(_(b"performing changes\n"))
 rules = makecommands(rc)
-filename = repo.vfs.join(b'chistedit')
-with open(filename, b'w+') as fp:
+with repo.vfs(b'chistedit', b'w+') as fp:
 for r in rules:
 fp.write(r)
-opts[b'commands'] = filename
+opts[b'commands'] = fp.name
 return _texthistedit(ui, repo, *freeargs, **opts)
 except KeyboardInterrupt:
 pass



To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7184: py3: avoid another b''.format() in chistedit

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 17439.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7184?vs=17431=17439

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7184/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7184

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1317,7 +1317,7 @@
 our list of rules"""
 commands = []
 for rules in rules:
-commands.append(b"{0} {1}\n".format(rules.action, rules.ctx))
+commands.append(b'%s %s\n' % (rules.action, rules.ctx))
 return commands
 
 



To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7183: py3: render message about conflicts in chistedit code

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 17438.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7183?vs=17430=17438

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7183/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7183

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1427,7 +1427,7 @@
 
 conflicts = rule.conflicts
 if len(conflicts) > 0:
-conflictstr = b','.join(map(lambda r: str(r.ctx), conflicts))
+conflictstr = b','.join(map(lambda r: r.ctx.hex(), conflicts))
 conflictstr = b"changed files overlap with %s" % conflictstr
 else:
 conflictstr = b'no overlap'
@@ -1466,7 +1466,7 @@
 
 conflicts = [r.ctx for r in rules if r.conflicts]
 if len(conflicts) > 0:
-line = b"potential conflict in %s" % b','.join(map(str, conflicts))
+line = b"potential conflict in %s" % 
b','.join(map(pycompat.bytestr, conflicts))
 addln(rulesscr, -1, 0, line, curses.color_pair(COLOR_WARN))
 
 for y, rule in enumerate(rules[start:]):



To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7182: py3: handle keypresses in chistedit

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 17437.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7182?vs=17429=17437

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7182/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7182

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1603,7 +1603,7 @@
 renderhelp(helpwin, state)
 curses.doupdate()
 # done rendering
-ch = stdscr.getkey()
+ch = encoding.strtolocal(stdscr.getkey())
 except curses.error:
 pass
 



To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7181: py3: make chistedit render

2019-11-01 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 17436.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7181?vs=17428=17436

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7181/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7181

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -217,6 +217,7 @@
 copies,
 destutil,
 discovery,
+encoding,
 error,
 exchange,
 extensions,
@@ -1117,7 +1118,7 @@
 self.pos = pos
 self.conflicts = []
 
-def __str__(self):
+def __bytes__(self):
 # Some actions ('fold' and 'roll') combine a patch with a previous one.
 # Add a marker showing which patch they apply to, and also omit the
 # description for 'roll' (since it will get discarded). Example 
display:
@@ -1135,9 +1136,10 @@
 desc = self.ctx.description().splitlines()[0].strip()
 if self.action == b'roll':
 desc = b''
-return b"#{0:<2} {1:<6} {2}:{3}   {4}".format(
-self.origpos, action, r, h, desc
-)
+return b"#%s %s %d:%s   %s" % ((b'%d' % self.origpos).ljust(2),
+   action.ljust(6), r, h, desc)
+
+__str__ = encoding.strmethod(__bytes__)
 
 def checkconflicts(self, other):
 if other.pos > self.pos and other.origpos <= self.origpos:
@@ -1324,7 +1326,7 @@
 whitespace characters, so that the color appears on the whole line"""
 maxy, maxx = win.getmaxyx()
 length = maxx - 1 - x
-line = (b"{0:<%d}" % length).format(str(line).strip())[:length]
+line = bytes(line).ljust(length)[:length]
 if y < 0:
 y = maxy + y
 if x < 0:
@@ -1395,17 +1397,17 @@
 maxy, maxx = win.getmaxyx()
 length = maxx - 3
 
-line = b"changeset: {0}:{1:<12}".format(ctx.rev(), ctx)
+line = b"changeset: %d:%s" % (ctx.rev(), ctx.hex())
 win.addstr(1, 1, line[:length])
 
-line = b"user:  {0}".format(ctx.user())
+line = b"user:  %s" % ctx.user()
 win.addstr(2, 1, line[:length])
 
 bms = repo.nodebookmarks(ctx.node())
-line = b"bookmark:  {0}".format(b' '.join(bms))
+line = b"bookmark:  %s" % b' '.join(bms)
 win.addstr(3, 1, line[:length])
 
-line = b"summary:   {0}".format(ctx.description().splitlines()[0])
+line = b"summary:   %s" % (ctx.description().splitlines()[0])
 win.addstr(4, 1, line[:length])
 
 line = b"files: "
@@ -1426,7 +1428,7 @@
 conflicts = rule.conflicts
 if len(conflicts) > 0:
 conflictstr = b','.join(map(lambda r: str(r.ctx), conflicts))
-conflictstr = b"changed files overlap with {0}".format(conflictstr)
+conflictstr = b"changed files overlap with %s" % conflictstr
 else:
 conflictstr = b'no overlap'
 



To: martinvonz, durin42, #hg-reviewers
Cc: yuja, indygreg, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7187: py3: fix fsmonitor error message formatting under Python3

2019-11-01 Thread touilleMan (Leblond Emmanuel)
touilleMan updated this revision to Diff 17435.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7187?vs=17434=17435

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7187/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7187

AFFECTED FILES
  hgext/fsmonitor/__init__.py
  hgext/fsmonitor/watchmanclient.py

CHANGE DETAILS

diff --git a/hgext/fsmonitor/watchmanclient.py 
b/hgext/fsmonitor/watchmanclient.py
--- a/hgext/fsmonitor/watchmanclient.py
+++ b/hgext/fsmonitor/watchmanclient.py
@@ -10,6 +10,7 @@
 import getpass
 
 from mercurial import util
+from mercurial.utils.stringutil import forcebytestr
 
 from . import pywatchman
 
@@ -22,7 +23,7 @@
 self.warn = False
 self.invalidate = invalidate
 
-def __str__(self):
+def __bytes__(self):
 if self.warn:
 return b'warning: Watchman unavailable: %s' % self.msg
 else:
@@ -100,7 +101,7 @@
 raise WatchmanNoRoot(self._root, ex.msg)
 raise Unavailable(ex.msg)
 except pywatchman.WatchmanError as ex:
-raise Unavailable(str(ex))
+raise Unavailable(forcebytestr(ex))
 
 def command(self, *args):
 try:
diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -132,6 +132,7 @@
 util,
 )
 from mercurial import match as matchmod
+from mercurial.utils.stringutil import forcebytestr
 
 from . import (
 pywatchman,
@@ -192,7 +193,7 @@
 v[b"version"],
 )
 except watchmanclient.Unavailable as e:
-err = str(e)
+err = forcebytestr(e)
 fm.condwrite(
 err,
 b"fsmonitor-watchman-error",



To: touilleMan, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7187: py3: fix fsmonitor error message formatting under Python3

2019-11-01 Thread touilleMan (Leblond Emmanuel)
touilleMan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The watchmanclient.Unavailable exception got an invalid __str__
  method resulting in a crash when watchman is not available.
  This fix also solve tests/test-install.t.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7187

AFFECTED FILES
  hgext/fsmonitor/__init__.py
  hgext/fsmonitor/watchmanclient.py

CHANGE DETAILS

diff --git a/hgext/fsmonitor/watchmanclient.py 
b/hgext/fsmonitor/watchmanclient.py
--- a/hgext/fsmonitor/watchmanclient.py
+++ b/hgext/fsmonitor/watchmanclient.py
@@ -10,10 +10,10 @@
 import getpass
 
 from mercurial import util
+from mercurial.utils.stringutil import forcebytestr
 
 from . import pywatchman
 
-
 class Unavailable(Exception):
 def __init__(self, msg, warn=True, invalidate=False):
 self.msg = msg
@@ -22,7 +22,7 @@
 self.warn = False
 self.invalidate = invalidate
 
-def __str__(self):
+def __bytes__(self):
 if self.warn:
 return b'warning: Watchman unavailable: %s' % self.msg
 else:
@@ -100,7 +100,7 @@
 raise WatchmanNoRoot(self._root, ex.msg)
 raise Unavailable(ex.msg)
 except pywatchman.WatchmanError as ex:
-raise Unavailable(str(ex))
+raise Unavailable(forcebytestr(ex))
 
 def command(self, *args):
 try:
diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -132,6 +132,7 @@
 util,
 )
 from mercurial import match as matchmod
+from mercurial.utils.stringutil import forcebytestr
 
 from . import (
 pywatchman,
@@ -192,7 +193,7 @@
 v[b"version"],
 )
 except watchmanclient.Unavailable as e:
-err = str(e)
+err = forcebytestr(e)
 fm.condwrite(
 err,
 b"fsmonitor-watchman-error",



To: touilleMan, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 8 of 8 stable] packaging: update built-in Fedora support to Fedora 31

2019-11-01 Thread Mads Kiilerich
# HG changeset patch
# User Mads Kiilerich 
# Date 1572616448 -3600
#  Fri Nov 01 14:54:08 2019 +0100
# Branch stable
# Node ID 86a486daf51bb3a38623ee0635d81aec5c7008b0
# Parent  8c57b4472c1acd7bf11f83dccb29c6cc064455a0
packaging: update built-in Fedora support to Fedora 31

This is now quite easy ...

diff --git a/contrib/packaging/Makefile b/contrib/packaging/Makefile
--- a/contrib/packaging/Makefile
+++ b/contrib/packaging/Makefile
@@ -11,7 +11,7 @@ UBUNTU_CODENAMES := \
   cosmic \
   disco
 
-FEDORA_RELEASE := 29
+FEDORA_RELEASE := 31
 
 CENTOS_RELEASES := \
   5 \
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 7 of 8 stable] packaging: refactor "fedora29" target to a single more generic "fedora" target

2019-11-01 Thread Mads Kiilerich
# HG changeset patch
# User Mads Kiilerich 
# Date 1572612704 -3600
#  Fri Nov 01 13:51:44 2019 +0100
# Branch stable
# Node ID 8c57b4472c1acd7bf11f83dccb29c6cc064455a0
# Parent  0b31ec6e6e7e815a75dc465e133043582b3e4cb7
packaging: refactor "fedora29" target to a single more generic "fedora" target

Fedora moves fast in version numbers, and often with Mercurial packaging being
backwards compatible. Also, most people use the system package. There is thus
much work and tech debt and little value in providing explicit built-in support
for several versions. Thus, only aim for providing built-in support for latest
Fedora version, and make it easy to update.

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -189,7 +189,7 @@ packaging_targets := \
   docker-centos7 \
   docker-debian-jessie \
   docker-debian-stretch \
-  docker-fedora29 \
+  docker-fedora \
   docker-ubuntu-trusty \
   docker-ubuntu-trusty-ppa \
   docker-ubuntu-xenial \
@@ -198,7 +198,7 @@ packaging_targets := \
   docker-ubuntu-artful-ppa \
   docker-ubuntu-bionic \
   docker-ubuntu-bionic-ppa \
-  fedora29 \
+  fedora \
   linux-wheels \
   linux-wheels-x86_64 \
   linux-wheels-i686 \
diff --git a/contrib/packaging/Makefile b/contrib/packaging/Makefile
--- a/contrib/packaging/Makefile
+++ b/contrib/packaging/Makefile
@@ -11,8 +11,7 @@ UBUNTU_CODENAMES := \
   cosmic \
   disco
 
-FEDORA_RELEASES := \
-  29
+FEDORA_RELEASE := 29
 
 CENTOS_RELEASES := \
   5 \
@@ -31,8 +30,8 @@ help:
@echo 'docker-debian-{$(strip $(DEBIAN_CODENAMES))}'
@echo '   Build Debian packages specific to a Debian distro using 
Docker.'
@echo ''
-   @echo 'docker-fedora{$(strip $(FEDORA_RELEASES))}'
-   @echo '   Build an RPM for a specific Fedora version using Docker.'
+   @echo 'docker-fedora'
+   @echo '   Build an RPM for a Fedora $(FEDORA_RELEASE) using Docker.'
@echo ''
@echo 'docker-ubuntu-{$(strip $(UBUNTU_CODENAMES))}'
@echo '   Build Debian package specific to an Ubuntu distro using 
Docker.'
@@ -56,8 +55,8 @@ help:
@echo 'centos{$(strip $(CENTOS_RELEASES))}'
@echo '   Build an RPM for a specific CentOS version locally'
@echo ''
-   @echo 'fedora{$(strip $(FEDORA_RELEASES))}'
-   @echo '   Build an RPM for a specific Fedora version locally'
+   @echo 'fedora'
+   @echo '   Build an RPM for Fedora $(FEDORA_RELEASE) locally'
 
 .PHONY: help
 
@@ -94,22 +93,17 @@ endef
 $(foreach codename,$(UBUNTU_CODENAMES),$(eval $(call 
ubuntu_targets,$(codename
 
 # Fedora targets.
-define fedora_targets
-.PHONY: fedora$(1)
-fedora$(1):
-   mkdir -p $$(HGROOT)/packages/fedora$(1)
+.PHONY: fedora
+fedora:
+   mkdir -p $(HGROOT)/packages/fedora$(FEDORA_RELEASE)
./buildrpm
-   cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* 
$$(HGROOT)/packages/fedora$(1)
-   cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* 
$$(HGROOT)/packages/fedora$(1)
+   cp $(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* 
$(HGROOT)/packages/fedora$(FEDORA_RELEASE)
+   cp $(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* 
$(HGROOT)/packages/fedora$(FEDORA_RELEASE)
rm -rf $(HGROOT)/rpmbuild
 
-.PHONY: docker-fedora$(1)
-docker-fedora$(1):
-   ./dockerrpm fedora$(1)
-
-endef
-
-$(foreach release,$(FEDORA_RELEASES),$(eval $(call fedora_targets,$(release
+.PHONY: docker-fedora
+docker-fedora:
+   ./dockerrpm fedora$(FEDORA_RELEASE)
 
 # CentOS targets.
 define centos_targets
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 6 of 8 stable] packaging: make dockerrpm fedora target more generic

2019-11-01 Thread Mads Kiilerich
# HG changeset patch
# User Mads Kiilerich 
# Date 1572618554 -3600
#  Fri Nov 01 15:29:14 2019 +0100
# Branch stable
# Node ID 0b31ec6e6e7e815a75dc465e133043582b3e4cb7
# Parent  dd589d02eba31ae40369d24bf3620863b4c86008
packaging: make dockerrpm fedora target more generic

Fedora moves fast in version numbers, and often with Mercurial packaging being
backwards compatible. Thus, only aim for providing built-in support for latest
Fedora version, and make it easy to update.

With this refactoring, 'dockerrpm fedora31' also works.

'dockerrpm fedora' will use the 'fedora:latest' Docker image.

diff --git a/contrib/packaging/docker/fedora29 
b/contrib/packaging/docker/fedora.template
rename from contrib/packaging/docker/fedora29
rename to contrib/packaging/docker/fedora.template
--- a/contrib/packaging/docker/fedora29
+++ b/contrib/packaging/docker/fedora.template
@@ -1,4 +1,4 @@
-FROM fedora:29
+FROM fedora:%OS_RELEASE%
 
 RUN groupadd -g 1000 build && \
 useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
diff --git a/contrib/packaging/dockerrpm b/contrib/packaging/dockerrpm
--- a/contrib/packaging/dockerrpm
+++ b/contrib/packaging/dockerrpm
@@ -6,6 +6,14 @@ export ROOTDIR=$(cd $BUILDDIR/../..; pwd
 PLATFORM="$1"
 shift # extra params are passed to buildrpm
 
+DOCKERFILE="$PLATFORM"
+OS_RELEASE="${PLATFORM//[a-z]/}"
+case "$PLATFORM" in
+fedora*)
+DOCKERFILE="${PLATFORM//[0-9]/}.template"
+;;
+esac
+
 DOCKER=$($BUILDDIR/hg-docker docker-path)
 
 CONTAINER=hg-docker-$PLATFORM
@@ -18,7 +26,11 @@ else
 DOCKERGID=$(id -g)
 fi
 
-$BUILDDIR/hg-docker build --build-arg UID=$DOCKERUID --build-arg 
GID=$DOCKERGID $BUILDDIR/docker/$PLATFORM $CONTAINER
+$BUILDDIR/hg-docker build \
+--build-arg UID=$DOCKERUID \
+--build-arg GID=$DOCKERGID \
+--build-arg OS_RELEASE=${OS_RELEASE:-latest} \
+$BUILDDIR/docker/$DOCKERFILE $CONTAINER
 
 RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
 mkdir -p $RPMBUILDDIR
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 5 of 8 stable] packaging: use "python3" for fedora29 ... and as buildrpm default

2019-11-01 Thread Mads Kiilerich
# HG changeset patch
# User Mads Kiilerich 
# Date 1572609562 -3600
#  Fri Nov 01 12:59:22 2019 +0100
# Branch stable
# Node ID dd589d02eba31ae40369d24bf3620863b4c86008
# Parent  27f849825e3a2fe7bd08a79659cfddaa95851ff9
packaging: use "python3" for fedora29 ... and as buildrpm default

Change the buidrpm default. The CentOS targets explicitly use "python", and
changing the default will only influence Fedora 29.

A Python 3 package needs python3 dependencies, so pythonexe (and pythonver) is
used for specifying dependencies. Other OS versions will keep using "python" as
before ... or potentially change to explicit "python2". Fedora 29 packages can
thus also still be built for Python 2 - just not in the docker image that is
updated for Python 3.

diff --git a/contrib/packaging/buildrpm b/contrib/packaging/buildrpm
--- a/contrib/packaging/buildrpm
+++ b/contrib/packaging/buildrpm
@@ -6,7 +6,7 @@
 
 BUILD=1
 RPMBUILDDIR="$PWD/rpmbuild"
-PYTHONEXE=python2
+PYTHONEXE=python3
 
 while [ "$1" ]; do
 case "$1" in
diff --git a/contrib/packaging/docker/fedora29 
b/contrib/packaging/docker/fedora29
--- a/contrib/packaging/docker/fedora29
+++ b/contrib/packaging/docker/fedora29
@@ -7,8 +7,8 @@ RUN dnf install -y \
gcc \
gettext \
make \
-   python-devel \
-   python-docutils \
+   python3-devel \
+   python3-docutils \
rpm-build
 
 # For creating repo meta data
diff --git a/contrib/packaging/mercurial.spec b/contrib/packaging/mercurial.spec
--- a/contrib/packaging/mercurial.spec
+++ b/contrib/packaging/mercurial.spec
@@ -2,7 +2,7 @@
 
 %define withpython %{nil}
 
-%global pythonexe python2
+%global pythonexe python3
 
 %if "%{?withpython}"
 
@@ -39,8 +39,8 @@ BuildRequires: make, gcc, gettext
 %if "%{?withpython}"
 BuildRequires: readline-devel, openssl-devel, ncurses-devel, zlib-devel, 
bzip2-devel
 %else
-BuildRequires: python >= %{pythonver}, python-devel, python-docutils >= 0.5
-Requires: python >= %{pythonver}
+BuildRequires: %{pythonexe} >= %{pythonver}, %{pythonexe}-devel, 
%{pythonexe}-docutils >= 0.5
+Requires: %{pythonexe} >= %{pythonver}
 %endif
 # The hgk extension uses the wish tcl interpreter, but we don't enforce it
 #Requires: tk
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 4 of 8 stable] packaging: use "--python python" for centos7 to avoid explicit "python2"

2019-11-01 Thread Mads Kiilerich
# HG changeset patch
# User Mads Kiilerich 
# Date 1572608858 -3600
#  Fri Nov 01 12:47:38 2019 +0100
# Branch stable
# Node ID 27f849825e3a2fe7bd08a79659cfddaa95851ff9
# Parent  0039dc1d76f454f86a9cbfb9064ca6b3cac664d6
packaging: use "--python python" for centos7 to avoid explicit "python2"

This is a partial backout of 92a51a45d44c.

We will need to be able to control whether package dependencies are python2 or
python3. Generally (at least in recent Fedora), the package prefix match the
name of the python executable ...  but CentOS 7 doesn't use the python2 prefix
in package name or alias for python-docutils yet, so just keep centos7 in the
unversioned "python" world.

Change the new (unused) buildrpm "--python3" option (introduced in
a6dcac6454c1) to "--python python3" to get a more generic method for explicit
control over whether we use python, python2 or python3.

diff --git a/contrib/packaging/Makefile b/contrib/packaging/Makefile
--- a/contrib/packaging/Makefile
+++ b/contrib/packaging/Makefile
@@ -116,13 +116,13 @@ define centos_targets
 .PHONY: centos$(1)
 centos$(1):
mkdir -p $$(HGROOT)/packages/centos$(1)
-   ./buildrpm $$(if $$(filter 
$(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython)
+   ./buildrpm $$(if $$(filter 
$(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,--python python)
cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* 
$$(HGROOT)/packages/centos$(1)
cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* 
$$(HGROOT)/packages/centos$(1)
 
 .PHONY: docker-centos$(1)
 docker-centos$(1):
-   ./dockerrpm centos$(1) $$(if $$(filter 
$(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython)
+   ./dockerrpm centos$(1) $$(if $$(filter 
$(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,--python python)
 
 endef
 
diff --git a/contrib/packaging/buildrpm b/contrib/packaging/buildrpm
--- a/contrib/packaging/buildrpm
+++ b/contrib/packaging/buildrpm
@@ -14,9 +14,10 @@ while [ "$1" ]; do
 shift
 BUILD=
 ;;
---python3)
+--python)
 shift
-PYTHONEXE=python3
+PYTHONEXE=$1
+shift
 ;;
 --withpython | --with-python)
 shift
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 3 of 8 stable] packaging: fix docker-centos5 - use pythonexe and set to "python" as before

2019-11-01 Thread Mads Kiilerich
# HG changeset patch
# User Mads Kiilerich 
# Date 1572608048 -3600
#  Fri Nov 01 12:34:08 2019 +0100
# Branch stable
# Node ID 0039dc1d76f454f86a9cbfb9064ca6b3cac664d6
# Parent  b6c904e28f35efa5fcb6162a72e4acb19899f183
packaging: fix docker-centos5 - use pythonexe and set to "python" as before

Fix 92a51a45d44c .

diff --git a/contrib/packaging/buildrpm b/contrib/packaging/buildrpm
--- a/contrib/packaging/buildrpm
+++ b/contrib/packaging/buildrpm
@@ -22,6 +22,7 @@ while [ "$1" ]; do
 shift
 PYTHONVER=2.7.16
 PYTHONMD5=f1a2ace631068444831d01485466ece0
+PYTHONEXE=python
 ;;
 --rpmbuilddir )
 shift
diff --git a/contrib/packaging/mercurial.spec b/contrib/packaging/mercurial.spec
--- a/contrib/packaging/mercurial.spec
+++ b/contrib/packaging/mercurial.spec
@@ -2,6 +2,8 @@
 
 %define withpython %{nil}
 
+%global pythonexe python2
+
 %if "%{?withpython}"
 
 %global pythonver %{withpython}
@@ -15,7 +17,6 @@
 
 %else
 
-%global pythonexe python2
 %global pythonver %(%{pythonexe} -c 'import sys;print(".".join(map(str, 
sys.version_info[:2])))')
 
 %endif
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 8 stable] packaging: move dockerrpm output directory creation to dockerrpm

2019-11-01 Thread Mads Kiilerich
# HG changeset patch
# User Mads Kiilerich 
# Date 1572607097 -3600
#  Fri Nov 01 12:18:17 2019 +0100
# Branch stable
# Node ID b6c904e28f35efa5fcb6162a72e4acb19899f183
# Parent  a29e42f5492266b779ab24ac4496211c947c6601
packaging: move dockerrpm output directory creation to dockerrpm

Avoid having to compute the directory in two places in different environments.

diff --git a/contrib/packaging/Makefile b/contrib/packaging/Makefile
--- a/contrib/packaging/Makefile
+++ b/contrib/packaging/Makefile
@@ -105,7 +105,6 @@ fedora$(1):
 
 .PHONY: docker-fedora$(1)
 docker-fedora$(1):
-   mkdir -p $$(HGROOT)/packages/fedora$(1)
./dockerrpm fedora$(1)
 
 endef
@@ -123,7 +122,6 @@ centos$(1):
 
 .PHONY: docker-centos$(1)
 docker-centos$(1):
-   mkdir -p $$(HGROOT)/packages/centos$(1)
./dockerrpm centos$(1) $$(if $$(filter 
$(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython)
 
 endef
diff --git a/contrib/packaging/dockerrpm b/contrib/packaging/dockerrpm
--- a/contrib/packaging/dockerrpm
+++ b/contrib/packaging/dockerrpm
@@ -21,6 +21,7 @@ fi
 $BUILDDIR/hg-docker build --build-arg UID=$DOCKERUID --build-arg 
GID=$DOCKERGID $BUILDDIR/docker/$PLATFORM $CONTAINER
 
 RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
+mkdir -p $RPMBUILDDIR
 $ROOTDIR/contrib/packaging/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*
 
 DSHARED=/mnt/shared
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 8 stable] packaging: drop "support" for unsupported Fedora versions

2019-11-01 Thread Mads Kiilerich
# HG changeset patch
# User Mads Kiilerich 
# Date 1572519191 -3600
#  Thu Oct 31 11:53:11 2019 +0100
# Branch stable
# Node ID a29e42f5492266b779ab24ac4496211c947c6601
# Parent  fdc3af52305b805863d0178b9e8c7150b2495479
packaging: drop "support" for unsupported Fedora versions

Fedora 31 has just been released, and Fedora 29 will be EOL in a month. Don't
spend any time thinking about dead stuff.

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -189,9 +189,6 @@ packaging_targets := \
   docker-centos7 \
   docker-debian-jessie \
   docker-debian-stretch \
-  docker-fedora20 \
-  docker-fedora21 \
-  docker-fedora28 \
   docker-fedora29 \
   docker-ubuntu-trusty \
   docker-ubuntu-trusty-ppa \
@@ -201,9 +198,6 @@ packaging_targets := \
   docker-ubuntu-artful-ppa \
   docker-ubuntu-bionic \
   docker-ubuntu-bionic-ppa \
-  fedora20 \
-  fedora21 \
-  fedora28 \
   fedora29 \
   linux-wheels \
   linux-wheels-x86_64 \
diff --git a/contrib/packaging/Makefile b/contrib/packaging/Makefile
--- a/contrib/packaging/Makefile
+++ b/contrib/packaging/Makefile
@@ -12,9 +12,6 @@ UBUNTU_CODENAMES := \
   disco
 
 FEDORA_RELEASES := \
-  20 \
-  21 \
-  28 \
   29
 
 CENTOS_RELEASES := \
diff --git a/contrib/packaging/docker/fedora20 
b/contrib/packaging/docker/fedora20
deleted file mode 100644
--- a/contrib/packaging/docker/fedora20
+++ /dev/null
@@ -1,15 +0,0 @@
-FROM fedora:20
-
-RUN groupadd -g 1000 build && \
-useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
-
-RUN yum install -y \
-   gcc \
-   gettext \
-   make \
-   python-devel \
-   python-docutils \
-   rpm-build
-
-# For creating repo meta data
-RUN yum install -y createrepo
diff --git a/contrib/packaging/docker/fedora21 
b/contrib/packaging/docker/fedora21
deleted file mode 100644
--- a/contrib/packaging/docker/fedora21
+++ /dev/null
@@ -1,15 +0,0 @@
-FROM fedora:21
-
-RUN groupadd -g 1000 build && \
-useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
-
-RUN yum install -y \
-   gcc \
-   gettext \
-   make \
-   python-devel \
-   python-docutils \
-   rpm-build
-
-# For creating repo meta data
-RUN yum install -y createrepo
diff --git a/contrib/packaging/docker/fedora28 
b/contrib/packaging/docker/fedora28
deleted file mode 100644
--- a/contrib/packaging/docker/fedora28
+++ /dev/null
@@ -1,15 +0,0 @@
-FROM fedora:28
-
-RUN groupadd -g 1000 build && \
-useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
-
-RUN dnf install -y \
-   gcc \
-   gettext \
-   make \
-   python-devel \
-   python-docutils \
-   rpm-build
-
-# For creating repo meta data
-RUN dnf install -y createrepo
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D7181: py3: make chistedit render

2019-11-01 Thread Martin von Zweigbergk via Mercurial-devel
Feel free to do that in flight. Otherwise I'll do it later today.

It won't matter in practice. We should of course have a separate method
explicitly for creating a line instead. But that's not for stable.

On Fri, Nov 1, 2019, 06:42 yuja (Yuya Nishihara) <
phabrica...@mercurial-scm.org> wrote:

> yuja added a comment.
>
>
>   > +return b"#%s %s %d:%s   %s" % ((b'%d' %
> self.origpos).ljust(2),
>   > +   action.ljust(6), r, h, desc)
>   > +
>   > +__bytes__ = __str__
>
>   `__str__ = encoding.strmethod(__bytes__)` can be used instead. `__str__`
>   of Python3 must return unicode string.
>
> REPOSITORY
>   rHG Mercurial
>
> CHANGES SINCE LAST ACTION
>   https://phab.mercurial-scm.org/D7181/new/
>
> REVISION DETAIL
>   https://phab.mercurial-scm.org/D7181
>
> To: martinvonz, durin42, #hg-reviewers
> Cc: yuja, indygreg, mercurial-devel
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7181: py3: make chistedit render

2019-11-01 Thread yuja (Yuya Nishihara)
yuja added a comment.


  > +return b"#%s %s %d:%s   %s" % ((b'%d' % self.origpos).ljust(2),
  > +   action.ljust(6), r, h, desc)
  > +
  > +__bytes__ = __str__
  
  `__str__ = encoding.strmethod(__bytes__)` can be used instead. `__str__`
  of Python3 must return unicode string.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7181/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7181

To: martinvonz, durin42, #hg-reviewers
Cc: yuja, indygreg, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D7181: py3: make chistedit render

2019-11-01 Thread Yuya Nishihara
> +return b"#%s %s %d:%s   %s" % ((b'%d' % self.origpos).ljust(2),
> +   action.ljust(6), r, h, desc)
> +
> +__bytes__ = __str__

`__str__ = encoding.strmethod(__bytes__)` can be used instead. `__str__`
of Python3 must return unicode string.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel