D2896: commands: use keyword arguments in update function

2018-03-20 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe2a0aaec7d86: commands: use keyword arguments in update 
function (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2896?vs=7169&id=7170

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5442,8 +5442,7 @@
 ('r', 'rev', '', _('revision'), _('REV'))
  ] + mergetoolopts,
 _('[-C|-c|-m] [-d DATE] [[-r] REV]'))
-def update(ui, repo, node=None, rev=None, clean=False, date=None, check=False,
-   merge=None, tool=None):
+def update(ui, repo, node=None, **opts):
 """update working directory (or switch revisions)
 
 Update the repository's working directory to the specified
@@ -5498,6 +5497,11 @@
 
 Returns 0 on success, 1 if there are unresolved files.
 """
+rev = opts.get(r'rev')
+date = opts.get(r'date')
+clean = opts.get(r'clean')
+check = opts.get(r'check')
+merge = opts.get(r'merge')
 if rev and node:
 raise error.Abort(_("please specify just one revision"))
 
@@ -5542,7 +5546,7 @@
 obsfatemsg = obsutil._getfilteredreason(repo, ctxstr, ctx)
 ui.warn("(%s)\n" % obsfatemsg)
 
-repo.ui.setconfig('ui', 'forcemerge', tool, 'update')
+repo.ui.setconfig('ui', 'forcemerge', opts.get(r'tool'), 'update')
 
 return hg.updatetotally(ui, repo, rev, brev, clean=clean,
 updatecheck=updatecheck)



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


D2057: rust implementation of hg status

2018-03-20 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >> I think the only place where you would need to do os-specific code is when
  >>  doing serialization and serialization
  > 
  > Yes, that will be feasible in strictly typed language like Rust.
  
  To be clear, I meant serialization/deserialization between filesystem path and
  internal dirstate/manifest path, not between dirstate storage and in-memory
  dirstate object.

REPOSITORY
  rHG Mercurial

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

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


D2896: commands: use keyword arguments in update function

2018-03-20 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 7169.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2896?vs=7120&id=7169

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5442,8 +5442,7 @@
 ('r', 'rev', '', _('revision'), _('REV'))
  ] + mergetoolopts,
 _('[-C|-c|-m] [-d DATE] [[-r] REV]'))
-def update(ui, repo, node=None, rev=None, clean=False, date=None, check=False,
-   merge=None, tool=None):
+def update(ui, repo, node=None, **opts):
 """update working directory (or switch revisions)
 
 Update the repository's working directory to the specified
@@ -5498,6 +5497,11 @@
 
 Returns 0 on success, 1 if there are unresolved files.
 """
+rev = opts.get(r'rev')
+date = opts.get(r'date')
+clean = opts.get(r'clean')
+check = opts.get(r'check')
+merge = opts.get(r'merge')
 if rev and node:
 raise error.Abort(_("please specify just one revision"))
 
@@ -5542,7 +5546,7 @@
 obsfatemsg = obsutil._getfilteredreason(repo, ctxstr, ctx)
 ui.warn("(%s)\n" % obsfatemsg)
 
-repo.ui.setconfig('ui', 'forcemerge', tool, 'update')
+repo.ui.setconfig('ui', 'forcemerge', opts.get(r'tool'), 'update')
 
 return hg.updatetotally(ui, repo, rev, brev, clean=clean,
 updatecheck=updatecheck)



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


D2057: rust implementation of hg status

2018-03-20 Thread yuja (Yuya Nishihara)
yuja added a comment.


  > I think the only place where you would need to do os-specific code is when
  >  doing serialization and serialization
  
  Yes, that will be feasible in strictly typed language like Rust.
  
  > which I think should be handled by 
https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStringExt.html
  >  and https://doc.rust-lang.org/std/os/windows/ffi/trait.OsStringExt.html.
  
  Not true for Windows because Rust uses Unicode (UTF-16-ish) API, whereas
  Python 2 does ANSI. We need to convert a "wide" string to a locale-dependent 
string.
  
  Maybe the local-encoding crate will do that for us?

REPOSITORY
  rHG Mercurial

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

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


D2905: rebase: pass "inmemory" directly to _definedestmap()

2018-03-20 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0782ac132a41: rebase: pass "inmemory" directly to 
_definedestmap() (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2905?vs=7164&id=7168

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -840,8 +840,8 @@
 if retcode is not None:
 return retcode
 else:
-destmap = _definedestmap(ui, repo, rbsrt, destf, srcf, basef, revf,
- destspace=destspace)
+destmap = _definedestmap(ui, repo, inmemory, destf, srcf, basef,
+ revf, destspace=destspace)
 retcode = rbsrt._preparenewrebase(destmap)
 if retcode is not None:
 return retcode
@@ -866,7 +866,7 @@
 rbsrt._performrebase(tr)
 rbsrt._finishrebase()
 
-def _definedestmap(ui, repo, rbsrt, destf=None, srcf=None, basef=None,
+def _definedestmap(ui, repo, inmemory, destf=None, srcf=None, basef=None,
revf=None, destspace=None):
 """use revisions argument to define destmap {srcrev: destrev}"""
 if revf is None:
@@ -881,7 +881,7 @@
 if revf and srcf:
 raise error.Abort(_('cannot specify both a revision and a source'))
 
-if not rbsrt.inmemory:
+if not inmemory:
 cmdutil.checkunfinished(repo)
 cmdutil.bailifchanged(repo)
 
@@ -959,7 +959,7 @@
 
 rebasingwcp = repo['.'].rev() in rebaseset
 ui.log("rebase", "", rebase_rebasing_wcp=rebasingwcp)
-if rbsrt.inmemory and rebasingwcp:
+if inmemory and rebasingwcp:
 # Check these since we did not before.
 cmdutil.checkunfinished(repo)
 cmdutil.bailifchanged(repo)



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


Re: [PATCH] added tls 1.3 support - done during IETF101 Hackathon

2018-03-20 Thread Yuya Nishihara
On Sun, 18 Mar 2018 12:04:18 +0400, Codarren Velvindron wrote:
> # HG changeset patch
> # User Codarren Velvindron 
> # Date 1521360069 -14400
> #  Sun Mar 18 12:01:09 2018 +0400
> # Node ID a47713f3cc05fafceed9bc8086734ffed65d51a5
> # Parent  2d5d3033ff4ea2aab42bcc14af4db2cd3bccc455
> [PATCH] added tls 1.3 support
> -done during the IETF101 Hackathon

"sslutil: add tls 1.3 support

Done during the IETF101 Hackathon.
"

per our coding style.

https://www.mercurial-scm.org/wiki/ContributingChanges#Patch_descriptions

Looks good to me except for a few nits, but I'm not an expert. Can you add
some tests to test-https.t?

> --- a/i18n/ja.po  Thu Mar 15 11:19:16 2018 -0700
> +++ b/i18n/ja.po  Sun Mar 18 12:01:09 2018 +0400

Translations can't be reviewed. You don't need to update them.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2889: filemerge: make the 'local' path match the format that 'base' and 'other' use

2018-03-20 Thread yuja (Yuya Nishihara)
yuja added a comment.


  Can't apply.
  
% hg up -C a4a95bd7
2 files updated, 0 files merged, 0 files removed, 0 files unresolved

% hg pimp D2889
devel-warn: accessing unregistered config item: 'phabricator.batchsize' at: 
/home/yuya/work/hghacks/mercurial/mercurial/ui.py:624 (configwith)
devel-warn: accessing unregistered config item: 'phabricator.url' at: 
/home/yuya/work/hghacks/mercurial/contrib/phabricator.py:124 (readurltoken)
devel-warn: accessing unregistered config item: 'phabricator.token' at: 
/home/yuya/work/hghacks/mercurial/contrib/phabricator.py:111 (readlegacytoken)
phabricator.token is deprecated - please migrate to the phabricator.auth 
section.
devel-warn: accessing unregistered config item: 'phabricator.curlcmd' at: 
/home/yuya/work/hghacks/mercurial/contrib/phabricator.py:162 (callconduit)
applying patch from stdin
devel-warn: accessing unregistered config item: 'phabricator.url' at: 
/home/yuya/work/hghacks/mercurial/contrib/phabricator.py:124 (readurltoken)
devel-warn: accessing unregistered config item: 'phabricator.token' at: 
/home/yuya/work/hghacks/mercurial/contrib/phabricator.py:111 (readlegacytoken)
devel-warn: accessing unregistered config item: 'phabricator.curlcmd' at: 
/home/yuya/work/hghacks/mercurial/contrib/phabricator.py:162 (callconduit)
devel-warn: accessing unregistered config item: 'phabricator.url' at: 
/home/yuya/work/hghacks/mercurial/contrib/phabricator.py:124 (readurltoken)
devel-warn: accessing unregistered config item: 'phabricator.token' at: 
/home/yuya/work/hghacks/mercurial/contrib/phabricator.py:111 (readlegacytoken)
devel-warn: accessing unregistered config item: 'phabricator.curlcmd' at: 
/home/yuya/work/hghacks/mercurial/contrib/phabricator.py:162 (callconduit)
patching file tests/test-merge-tools.t
Hunk #2 FAILED at 1599
1 out of 2 hunks FAILED -- saving rejects to file 
tests/test-merge-tools.t.rej
patching file mercurial/filemerge.py
Hunk #1 FAILED at 511
Hunk #3 FAILED at 663
2 out of 3 hunks FAILED -- saving rejects to file mercurial/filemerge.py.rej
abort: patch failed to apply

REPOSITORY
  rHG Mercurial

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

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


D2896: commands: use keyword arguments in update function

2018-03-20 Thread yuja (Yuya Nishihara)
yuja requested changes to this revision.
yuja added a comment.
This revision now requires changes to proceed.


  Python 3?

REPOSITORY
  rHG Mercurial

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

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


Re: [PATCH 1 of 2] test-http-protocol: drop an extraneous glob for Windows

2018-03-20 Thread Yuya Nishihara
On Tue, 20 Mar 2018 21:24:27 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1521592417 14400
> #  Tue Mar 20 20:33:37 2018 -0400
> # Node ID f2b5c2b7d2e53fe7a8d3891efc5ba50d4785b61c
> # Parent  c83e2736c6deb7e1b6b5eccb6b943b2af7628858
> test-http-protocol: drop an extraneous glob for Windows

Queued, thanks.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] hgweb: explain instabilities of unstable changesets (the rest of the themes)

2018-03-20 Thread Yuya Nishihara
On Tue, 20 Mar 2018 18:16:25 +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov 
> # Date 1521526768 -28800
> #  Tue Mar 20 14:19:28 2018 +0800
> # Node ID 81060ada33729a2b4f250f72416a3efab2c5f398
> # Parent  e349ad5cbb7195607a300439a12a5316795125f8
> hgweb: explain instabilities of unstable changesets (the rest of the themes)

Queued, thanks.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2883: revlogstore: create and implement an interface for repo files storage

2018-03-20 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  It's probably too early to worry about for the experimenting that you're 
doing, but at some point, maybe this should also allow yielding the full text 
in chunks?  As it stands now, there are a couple places where LFS has to read 
in the full file, and one of those places is the filelog/revlog.  IIRC, 
largefiles manages to avoid that completely.
  
  This dated paged is the only thing that I could find talking about the issues 
with that approach:
  
  https://www.mercurial-scm.org/wiki/HandlingLargeFiles
  
  I'm not sure what this should look like either, but it seemed worthwhile to 
point out that page, with the accompanying discussion of revlog limitations.

REPOSITORY
  rHG Mercurial

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

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


[PATCH 1 of 2] test-http-protocol: drop an extraneous glob for Windows

2018-03-20 Thread Matt Harbison
# HG changeset patch
# User Matt Harbison 
# Date 1521592417 14400
#  Tue Mar 20 20:33:37 2018 -0400
# Node ID f2b5c2b7d2e53fe7a8d3891efc5ba50d4785b61c
# Parent  c83e2736c6deb7e1b6b5eccb6b943b2af7628858
test-http-protocol: drop an extraneous glob for Windows

diff --git a/tests/test-http-protocol.t b/tests/test-http-protocol.t
--- a/tests/test-http-protocol.t
+++ b/tests/test-http-protocol.t
@@ -239,7 +239,7 @@ Same thing, but with "httprequest" comma
   s> GET /?cmd=listkeys HTTP/1.1\r\n
   s> Accept-Encoding: identity\r\n
   s> accept: application/mercurial-0.1\r\n
-  s> user-agent: mercurial/proto-1.0 (Mercurial 42)\r\n (glob)
+  s> user-agent: mercurial/proto-1.0 (Mercurial 42)\r\n
   s> x-hgarg-1: namespace=namespaces\r\n
   s> host: $LOCALIP:$HGPORT\r\n (glob)
   s> \r\n
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 2] test-merge-tools: stabilize for Windows

2018-03-20 Thread Matt Harbison
# HG changeset patch
# User Matt Harbison 
# Date 1521594629 14400
#  Tue Mar 20 21:10:29 2018 -0400
# Node ID 6bc2f1b3bc9d3fb73ffe605f9d811bd75727434e
# Parent  f2b5c2b7d2e53fe7a8d3891efc5ba50d4785b61c
test-merge-tools: stabilize for Windows

See fe5c4b795999.

diff --git a/tests/test-merge-tools.t b/tests/test-merge-tools.t
--- a/tests/test-merge-tools.t
+++ b/tests/test-merge-tools.t
@@ -1385,7 +1385,7 @@ Same test with experimental.mergetempdir
   arg: "ll:working copy"
   arg: "lo:"
   arg: "merge rev"
-  arg: "lb:base: $TESTTMP/hgmerge.*/f~base" (glob)
+  arg: "lb:base: */hgmerge.*/f~base" (glob)
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ rm -f 'printargs_merge_tool'
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2907: wireproto: add streams to frame-based protocol

2018-03-20 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Previously, the frame-based protocol was just a series of frames,
  with each frame associated with a request ID.
  
  In order to scale the protocol, we'll want to enable the use of
  compression. While it is possible to enable compression at the
  socket/pipe level, this has its disadvantages. The big one is it
  undermines the point of frames being standalone, atomic units that
  can be read and written: if you add compression above the framing
  protocol, you are back to having a stream-based protocol as opposed
  to something frame-based.
  
  So in order to preserve frames, compression needs to occur at
  the frame payload level.
  
  Compressing each frame's payload individually will limit compression
  ratios because the window size of the compressor will be limited
  by the max frame size, which is 32-64kb as currently defined. It
  will also add CPU overhead, as it is more efficient for compressors
  to operate on fewer, larger blocks of data than more, smaller blocks.
  
  So compressing each frame independently is out.
  
  This means we need to compress each frame's payload as if it is part
  of a larger stream.
  
  The simplest approach is to have 1 stream per connection. This
  could certainly work. However, it has disadvantages (documented below).
  
  We could also have 1 stream per RPC/command invocation. (This is the
  model HTTP/2 goes with.) This also has disadvantages.
  
  The main disadvantage to one global stream is that it has the very
  real potential to create CPU bottlenecks doing compression. Networks
  are only getting faster and the performance of single CPU cores has
  been relatively flat. Newer compression formats like zstandard offer
  better CPU cycle efficiency than predecessors like zlib. But it still
  all too common to saturate your CPU with compression overhead long
  before you saturate the network pipe.
  
  The main disadvantage with streams per request is that you can't
  reap the benefits of the compression context for multiple requests.
  For example, if you send 1000 RPC requests (or HTTP/2 requests for
  that matter), the response to each would have its own compression
  context. The overall size of the raw responses would be larger because
  compression contexts wouldn't be able to reference data from another
  request or response.
  
  The approach for streams as implemented in this commit is to support
  N streams per connection and for streams to potentially span requests
  and responses. As explained by the added internals docs, this
  facilitates servers and clients delegating independent streams and
  compression to independent threads / CPU cores. This helps alleviate
  the CPU bottleneck of compression. This design also allows compression
  contexts to be reused across requests/responses. This can result in
  improved compression ratios and less overhead for compressors and
  decompressors having to build new contexts.
  
  Another feature that was defined was the ability for individual frames
  within a stream to declare whether that individual frame's payload
  uses the content encoding (read: compression) defined by the stream.
  The idea here is that some servers may serve data from a combination
  of caches and dynamic resolution. Data coming from caches may be
  pre-compressed. We want to facilitate servers being able to essentially
  stream bytes from caches to the wire with minimal overhead. Being
  able to mix and match with frames are compressed within a stream
  enables these types of advanced server functionality.
  
  This commit defines the new streams mechanism. Basic code for
  supporting streams in frames has been added. But that code is
  seriously lacking and doesn't fully conform to the defined protocol.
  For example, we don't close any streams. And support for content
  encoding within streams is not yet implemented. The change was
  rather invasive and I didn't think it would be reasonable to implement
  the entire feature in a single commit.
  
  For the record, I would have loved to reuse an existing multiplexing
  protocol to build the new wire protocol on top of. However, I couldn't
  find a protocol that offers the performance and scaling characteristics
  that I desired. Namely, it should support multiple compression
  contexts to facilitate scaling out to multiple CPU cores and
  compression contexts should be able to live longer than single RPC
  requests. HTTP/2 *almost* fits the bill. But the semantics of HTTP
  message exchange state that streams can only live for a single
  request-response. We /could/ tunnel on top of HTTP/2 streams and
  frames with HEADER and DATA frames. But there's no guarantee that
  HTTP/2 libraries and proxies would allow us to use HTTP/2 streams
  and frames without the HTTP message exchange semantics defined in
  RFC 7540 Section 8. Other RPC protocols l

D2906: wireproto: start to associate frame generation with a stream

2018-03-20 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  An upcoming commit will introduce "streams" into the frame-based wire
  protocol. In preparation for this invasive change, we introduce a basic
  "stream" class and have all operations that create frames also operate
  alongside a stream instance.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/wireprotoframing.py
  mercurial/wireprotoserver.py
  tests/test-wireproto-serverreactor.py

CHANGE DETAILS

diff --git a/tests/test-wireproto-serverreactor.py 
b/tests/test-wireproto-serverreactor.py
--- a/tests/test-wireproto-serverreactor.py
+++ b/tests/test-wireproto-serverreactor.py
@@ -27,25 +27,31 @@
 header.flags,
 payload))
 
-def sendcommandframes(reactor, rid, cmd, args, datafh=None):
+def sendcommandframes(reactor, stream, rid, cmd, args, datafh=None):
 """Generate frames to run a command and send them to a reactor."""
 return sendframes(reactor,
-  framing.createcommandframes(rid, cmd, args, datafh))
+  framing.createcommandframes(stream, rid, cmd, args,
+  datafh))
 
 class FrameTests(unittest.TestCase):
 def testdataexactframesize(self):
 data = util.bytesio(b'x' * framing.DEFAULT_MAX_FRAME_SIZE)
 
-frames = list(framing.createcommandframes(1, b'command', {}, data))
+stream = framing.stream()
+frames = list(framing.createcommandframes(stream, 1, b'command',
+  {}, data))
 self.assertEqual(frames, [
 ffs(b'1 command-name have-data command'),
 ffs(b'1 command-data continuation %s' % data.getvalue()),
 ffs(b'1 command-data eos ')
 ])
 
 def testdatamultipleframes(self):
 data = util.bytesio(b'x' * (framing.DEFAULT_MAX_FRAME_SIZE + 1))
-frames = list(framing.createcommandframes(1, b'command', {}, data))
+
+stream = framing.stream()
+frames = list(framing.createcommandframes(stream, 1, b'command', {},
+  data))
 self.assertEqual(frames, [
 ffs(b'1 command-name have-data command'),
 ffs(b'1 command-data continuation %s' % (
@@ -56,7 +62,8 @@
 def testargsanddata(self):
 data = util.bytesio(b'x' * 100)
 
-frames = list(framing.createcommandframes(1, b'command', {
+stream = framing.stream()
+frames = list(framing.createcommandframes(stream, 1, b'command', {
 b'key1': b'key1value',
 b'key2': b'key2value',
 b'key3': b'key3value',
@@ -75,59 +82,63 @@
 with self.assertRaisesRegexp(ValueError,
  'cannot use more than 255 formatting'):
 args = [b'x' for i in range(256)]
-list(framing.createtextoutputframe(1, [(b'bleh', args, [])]))
+list(framing.createtextoutputframe(None, 1,
+   [(b'bleh', args, [])]))
 
 def testtextoutputexcessivelabels(self):
 """At most 255 labels are allowed."""
 with self.assertRaisesRegexp(ValueError,
  'cannot use more than 255 labels'):
 labels = [b'l' for i in range(256)]
-list(framing.createtextoutputframe(1, [(b'bleh', [], labels)]))
+list(framing.createtextoutputframe(None, 1,
+   [(b'bleh', [], labels)]))
 
 def testtextoutputformattingstringtype(self):
 """Formatting string must be bytes."""
 with self.assertRaisesRegexp(ValueError, 'must use bytes formatting '):
-list(framing.createtextoutputframe(1, [
+list(framing.createtextoutputframe(None, 1, [
 (b'foo'.decode('ascii'), [], [])]))
 
 def testtextoutputargumentbytes(self):
 with self.assertRaisesRegexp(ValueError, 'must use bytes for 
argument'):
-list(framing.createtextoutputframe(1, [
+list(framing.createtextoutputframe(None, 1, [
 (b'foo', [b'foo'.decode('ascii')], [])]))
 
 def testtextoutputlabelbytes(self):
 with self.assertRaisesRegexp(ValueError, 'must use bytes for labels'):
-list(framing.createtextoutputframe(1, [
+list(framing.createtextoutputframe(None, 1, [
 (b'foo', [], [b'foo'.decode('ascii')])]))
 
 def testtextoutputtoolongformatstring(self):
 with self.assertRaisesRegexp(ValueError,
  'formatting string cannot be longer 
than'):
-list(framing.createtextoutputframe(1, [
+list(framing.createtextoutputframe(None, 1, [
 

D2897: fix: new extension for automatically modifying file contents

2018-03-20 Thread hooper (Danny Hooper)
hooper updated this revision to Diff 7165.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2897?vs=7123&id=7165

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

AFFECTED FILES
  hgext/fix.py
  tests/test-doctest.py
  tests/test-fix-clang-format.t
  tests/test-fix-topology.t
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
new file mode 100644
--- /dev/null
+++ b/tests/test-fix.t
@@ -0,0 +1,951 @@
+Set up the config with two simple fixers: one that fixes specific line ranges,
+and one that always fixes the whole file. They both "fix" files by converting
+letters to uppercase. They use different file extensions, so each test case can
+choose which behavior to use by naming files.
+
+  $ cat >> $HGRCPATH < [extensions]
+  > fix =
+  > [experimental]
+  > evolution.createmarkers=True
+  > evolution.allowunstable=True
+  > [fix]
+  > uppercase-whole-file:command=sed -e 's/.*/\U&/'
+  > uppercase-whole-file:fileset=set:**.whole
+  > uppercase-changed-lines:command=sed
+  > uppercase-changed-lines:linerange=-e '{first},{last} s/.*/\U&/'
+  > uppercase-changed-lines:fileset=set:**.changed
+  > EOF
+
+Help text for fix.
+
+  $ hg help fix
+  hg fix [OPTION]... [FILE]...
+  
+  rewrite file content in changesets or working directory
+  
+  Runs any configured tools to fix the content of files. Only affects files
+  with changes, unless file arguments are provided. Only affects changed
+  lines of files, unless the --whole flag is used. Some tools may always
+  affect the whole file regardless of --whole.
+  
+  If revisions are specified with --rev, those revisions will be checked,
+  and they may be replaced with new revisions that have fixed file content.
+  It is desirable to specify all descendants of each specified revision, so
+  that the fixes propagate to the descendants. If all descendants are fixed
+  at the same time, no merging, rebasing, or evolution will be required.
+  
+  If --working-dir is used, files with uncommitted changes in the working
+  copy will be fixed. If the checked-out revision is also fixed, the 
working
+  directory will update to the replacement revision.
+  
+  When determining what lines of each file to fix at each revision, the
+  whole set of revisions being fixed is considered, so that fixes to 
earlier
+  revisions are not forgotten in later ones. The --base flag can be used to
+  override this default behavior, though it is not usually desirable to do
+  so.
+  
+  (use 'hg help -e fix' to show help for the fix extension)
+  
+  options ([+] can be repeated):
+  
+  --base REV [+] revisions to diff against (overrides automatic selection,
+ and applies to every revision being fixed)
+   -r --rev REV [+]  revisions to fix
+   -w --working-dir  fix the working directory
+  --wholealways fix every line of a file
+  
+  (some details hidden, use --verbose to show complete help)
+
+  $ hg help -e fix
+  fix extension - rewrite file content in changesets or working copy
+  (EXPERIMENTAL)
+  
+  Provides a command that runs configured tools on the contents of modified
+  files, writing back any fixes to the working copy or replacing changesets.
+  
+  Here is an example configuration that causes 'hg fix' to apply automatic
+  formatting fixes to modified lines in C++ code:
+  
+[fix]
+clang-format:command=clang-format --assume-filename={rootpath}
+clang-format:linerange=--lines={first}:{last}
+clang-format:fileset=set:**.cpp or **.hpp
+  
+  The :command suboption forms the first part of the shell command that will be
+  used to fix a file. The content of the file is passed on standard input, and
+  the fixed file content is expected on standard output. If there is any output
+  on standard error, the file will not be affected. Some values may be
+  substituted into the command:
+  
+{rootpath}  The path of the file being fixed, relative to the repo root
+{basename}  The name of the file being fixed, without the directory path
+  
+  If the :linerange suboption is set, the tool will only be run if there are
+  changed lines in a file. The value of this suboption is appended to the shell
+  command once for every range of changed lines in the file. Some values may be
+  substituted into the command:
+  
+{first}   The 1-based line number of the first line in the modified range
+{last}The 1-based line number of the last line in the modified range
+  
+  The :fileset suboption determines which files will be passed through each
+  configured tool. See 'hg help fileset' for possible values. If there are file
+  arguments to 'hg fix', the intersection of these filesets is used.
+  
+  There is also a configurable limit for the maximum size of file that will be
+  processed by 'hg fix':
+  
+[fix]
+maxfilesize=2MB
+  
+  list of commands:
+  
+   fix   r

D2905: rebase: pass "inmemory" directly to _definedestmap()

2018-03-20 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We no longer reassign rbsrt.inmemory in _definedestmap(), so we don't
  need to pass the whole rebase runtime instance anymore, thus
  making it clear that it won't be updated.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -840,8 +840,8 @@
 if retcode is not None:
 return retcode
 else:
-destmap = _definedestmap(ui, repo, rbsrt, destf, srcf, basef, revf,
- destspace=destspace)
+destmap = _definedestmap(ui, repo, inmemory, destf, srcf, basef,
+ revf, destspace=destspace)
 retcode = rbsrt._preparenewrebase(destmap)
 if retcode is not None:
 return retcode
@@ -866,7 +866,7 @@
 rbsrt._performrebase(tr)
 rbsrt._finishrebase()
 
-def _definedestmap(ui, repo, rbsrt, destf=None, srcf=None, basef=None,
+def _definedestmap(ui, repo, inmemory, destf=None, srcf=None, basef=None,
revf=None, destspace=None):
 """use revisions argument to define destmap {srcrev: destrev}"""
 if revf is None:
@@ -881,7 +881,7 @@
 if revf and srcf:
 raise error.Abort(_('cannot specify both a revision and a source'))
 
-if not rbsrt.inmemory:
+if not inmemory:
 cmdutil.checkunfinished(repo)
 cmdutil.bailifchanged(repo)
 
@@ -959,7 +959,7 @@
 
 rebasingwcp = repo['.'].rev() in rebaseset
 ui.log("rebase", "", rebase_rebasing_wcp=rebasingwcp)
-if rbsrt.inmemory and rebasingwcp:
+if inmemory and rebasingwcp:
 # Check these since we did not before.
 cmdutil.checkunfinished(repo)
 cmdutil.bailifchanged(repo)



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


D2897: fix: new extension for automatically modifying file contents

2018-03-20 Thread hooper (Danny Hooper)
hooper added a comment.


  In https://phab.mercurial-scm.org/D2897#46656, @pulkit wrote:
  
  > Haven't reviewed the patch but I think `fix` is too generic for this use 
case. What about `format`? Sorry for not having this idea when we had couple of 
discussion on it.
  
  
  I will do a final pass to rename it if desired, but I would like to wait for 
any other feedback before doing so.
  
  I think "format" is accurate for how we expect this to be used, but I also 
think it may be overly specific. I don't have any good alternatives in mind. 
"fix" is problematic because it is confusing in contexts like commit messages.

REPOSITORY
  rHG Mercurial

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

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


D2057: rust implementation of hg status

2018-03-20 Thread kevincox (Kevin Cox)
kevincox added a comment.


  I'm not a windows expert but it seems like the rust OsStr, Path and 
filesystem APIs should handle these conversions for you. I think the only place 
where you would need to do os-specific code is when doing serialization and 
serialization which I think should be handled by 
https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStringExt.html and 
https://doc.rust-lang.org/std/os/windows/ffi/trait.OsStringExt.html.

REPOSITORY
  rHG Mercurial

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

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


D2396: stack: import Evolve stack test file

2018-03-20 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> test-stack.t:81
> +  |
> +  o  3 foo draft c_d
> +  |

What if this was @ in the hg repo and only commits 4 and 5 were my own, then I 
would not want it to be part of my stack. It feels like a definition of 
upstream would be very helpful. Perhaps a way of providing a separate upstream 
per commit would be useful. Let's say upstream() was a revset, then I feel like 
something like "only(., upstream(.))" would be my stack. Of course, it gets 
weird if I have a history like we have here and I have defined the upstream of 
4 to be 2 and the upstream of 5 to be 3 (or the other way around). I guess only 
commits that share an upstream can be part of the same stack.

> test-stack.t:96-108
> +  @  6 foo draft c_d
> +  |
> +  | *  5 foo draft c_f
> +  | |
> +  | *  4 foo draft c_e
> +  | |
> +  | x  3 foo draft c_d

I think I would have preferred to see all of these in my stack rather than just 
commit 6. Would you?

REPOSITORY
  rHG Mercurial

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

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


D2057: rust implementation of hg status

2018-03-20 Thread quark (Jun Wu)
quark added a comment.


  https://crates.io/crates/local-encoding seems to be the right choice.

REPOSITORY
  rHG Mercurial

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

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


mercurial@36999: 18 new changesets

2018-03-20 Thread Mercurial Commits
18 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/255f635c3204
changeset:   36982:255f635c3204
parent:  36978:c479692690ef
user:Yuya Nishihara 
date:Sun Mar 11 21:05:29 2018 +0900
summary: templater: convert resources to a table of callables for future 
extension

https://www.mercurial-scm.org/repo/hg/rev/036e4483d3a1
changeset:   36983:036e4483d3a1
user:Yuya Nishihara 
date:Sun Mar 11 21:12:02 2018 +0900
summary: templater: process mapping dict by resource callables

https://www.mercurial-scm.org/repo/hg/rev/939e0983c1d9
changeset:   36984:939e0983c1d9
user:Yuya Nishihara 
date:Sun Mar 11 21:26:15 2018 +0900
summary: formatter: unblock storing fctx as a template resource

https://www.mercurial-scm.org/repo/hg/rev/66e64681e0a8
changeset:   36985:66e64681e0a8
user:Yuya Nishihara 
date:Sun Mar 11 21:36:28 2018 +0900
summary: annotate: add support for template keywords and functions 
depending on ctx

https://www.mercurial-scm.org/repo/hg/rev/afac8ab37c2c
changeset:   36986:afac8ab37c2c
user:Yuya Nishihara 
date:Sun Mar 18 12:54:03 2018 +0900
summary: cmdutil: drop redundant import of merge module

https://www.mercurial-scm.org/repo/hg/rev/4b744c7b35ce
changeset:   36987:4b744c7b35ce
user:Yuya Nishihara 
date:Sat Mar 17 15:22:14 2018 +0900
summary: templater: fix invalid reference of runsymbol in doctest

https://www.mercurial-scm.org/repo/hg/rev/317382151ac3
changeset:   36988:317382151ac3
user:Yuya Nishihara 
date:Sat Mar 17 11:23:04 2018 +0900
summary: templater: rename .render(mapping) to .renderdefault(mapping) (API)

https://www.mercurial-scm.org/repo/hg/rev/de117f579431
changeset:   36989:de117f579431
user:Yuya Nishihara 
date:Fri Mar 16 21:24:12 2018 +0900
summary: templater: factor out helper that renders named template as string

https://www.mercurial-scm.org/repo/hg/rev/b6a4881cec19
changeset:   36990:b6a4881cec19
user:Matt Harbison 
date:Sun Mar 18 15:32:49 2018 -0400
summary: test-lfs: glob over some output changes

https://www.mercurial-scm.org/repo/hg/rev/d683c7367989
changeset:   36991:d683c7367989
user:Matt Harbison 
date:Sat Mar 10 23:58:01 2018 -0500
summary: wireproto: explicitly flush stdio to prevent stalls on Windows

https://www.mercurial-scm.org/repo/hg/rev/ccc2d5f10421
changeset:   36992:ccc2d5f10421
user:Augie Fackler 
date:Sun Mar 04 16:23:03 2018 -0500
summary: tests: stop over-specifying tempfile name

https://www.mercurial-scm.org/repo/hg/rev/f4c7dc24e889
changeset:   36993:f4c7dc24e889
user:Pulkit Goyal <7895pul...@gmail.com>
date:Mon Mar 19 00:04:38 2018 +0530
summary: py3: use print as a function in 
tests/test-narrow-clone-non-narrow-server.t

https://www.mercurial-scm.org/repo/hg/rev/0baf0e3ee569
changeset:   36994:0baf0e3ee569
user:Pulkit Goyal <7895pul...@gmail.com>
date:Mon Mar 19 00:02:59 2018 +0530
summary: py3: make tests/test-log-linerange.t work on Python 3

https://www.mercurial-scm.org/repo/hg/rev/d5d42c170f4d
changeset:   36995:d5d42c170f4d
user:Pulkit Goyal <7895pul...@gmail.com>
date:Mon Mar 19 00:06:10 2018 +0530
summary: py3: use pycompat.bytestr() in dirstate.py

https://www.mercurial-scm.org/repo/hg/rev/1bf555cb680e
changeset:   36996:1bf555cb680e
user:Pulkit Goyal <7895pul...@gmail.com>
date:Sun Mar 04 22:35:29 2018 +0530
summary: py3: use "%d" % int instead of str(int)

https://www.mercurial-scm.org/repo/hg/rev/44467a4d472f
changeset:   36997:44467a4d472f
user:Gregory Szorc 
date:Fri Mar 16 09:41:21 2018 -0700
summary: hgweb: refactor multirequest to be a dict of lists

https://www.mercurial-scm.org/repo/hg/rev/3723b42ff953
changeset:   36998:3723b42ff953
user:Kyle Lippincott 
date:Fri Jan 19 19:14:09 2018 -0800
summary: filemerge: move temp file unlinks to _maketempfiles

https://www.mercurial-scm.org/repo/hg/rev/e349ad5cbb71
changeset:   36999:e349ad5cbb71
bookmark:@
tag: tip
user:Kyle Lippincott 
date:Fri Jan 19 19:07:58 2018 -0800
summary: filemerge: use a single temp dir instead of temp files

-- 
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


D2904: templatefuncs: add mailmap template function

2018-03-20 Thread sheehan (Connor Sheehan)
sheehan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This commit adds a template function to support the .mailmap file
  in Mercurial repositories. The .mailmap file comes from git, and
  can be used to map new emails and names for old commits. The general
  use case is that someone may change their name or author commits
  under different emails and aliases, which would make these
  commits appear as though they came from different persons. The
  file allows you to specify the correct name that should be used
  in place of the author field specified in the commit.
  
  The mailmap file has 4 possible formats used to map old "commit"
  names to new "proper" names:
  
  1.  
  2. Proper Name 
  3. Proper Name  
  4. Proper Name  Commit Name 
  
  Essentially there is a commit email present in each mailmap entry,
  that maps to either an updated name, email, or both. The final
  possible format allows commits authored by a person who used
  both an old name and an old email to map to a new name and email.
  
  To parse the file, we split by spaces and build a name out
  of every element that does not start with "<". Once we find an element
  that does start with "<" we concatenate all the name elements that preceded
  and add that as a parsed name. We then add the email as the first
  parsed email. We repeat the process until the end of the line, or
  a comment is found. We will be left with all parsed names in a list,
  and all parsed emails in a list, with the 0 index being the proper
  values and the 1 index being the commit values (if they were specified
  in the entry).
  
  The commit values are added as the keys to a dict, and with the proper
  fields as the values. The mapname function takes the mapping object and
  the commit author field and attempts to look for a corresponding entry.
  To do so we try (commit name, commit email) first, and if no results are
  returned then (None, commit email) is also looked up. This is due to
  format 4 from above, where someone may have a mailmap entry with both
  name and email, and if they don't it is possible they have an entry that
  uses only the commit email.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/templatefuncs.py
  tests/test-mailmap.t

CHANGE DETAILS

diff --git a/tests/test-mailmap.t b/tests/test-mailmap.t
new file mode 100644
--- /dev/null
+++ b/tests/test-mailmap.t
@@ -0,0 +1,67 @@
+Create a repo and add some commits
+
+  $ hg init mm
+  $ cd mm
+  $ echo "Test content" > testfile1
+  $ hg add testfile1
+  $ HGUSER="Proper " hg commit -m "First commit"
+  $ echo "Test content 2" > testfile2
+  $ hg add testfile2
+  $ HGUSER="Commit Name 2 " hg commit -m "Second commit"
+  $ echo "Test content 3" > testfile3
+  $ hg add testfile3
+  $ HGUSER="Commit Name 3 " hg commit -m "Third commit"
+  $ echo "Test content 4" > testfile4
+  $ hg add testfile4
+  $ HGUSER="Commit Name 4 " hg commit -m "Fourth commit"
+
+Add a .mailmap file with each possible entry type plus comments
+  $ cat > .mailmap << EOF
+  > # Comment shouldn't break anything
+  >   # Should update email only
+  > Proper Name 2  # Should update name only
+  > Proper Name 3   # Should update name, email due 
to email
+  > Proper Name 4  Commit Name 4  # Should update 
name, email due to name, email
+  > EOF
+  $ hg add .mailmap
+  $ HGUSER="Testuser " hg commit -m "Add mailmap file"
+
+Output of commits should be normal without filter
+  $ hg log -T "{author}\n" -r "all()"
+  Proper 
+  Commit Name 2 
+  Commit Name 3 
+  Commit Name 4 
+  Testuser 
+
+Output of commits with filter shows their mailmap values
+  $ hg log -T "{mailmap(author)}\n" -r "all()"
+  Proper 
+  Proper Name 2 
+  Proper Name 3 
+  Proper Name 4 
+  Testuser 
+
+Add new mailmap entry for testuser
+  $ cat >> .mailmap << EOF
+  >  
+  > EOF
+
+Output of commits with filter shows their updated mailmap values
+  $ hg log -T "{mailmap(author)}\n" -r "all()"
+  Proper 
+  Proper Name 2 
+  Proper Name 3 
+  Proper Name 4 
+  Testuser 
+
+A commit with improperly formatted user field should not break the filter
+  $ echo "some more test content" > testfile1
+  $ HGUSER="Improper user" hg commit -m "Commit with improper user field"
+  $ hg log -T "{mailmap(author)}\n" -r "all()"
+  Proper 
+  Proper Name 2 
+  Proper Name 3 
+  Proper Name 4 
+  Testuser 
+  Improper user
diff --git a/mercurial/templatefuncs.py b/mercurial/templatefuncs.py
--- a/mercurial/templatefuncs.py
+++ b/mercurial/templatefuncs.py
@@ -7,6 +7,7 @@
 
 from __future__ import absolute_import
 
+import collections
 import re
 
 from .i18n import _
@@ -167,6 +168,119 @@
 return node
 return templatefilters.short(node)
 
+# Represents mailmap keys/values
+mailmaptup = collections.namedtuple('mailmaptup', ['name', 'email'])
+
+def parsemailmap(mailmapcontent):
+"""Parses data in the .mailmap forma

D2903: utils: add isauthorwellformed function

2018-03-20 Thread sheehan (Connor Sheehan)
sheehan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Adds a function to determine if an author field is formatted
  correctly (ie "Contributor Name ")

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -2615,6 +2615,12 @@
 r = None
 return author[author.find('<') + 1:r]
 
+_correctauthorformat = re.compile('^[^<]+\s\<[^<>]+@[^<>]+\>$')
+def isauthorwellformed(author):
+'''Return True if the author field is well formed
+(ie "Contributor Name ")'''
+return bool(_correctauthorformat.match(author))
+
 def ellipsis(text, maxlength=400):
 """Trim string to at most maxlength (default: 400) columns in display."""
 return encoding.trim(text, maxlength, ellipsis='...')



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


D2842: util: don't log low-level I/O calls for HTTP peer

2018-03-20 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 7161.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2842?vs=7008&id=7161

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

AFFECTED FILES
  mercurial/debugcommands.py
  mercurial/util.py
  tests/test-http-protocol.t

CHANGE DETAILS

diff --git a/tests/test-http-protocol.t b/tests/test-http-protocol.t
--- a/tests/test-http-protocol.t
+++ b/tests/test-http-protocol.t
@@ -175,29 +175,21 @@
   > command listkeys
   > namespace namespaces
   > EOF
-  s> sendall(*, 0): (glob)
   s> GET /?cmd=capabilities HTTP/1.1\r\n
   s> Accept-Encoding: identity\r\n
   s> accept: application/mercurial-0.1\r\n
   s> host: $LOCALIP:$HGPORT\r\n (glob)
   s> user-agent: mercurial/proto-1.0 (Mercurial *)\r\n (glob)
   s> \r\n
   s> makefile('rb', None)
-  s> readline() -> 36:
   s> HTTP/1.1 200 Script output follows\r\n
-  s> readline() -> 28:
   s> Server: testing stub value\r\n
-  s> readline() -> *: (glob)
   s> Date: $HTTP_DATE$\r\n
-  s> readline() -> 41:
   s> Content-Type: application/mercurial-0.1\r\n
-  s> readline() -> 21:
   s> Content-Length: *\r\n (glob)
-  s> readline() -> 2:
   s> \r\n
-  s> read(*) -> *: lookup branchmap pushkey known getbundle unbundlehash batch 
changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ 
unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx 
compression=$BUNDLE2_COMPRESSIONS$ (glob)
+  s> lookup branchmap pushkey known getbundle unbundlehash batch 
changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ 
unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx 
compression=$BUNDLE2_COMPRESSIONS$
   sending listkeys command
-  s> sendall(*, 0): (glob)
   s> GET /?cmd=listkeys HTTP/1.1\r\n
   s> Accept-Encoding: identity\r\n
   s> vary: X-HgArg-1,X-HgProto-1\r\n
@@ -208,19 +200,12 @@
   s> user-agent: mercurial/proto-1.0 (Mercurial *)\r\n (glob)
   s> \r\n
   s> makefile('rb', None)
-  s> readline() -> 36:
   s> HTTP/1.1 200 Script output follows\r\n
-  s> readline() -> 28:
   s> Server: testing stub value\r\n
-  s> readline() -> *: (glob)
   s> Date: $HTTP_DATE$\r\n
-  s> readline() -> 41:
   s> Content-Type: application/mercurial-0.1\r\n
-  s> readline() -> 20:
   s> Content-Length: 30\r\n
-  s> readline() -> 2:
   s> \r\n
-  s> read(30) -> 30:
   s> bookmarks \n
   s> namespaces\n
   s> phases
@@ -235,28 +220,20 @@
   > x-hgarg-1: namespace=namespaces
   > EOF
   using raw connection to peer
-  s> sendall(*, 0): (glob)
   s> GET /?cmd=listkeys HTTP/1.1\r\n
   s> Accept-Encoding: identity\r\n
   s> accept: application/mercurial-0.1\r\n
   s> user-agent: mercurial/proto-1.0 (Mercurial 42)\r\n (glob)
   s> x-hgarg-1: namespace=namespaces\r\n
   s> host: $LOCALIP:$HGPORT\r\n (glob)
   s> \r\n
   s> makefile('rb', None)
-  s> readline() -> 36:
   s> HTTP/1.1 200 Script output follows\r\n
-  s> readline() -> 28:
   s> Server: testing stub value\r\n
-  s> readline() -> *: (glob)
   s> Date: $HTTP_DATE$\r\n
-  s> readline() -> 41:
   s> Content-Type: application/mercurial-0.1\r\n
-  s> readline() -> 20:
   s> Content-Length: 30\r\n
-  s> readline() -> 2:
   s> \r\n
-  s> read(30) -> 30:
   s> bookmarks \n
   s> namespaces\n
   s> phases
diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -762,7 +762,8 @@
 return makeloggingfileobject(observer.fh, res, observer.name,
  reads=observer.reads,
  writes=observer.writes,
- logdata=observer.logdata)
+ logdata=observer.logdata,
+ logdataapis=observer.logdataapis)
 
 def recv(self, *args, **kwargs):
 return object.__getattribute__(self, r'_observedcall')(
@@ -825,29 +826,37 @@
 class baseproxyobserver(object):
 def _writedata(self, data):
 if not self.logdata:
-self.fh.write('\n')
-self.fh.flush()
+if self.logdataapis:
+self.fh.write('\n')
+self.fh.flush()
 return
 
 # Simple case writes all data on a single line.
 if b'\n' not in data:
-self.fh.write(': %s\n' % escapedata(data))
+if self.logdataapis:
+self.fh.write(': %s\n' % escapedata(data))
+else:
+self.fh.write('%s> %s\n' % (self.name, escapedata(data)))
 self.fh.flush()
 return
 
 # Data with newlines is written to multiple lines.
-self.fh.write(':\n')
+if self.logdataapis:
+self.fh.write(':\n')
+
 lines = data.splitlin

D2807: remotenames: add functionality to hoist remotebookmarks

2018-03-20 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  A gentle reminder to get this series reviewed.

REPOSITORY
  rHG Mercurial

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

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


D2750: thirdparty: start vendoring cbor python library

2018-03-20 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  A gentle reminder to get this series reviewed.

REPOSITORY
  rHG Mercurial

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

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


Re: [PATCH] obsolete: add a note that explains creating aliases for marker flags

2018-03-20 Thread Pulkit Goyal
On Tue, Mar 20, 2018 at 3:45 PM, Anton Shestakov  wrote:
> # HG changeset patch
> # User Anton Shestakov 
> # Date 1521526325 -28800
> #  Tue Mar 20 14:12:05 2018 +0800
> # Node ID 6ee52d3b6bd4b86a68799cc969035cd0fd77ffe5
> # Parent  e349ad5cbb7195607a300439a12a5316795125f8
> obsolete: add a note that explains creating aliases for marker flags

Queued this many thanks.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] obsolete: add a note that explains creating aliases for marker flags

2018-03-20 Thread Feld Boris

LGTM


On 20/03/2018 11:15, Anton Shestakov wrote:

# HG changeset patch
# User Anton Shestakov 
# Date 1521526325 -28800
#  Tue Mar 20 14:12:05 2018 +0800
# Node ID 6ee52d3b6bd4b86a68799cc969035cd0fd77ffe5
# Parent  e349ad5cbb7195607a300439a12a5316795125f8
obsolete: add a note that explains creating aliases for marker flags

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -148,6 +148,8 @@ def isenabled(repo, option):
  
  return _getoptionvalue(repo, option)
  
+# Creating aliases for marker flags because evolve extension looks for

+# bumpedfix in obsolete.py
  bumpedfix = obsutil.bumpedfix
  usingsha256 = obsutil.usingsha256
  
___

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


[PATCH] obsolete: add a note that explains creating aliases for marker flags

2018-03-20 Thread Anton Shestakov
# HG changeset patch
# User Anton Shestakov 
# Date 1521526325 -28800
#  Tue Mar 20 14:12:05 2018 +0800
# Node ID 6ee52d3b6bd4b86a68799cc969035cd0fd77ffe5
# Parent  e349ad5cbb7195607a300439a12a5316795125f8
obsolete: add a note that explains creating aliases for marker flags

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -148,6 +148,8 @@ def isenabled(repo, option):
 
 return _getoptionvalue(repo, option)
 
+# Creating aliases for marker flags because evolve extension looks for
+# bumpedfix in obsolete.py
 bumpedfix = obsutil.bumpedfix
 usingsha256 = obsutil.usingsha256
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH] hgweb: explain instabilities of unstable changesets (the rest of the themes)

2018-03-20 Thread Anton Shestakov
# HG changeset patch
# User Anton Shestakov 
# Date 1521526768 -28800
#  Tue Mar 20 14:19:28 2018 +0800
# Node ID 81060ada33729a2b4f250f72416a3efab2c5f398
# Parent  e349ad5cbb7195607a300439a12a5316795125f8
hgweb: explain instabilities of unstable changesets (the rest of the themes)

diff --git a/mercurial/templates/gitweb/changeset.tmpl 
b/mercurial/templates/gitweb/changeset.tmpl
--- a/mercurial/templates/gitweb/changeset.tmpl
+++ b/mercurial/templates/gitweb/changeset.tmpl
@@ -45,6 +45,7 @@ changeset |
  {node|short}
 
 {if(obsolete, succsandmarkers%obsfateentry)}
+{if(instabilities, whyunstable%whyunstableentry)}
 {ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)}
 {child%changesetchild}
 
diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map
--- a/mercurial/templates/gitweb/map
+++ b/mercurial/templates/gitweb/map
@@ -282,6 +282,13 @@ obsfateentry = '
 obsolete
 
{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}
   '
+instabilitychangesetlink = '{node|short}'
+divergentnode = '{instabilitychangesetlink} ({phase})'
+whyunstableentry = '
+  
+unstable
+{instability}: {if(divergentnodes, divergentnodes%divergentnode)} 
{reason} {instabilitychangesetlink}
+  '
 shortlogentry = '
   
 {date|rfc822date}
diff --git a/mercurial/templates/monoblue/changeset.tmpl 
b/mercurial/templates/monoblue/changeset.tmpl
--- a/mercurial/templates/monoblue/changeset.tmpl
+++ b/mercurial/templates/monoblue/changeset.tmpl
@@ -49,6 +49,7 @@
 changeset {rev}
 {node|short}
 {if(obsolete, succsandmarkers%obsfateentry)}
+{if(instabilities, whyunstable%whyunstableentry)}
 {ifeq(count(parent), '2', parent%changesetparentdiff, 
parent%changesetparent)}
 {child%changesetchild}
 
diff --git a/mercurial/templates/monoblue/map b/mercurial/templates/monoblue/map
--- a/mercurial/templates/monoblue/map
+++ b/mercurial/templates/monoblue/map
@@ -238,6 +238,11 @@ obsfatedate = '{if(obsfatedate(markers),
 obsfateentry = '
   obsolete
   
{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}'
+instabilitychangesetlink = '{node|short}'
+divergentnode = '{instabilitychangesetlink} ({phase})'
+whyunstableentry = '
+  unstable
+  {instability}: {if(divergentnodes, divergentnodes%divergentnode)} 
{reason} {instabilitychangesetlink}'
 shortlogentry = '
   
 {date|rfc822date}
diff --git a/mercurial/templates/spartan/changelogentry.tmpl 
b/mercurial/templates/spartan/changelogentry.tmpl
--- a/mercurial/templates/spartan/changelogentry.tmpl
+++ b/mercurial/templates/spartan/changelogentry.tmpl
@@ -23,10 +23,7 @@
   {phase|escape}
  ')}
  {if(obsolete, succsandmarkers%obsfateentry)}
- {ifeq(count(instabilities), '0', '', '
-  instabilities:
-  {instabilities%"{instability} "|escape}
- ')}
+ {if(instabilities, whyunstable%whyunstableentry)}
  
   files:
   {files}
diff --git a/mercurial/templates/spartan/changeset.tmpl 
b/mercurial/templates/spartan/changeset.tmpl
--- a/mercurial/templates/spartan/changeset.tmpl
+++ b/mercurial/templates/spartan/changeset.tmpl
@@ -38,10 +38,7 @@
  {phase|escape}
 ')}
 {if(obsolete, succsandmarkers%obsfateentry)}
-{ifeq(count(instabilities), '0', '', '
- instabilities:
- {instabilities%"{instability} "|escape}
-')}
+{if(instabilities, whyunstable%whyunstableentry)}
 
  files:
  {files}
diff --git a/mercurial/templates/spartan/map b/mercurial/templates/spartan/map
--- a/mercurial/templates/spartan/map
+++ b/mercurial/templates/spartan/map
@@ -177,6 +177,13 @@ obsfateentry = '
 obsolete:
 {obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}
   '
+instabilitychangesetlink = '{node|short}'
+divergentnode = '{instabilitychangesetlink} ({phase})'
+whyunstableentry = '
+  
+unstable:
+{instability}: {if(divergentnodes, 
divergentnodes%divergentnode)} {reason} {instabilitychangesetlink}
+  '
 filediffparent = '
   
 parent {rev}:
diff --git a/tests/test-obsolete-divergent.t b/tests/test-obsolete-divergent.t
--- a/tests/test-obsolete-divergent.t
+++ b/tests/test-obsolete-divergent.t
@@ -732,6 +732,12 @@ check explanation for a content-divergen
content-divergent: 70d5a63ca112 (draft) predecessor a178212c3433
   $ get-with-headers.py localhost:$HGPORT 'rev/1a2a9b5b0030?style=coal' | grep 
divergent:
content-divergent: 70d5a63ca112 (draft) predecessor a178212c3433
+  $ get-with-headers.py localhost:$HGPORT 'rev/1a2a9b5b0030?style=gitweb' | 
grep divergent:
+  content-divergent: 70d5a63ca112 (draft) predecessor a178212c3433
+  $ get-with-headers.py localhost:$HGPORT 'rev/1a2a9b5b0030?style=monoblue' | 
grep divergent:
+  content-divergent: 70d5a63ca112 (draft) predecessor a178212c3433
+  $ get-with-headers.py localhost:$HGPORT 'rev/1a2a9b5b0030?style=spartan' | 
grep divergent:
+  content-divergent: 70d5a63ca112 (draft) predecessor a178212c3433
 
   $ killdaemons.py
 
diff --git a/tests/test-obsolete.t

D2666: repair: rename _backup to backupbundle

2018-03-20 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG17692fefc8f2: repair: rename _backup to backupbundle 
(authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2666?vs=6636&id=7160

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

AFFECTED FILES
  hgext/histedit.py
  mercurial/repair.py

CHANGE DETAILS

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -27,7 +27,8 @@
 util,
 )
 
-def _bundle(repo, bases, heads, node, suffix, compress=True, 
obsolescence=True):
+def backupbundle(repo, bases, heads, node, suffix, compress=True,
+ obsolescence=True):
 """create a bundle with the specified revisions as a backup"""
 
 backupdir = "strip-backup"
@@ -166,7 +167,7 @@
 vfs = repo.vfs
 node = nodelist[-1]
 if backup:
-backupfile = _bundle(repo, stripbases, cl.heads(), node, topic)
+backupfile = backupbundle(repo, stripbases, cl.heads(), node, topic)
 repo.ui.status(_("saved backup bundle to %s\n") %
vfs.join(backupfile))
 repo.ui.log("backupbundle", "saved backup bundle to %s\n",
@@ -179,8 +180,8 @@
 # we are trying to strip.  This is harmless since the stripped markers
 # are already backed up and we did not touched the markers for the
 # saved changesets.
-tmpbundlefile = _bundle(repo, savebases, saveheads, node, 'temp',
-compress=False, obsolescence=False)
+tmpbundlefile = backupbundle(repo, savebases, saveheads, node, 'temp',
+ compress=False, obsolescence=False)
 
 try:
 with repo.transaction("strip") as tr:
diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1317,8 +1317,8 @@
 # Create a backup so we can always abort completely.
 backupfile = None
 if not obsolete.isenabled(repo, obsolete.createmarkersopt):
-backupfile = repair._bundle(repo, [parentctxnode], [topmost], root,
-'histedit')
+backupfile = repair.backupbundle(repo, [parentctxnode],
+ [topmost], root, 'histedit')
 state.backupfile = backupfile
 
 def _getsummary(ctx):



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


D2897: fix: new extension for automatically modifying file contents

2018-03-20 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  Haven't reviewed the patch but I think `fix` is too generic for this use 
case. What about `format`? Sorry for not having this idea when we had couple of 
discussion on it.

REPOSITORY
  rHG Mercurial

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

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