Re: [PATCH V3] extdiff: add --per-file and --confirm options

2019-01-29 Thread Ludovic Chabant

> Can you split this to a separate patch? It'll need a bit more churn,
> and we wouldn't want to make it a blocker of the --per-file/--confirm
> feature.

I just sent PATCH V4 which should be just that feature alone, where, if
you don't specify --confirm, it launches the external tool one by one.

The second patch should be ready soon.

Thanks!
-- 
 l u d o .
 . 8 0 17 80
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5744: commit: ignore diff whitespace settings when doing `commit -i` (issue5839)

2019-01-29 Thread spectral (Kyle Lippincott)
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Previously, we respected options like `diff.ignoreblanklines` and
  `diff.ignorews`.  This can cause problems when the user is attempting to
  actually commit the blank line change. Specifically, the split extension can 
get
  into an infinite loop because it detects that the working copy is not clean, 
but
  when we get the diff we don't see the changes, so it just skips popping up the
  chunk selection flow, saying there's no changes to record.
  
  These options are primarily meant for viewing diffs; it is highly unlikely 
that
  someone is actually intending to add extraneous whitespace and have it ignored
  if they attempt to interactively commit (but *not* ignored if they
  non-interactively commit).

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/cmdutil.py
  tests/test-commit-interactive.t
  tests/test-split.t

CHANGE DETAILS

diff --git a/tests/test-split.t b/tests/test-split.t
--- a/tests/test-split.t
+++ b/tests/test-split.t
@@ -599,3 +599,111 @@
   a09ad58faae3 draft
   e704349bd21b draft
   a61bcde8c529 draft
+
+`hg split` with ignoreblanklines=1 does not infinite loop
+
+  $ mkdir $TESTTMP/f
+  $ hg init $TESTTMP/f/a
+  $ cd $TESTTMP/f/a
+  $ printf '1\n2\n3\n4\n5\n' > foo
+  $ cp foo bar
+  $ hg ci -qAm initial
+  $ printf '1\n\n2\n3\ntest\n4\n5\n' > bar
+  $ printf '1\n2\n3\ntest\n4\n5\n' > foo
+  $ hg ci -qm splitme
+  $ cat > $TESTTMP/messages < split 1
+  > --
+  > split 2
+  > EOF
+  $ printf 'f\nn\nf\n' | hg --config extensions.split= --config 
diff.ignoreblanklines=1 split
+  diff --git a/bar b/bar
+  2 hunks, 2 lines changed
+  examine changes to 'bar'? [Ynesfdaq?] f
+  
+  diff --git a/foo b/foo
+  1 hunks, 1 lines changed
+  examine changes to 'foo'? [Ynesfdaq?] n
+  
+  EDITOR: HG: Splitting dd3c45017cbf. Write commit message for the first split 
changeset.
+  EDITOR: splitme
+  EDITOR: 
+  EDITOR: 
+  EDITOR: HG: Enter commit message.  Lines beginning with 'HG:' are removed.
+  EDITOR: HG: Leave message empty to abort commit.
+  EDITOR: HG: --
+  EDITOR: HG: user: test
+  EDITOR: HG: branch 'default'
+  EDITOR: HG: changed bar
+  created new head
+  diff --git a/foo b/foo
+  1 hunks, 1 lines changed
+  examine changes to 'foo'? [Ynesfdaq?] f
+  
+  EDITOR: HG: Splitting dd3c45017cbf. So far it has been split into:
+  EDITOR: HG: - f205aea1c624: split 1
+  EDITOR: HG: Write commit message for the next split changeset.
+  EDITOR: splitme
+  EDITOR: 
+  EDITOR: 
+  EDITOR: HG: Enter commit message.  Lines beginning with 'HG:' are removed.
+  EDITOR: HG: Leave message empty to abort commit.
+  EDITOR: HG: --
+  EDITOR: HG: user: test
+  EDITOR: HG: branch 'default'
+  EDITOR: HG: changed foo
+  saved backup bundle to 
$TESTTMP/f/a/.hg/strip-backup/dd3c45017cbf-463441b5-split.hg (obsstore-off !)
+
+Let's try that again, with a slightly different set of patches, to ensure that
+the ignoreblanklines thing isn't somehow position dependent.
+
+  $ hg init $TESTTMP/f/b
+  $ cd $TESTTMP/f/b
+  $ printf '1\n2\n3\n4\n5\n' > foo
+  $ cp foo bar
+  $ hg ci -qAm initial
+  $ printf '1\n2\n3\ntest\n4\n5\n' > bar
+  $ printf '1\n2\n3\ntest\n4\n\n5\n' > foo
+  $ hg ci -qm splitme
+  $ cat > $TESTTMP/messages < split 1
+  > --
+  > split 2
+  > EOF
+  $ printf 'f\nn\nf\n' | hg --config extensions.split= --config 
diff.ignoreblanklines=1 split
+  diff --git a/bar b/bar
+  1 hunks, 1 lines changed
+  examine changes to 'bar'? [Ynesfdaq?] f
+  
+  diff --git a/foo b/foo
+  2 hunks, 2 lines changed
+  examine changes to 'foo'? [Ynesfdaq?] n
+  
+  EDITOR: HG: Splitting 904c80b40a4a. Write commit message for the first split 
changeset.
+  EDITOR: splitme
+  EDITOR: 
+  EDITOR: 
+  EDITOR: HG: Enter commit message.  Lines beginning with 'HG:' are removed.
+  EDITOR: HG: Leave message empty to abort commit.
+  EDITOR: HG: --
+  EDITOR: HG: user: test
+  EDITOR: HG: branch 'default'
+  EDITOR: HG: changed bar
+  created new head
+  diff --git a/foo b/foo
+  2 hunks, 2 lines changed
+  examine changes to 'foo'? [Ynesfdaq?] f
+  
+  EDITOR: HG: Splitting 904c80b40a4a. So far it has been split into:
+  EDITOR: HG: - ffecf40fa954: split 1
+  EDITOR: HG: Write commit message for the next split changeset.
+  EDITOR: splitme
+  EDITOR: 
+  EDITOR: 
+  EDITOR: HG: Enter commit message.  Lines beginning with 'HG:' are removed.
+  EDITOR: HG: Leave message empty to abort commit.
+  EDITOR: HG: --
+  EDITOR: HG: user: test
+  EDITOR: HG: branch 'default'
+  EDITOR: HG: changed foo
+  saved backup bundle to 
$TESTTMP/f/b/.hg/strip-backup/904c80b40a4a-47fb907f-split.hg (obsstore-off !)
diff --git a/tests/test-commit-interactive.t b/tests/test-commit-interactive.t
--- a/tests/test-commit-interactive.t
+++ b/tests/test-commit-interactive.t
@@ -1842,3 +1842,47 @@
   +change2
   record change 2/2 to 'foo'? [Ynesfdaq?] y
   
+  

D5743: patch: handle 0 context lines (diff.unified=0) when parsing patches

2019-01-29 Thread spectral (Kyle Lippincott)
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Previously, if there were no context lines, we would just keep updating the
  ranges and the hunk, but not actually storing the hunk (just overwriting it 
each
  time).  Thus a diff like this:
  
$ hg diff --config diff.unified=0
diff --git a/bar b/bar
--- a/bar
+++ b/bar
@@ -1,0 +2,1 @@ 1
+change1
@@ -3,0 +5,1 @@ 3
+change2
  
  would come out of the parser like this (change1 is lost):
  
bar:
@@ -3,0 +5,1 @@ 3
+change2
  
  This had some really weird side effects for things like commit --interactive,
  split, etc.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/patch.py
  tests/test-commit-interactive.t
  tests/test-split.t

CHANGE DETAILS

diff --git a/tests/test-split.t b/tests/test-split.t
--- a/tests/test-split.t
+++ b/tests/test-split.t
@@ -103,6 +103,12 @@
   abort: cannot split multiple revisions
   [255]
 
+This function splits a bit strangely primarily to avoid changing the behavior 
of
+the test after a bug was fixed with how split/commit --interactive handled
+`diff.unified=0`: when there were no context lines, it kept only the last diff
+hunk. When running split, this meant that runsplit was always recording three 
commits,
+one for each diff hunk, in reverse order (the base commit was the last diff 
hunk
+in the file).
   $ runsplit() {
   > cat > $TESTTMP/messages < split 1
@@ -113,23 +119,36 @@
   > EOF
   > cat < y
+  > n
+  > n
   > y
   > y
+  > n
   > y
   > y
   > y
   > EOF
   > }
 
   $ HGEDITOR=false runsplit
   diff --git a/a b/a
-  1 hunks, 1 lines changed
+  3 hunks, 3 lines changed
   examine changes to 'a'? [Ynesfdaq?] y
   
+  @@ -1,1 +1,1 @@
+  -1
+  +11
+  record change 1/3 to 'a'? [Ynesfdaq?] n
+  
+  @@ -3,1 +3,1 @@ 2
+  -3
+  +33
+  record change 2/3 to 'a'? [Ynesfdaq?] n
+  
   @@ -5,1 +5,1 @@ 4
   -5
   +55
-  record this change to 'a'? [Ynesfdaq?] y
+  record change 3/3 to 'a'? [Ynesfdaq?] y
   
   transaction abort!
   rollback completed
@@ -140,13 +159,23 @@
   $ HGEDITOR="\"$PYTHON\" $TESTTMP/editor.py"
   $ runsplit
   diff --git a/a b/a
-  1 hunks, 1 lines changed
+  3 hunks, 3 lines changed
   examine changes to 'a'? [Ynesfdaq?] y
   
+  @@ -1,1 +1,1 @@
+  -1
+  +11
+  record change 1/3 to 'a'? [Ynesfdaq?] n
+  
+  @@ -3,1 +3,1 @@ 2
+  -3
+  +33
+  record change 2/3 to 'a'? [Ynesfdaq?] n
+  
   @@ -5,1 +5,1 @@ 4
   -5
   +55
-  record this change to 'a'? [Ynesfdaq?] y
+  record change 3/3 to 'a'? [Ynesfdaq?] y
   
   EDITOR: HG: Splitting 1df0d5c5a3ab. Write commit message for the first split 
changeset.
   EDITOR: a2
@@ -160,13 +189,18 @@
   EDITOR: HG: changed a
   created new head
   diff --git a/a b/a
-  1 hunks, 1 lines changed
+  2 hunks, 2 lines changed
   examine changes to 'a'? [Ynesfdaq?] y
   
+  @@ -1,1 +1,1 @@
+  -1
+  +11
+  record change 1/2 to 'a'? [Ynesfdaq?] n
+  
   @@ -3,1 +3,1 @@ 2
   -3
   +33
-  record this change to 'a'? [Ynesfdaq?] y
+  record change 2/2 to 'a'? [Ynesfdaq?] y
   
   EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into:
   EDITOR: HG: - e704349bd21b: split 1
diff --git a/tests/test-commit-interactive.t b/tests/test-commit-interactive.t
--- a/tests/test-commit-interactive.t
+++ b/tests/test-commit-interactive.t
@@ -1807,3 +1807,38 @@
   n   0 -1 unset   subdir/f1
   $ hg status -A subdir/f1
   M subdir/f1
+
+Test diff.unified=0
+
+  $ hg init $TESTTMP/b
+  $ cd $TESTTMP/b
+  $ cat > foo < 1
+  > 2
+  > 3
+  > 4
+  > 5
+  > EOF
+  $ hg ci -qAm initial
+  $ cat > foo < 1
+  > change1
+  > 2
+  > 3
+  > change2
+  > 4
+  > 5
+  > EOF
+  $ printf 'y\ny\ny\n' | hg ci -im initial --config diff.unified=0
+  diff --git a/foo b/foo
+  2 hunks, 2 lines changed
+  examine changes to 'foo'? [Ynesfdaq?] y
+  
+  @@ -1,0 +2,1 @@ 1
+  +change1
+  record change 1/2 to 'foo'? [Ynesfdaq?] y
+  
+  @@ -3,0 +5,1 @@ 3
+  +change2
+  record change 2/2 to 'foo'? [Ynesfdaq?] y
+  
diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -1609,6 +1609,7 @@
 self.headers = []
 
 def addrange(self, limits):
+self.addcontext([])
 fromstart, fromend, tostart, toend, proc = limits
 self.fromline = int(fromstart)
 self.toline = int(tostart)
@@ -1629,6 +1630,8 @@
 if self.context:
 self.before = self.context
 self.context = []
+if self.hunk:
+self.addcontext([])
 self.hunk = hunk
 
 def newfile(self, hdr):



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


D5742: histedit: add templating support to histedit's rule file generation

2019-01-29 Thread durin42 (Augie Fackler)
durin42 updated this revision to Diff 13565.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5742?vs=13564=13565

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

AFFECTED FILES
  hgext/histedit.py
  tests/test-histedit-commute.t

CHANGE DETAILS

diff --git a/tests/test-histedit-commute.t b/tests/test-histedit-commute.t
--- a/tests/test-histedit-commute.t
+++ b/tests/test-histedit-commute.t
@@ -76,6 +76,31 @@
   #  r, roll = like fold, but discard this commit's description and date
   #
 
+test customization of revision summary
+  $ HGEDITOR=cat hg histedit 177f92b77385 \
+  >  --config histedit.summary-format='I am rev {rev} desc {desc} tags {tags}'
+  pick 177f92b77385 I am rev 2 desc c tags 
+  pick 055a42cdd887 I am rev 3 desc d tags 
+  pick e860deea161a I am rev 4 desc e tags 
+  pick 652413bf663e I am rev 5 desc f tags tip
+  
+  # Edit history between 177f92b77385 and 652413bf663e
+  #
+  # Commits are listed from least to most recent
+  #
+  # You can reorder changesets by reordering the lines
+  #
+  # Commands:
+  #
+  #  e, edit = use commit, but stop for amending
+  #  m, mess = edit commit message without changing commit content
+  #  p, pick = use commit
+  #  b, base = checkout changeset and apply further changesets from there
+  #  d, drop = remove commit from history
+  #  f, fold = use commit, but combine it with the one above
+  #  r, roll = like fold, but discard this commit's description and date
+  #
+
 edit the history
 (use a hacky editor to check histedit-last-edit.txt backup)
 
diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -156,6 +156,15 @@
   [histedit]
   linelen = 120  # truncate rule lines at 120 characters
 
+The summary of a change can be customized as well::
+
+  [histedit]
+  summary-format = '{rev} {bookmarks} {desc|firstline}'
+
+The customized summary should be kept short enough that rule lines
+will fit in the configured line length. See above if that requires
+customization.
+
 ``hg histedit`` attempts to automatically choose an appropriate base
 revision to use. To change which base revision is used, define a
 revset in your configuration file::
@@ -206,6 +215,7 @@
 error,
 exchange,
 extensions,
+formatter,
 hg,
 logcmdutil,
 merge as mergemod,
@@ -217,6 +227,7 @@
 repair,
 scmutil,
 state as statemod,
+templatekw,
 util,
 )
 from mercurial.utils import (
@@ -248,6 +259,8 @@
 configitem('ui', 'interface.histedit',
 default=None,
 )
+configitem('histedit', 'summary-format',
+   default='{rev} {desc|firstline}')
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' 
for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
@@ -480,8 +493,13 @@
   
 """
 ctx = self.repo[self.node]
-summary = _getsummary(ctx)
-line = '%s %s %d %s' % (self.verb, ctx, ctx.rev(), summary)
+ui = self.repo.ui
+tres = formatter.templateresources(ui, self.repo)
+t = formatter.maketemplater(ui, ui.config('histedit', 
'summary-format'),
+defaults=templatekw.keywords,
+resources=tres)
+summary = t.renderdefault({'ctx': ctx}).splitlines()[0]
+line = '%s %s %s' % (self.verb, ctx, summary)
 # trim to 75 columns by default so it's not stupidly wide in my editor
 # (the 5 more are left for verb)
 maxlen = self.repo.ui.configint('histedit', 'linelen')



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


D5742: histedit: add templating support to histedit's rule file generation

2019-01-29 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This will allow users to customize the display of the rule list for the
  free-form segment that we don't interpret. We've had users want to add things
  like bookmark names or similar to the rule list as a convenience, which seems
  reasonable.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/histedit.py
  tests/test-histedit-commute.t

CHANGE DETAILS

diff --git a/tests/test-histedit-commute.t b/tests/test-histedit-commute.t
--- a/tests/test-histedit-commute.t
+++ b/tests/test-histedit-commute.t
@@ -76,6 +76,31 @@
   #  r, roll = like fold, but discard this commit's description and date
   #
 
+test customization of revision summary
+  $ HGEDITOR=cat hg histedit 177f92b77385 \
+  >  --config histedit.summary-format='I am rev {rev} desc {desc} tags {tags}'
+  pick 177f92b77385 I am rev 2 desc c tags 
+  pick 055a42cdd887 I am rev 3 desc d tags 
+  pick e860deea161a I am rev 4 desc e tags 
+  pick 652413bf663e I am rev 5 desc f tags tip
+  
+  # Edit history between 177f92b77385 and 652413bf663e
+  #
+  # Commits are listed from least to most recent
+  #
+  # You can reorder changesets by reordering the lines
+  #
+  # Commands:
+  #
+  #  e, edit = use commit, but stop for amending
+  #  m, mess = edit commit message without changing commit content
+  #  p, pick = use commit
+  #  b, base = checkout changeset and apply further changesets from there
+  #  d, drop = remove commit from history
+  #  f, fold = use commit, but combine it with the one above
+  #  r, roll = like fold, but discard this commit's description and date
+  #
+
 edit the history
 (use a hacky editor to check histedit-last-edit.txt backup)
 
diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -156,6 +156,15 @@
   [histedit]
   linelen = 120  # truncate rule lines at 120 characters
 
+The summary of a change can be customized as well::
+
+  [histedit]
+  summary-format = '{rev} {bookmarks} {desc|firstline}'
+
+The customized summary should be kept short enough that rule lines
+will fit in the configured line length. See above if that requires
+customization.
+
 ``hg histedit`` attempts to automatically choose an appropriate base
 revision to use. To change which base revision is used, define a
 revset in your configuration file::
@@ -206,6 +215,8 @@
 error,
 exchange,
 extensions,
+formatter,
+templatekw,
 hg,
 logcmdutil,
 merge as mergemod,
@@ -248,6 +259,8 @@
 configitem('ui', 'interface.histedit',
 default=None,
 )
+configitem('histedit', 'summary-format',
+   default='{rev} {desc|firstline}')
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' 
for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
@@ -480,8 +493,13 @@
   
 """
 ctx = self.repo[self.node]
-summary = _getsummary(ctx)
-line = '%s %s %d %s' % (self.verb, ctx, ctx.rev(), summary)
+ui = self.repo.ui
+tres = formatter.templateresources(ui, self.repo)
+t = formatter.maketemplater(ui, ui.config('histedit', 
'summary-format'),
+defaults=templatekw.keywords,
+resources=tres)
+summary = t.renderdefault({'ctx': ctx}).splitlines()[0]
+line = '%s %s %s' % (self.verb, ctx, summary)
 # trim to 75 columns by default so it's not stupidly wide in my editor
 # (the 5 more are left for verb)
 maxlen = self.repo.ui.configint('histedit', 'linelen')



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


D5741: tests: write commit message using file I/O

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

REVISION SUMMARY
  Python 2.7 will print() \x94\x5c\x0a whereas Python 3 will
  print() \xc2\x94\x5c\x0a. Why, I'm not sure. It probably has to
  do with print() being Unicode aware on Python 3 and Python
  attempting some kind of encoding before emitting the output.
  
  This difference results in a different bytes making it to the
  commit message and the JSON output varying. We work around
  this by writing bytes to a commit message file.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-hgweb-json.t

CHANGE DETAILS

diff --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t
--- a/tests/test-hgweb-json.t
+++ b/tests/test-hgweb-json.t
@@ -2196,7 +2196,8 @@
 Commit message with Japanese Kanji 'Noh', which ends with '\x5c'
 
   $ echo foo >> da/foo
-  $ HGENCODING=cp932 hg ci -m `"$PYTHON" -c 'print("\x94\x5c")'`
+  >>> open('msg', 'wb').write(b'\x94\x5c\x0a') and None
+  $ HGENCODING=cp932 hg ci -l msg
 
 Commit message with null character
 



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


D5740: py3: pass str into RuntimeError() to prevent b'' in output

2019-01-29 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  1. skip-blame as just r'' prefixes

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/remotefilelog/shallowutil.py

CHANGE DETAILS

diff --git a/hgext/remotefilelog/shallowutil.py 
b/hgext/remotefilelog/shallowutil.py
--- a/hgext/remotefilelog/shallowutil.py
+++ b/hgext/remotefilelog/shallowutil.py
@@ -237,9 +237,9 @@
 # v0, str(int(size)) is the header
 size = int(header)
 except ValueError:
-raise RuntimeError("unexpected remotefilelog header: illegal format")
+raise RuntimeError(r"unexpected remotefilelog header: illegal format")
 if size is None:
-raise RuntimeError("unexpected remotefilelog header: no size found")
+raise RuntimeError(r"unexpected remotefilelog header: no size found")
 return index + 1, size, flags
 
 def buildfileblobheader(size, flags, version=None):



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


D5739: py3: use pycompat.bytestr() so that slicing does not result in ascii values

2019-01-29 Thread pulkit (Pulkit Goyal)
pulkit 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/D5739

AFFECTED FILES
  hgext/convert/monotone.py

CHANGE DETAILS

diff --git a/hgext/convert/monotone.py b/hgext/convert/monotone.py
--- a/hgext/convert/monotone.py
+++ b/hgext/convert/monotone.py
@@ -102,7 +102,7 @@
 
 command.append('l')
 for arg in args:
-command += "%d:%s" % (len(arg), arg)
+command += pycompat.bytestr("%d:%s" % (len(arg), arg))
 command.append('e')
 command = ''.join(command)
 



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


D5738: py3: use '%d' instead of '%s' for integers

2019-01-29 Thread pulkit (Pulkit Goyal)
pulkit 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/D5738

AFFECTED FILES
  hgext/convert/monotone.py

CHANGE DETAILS

diff --git a/hgext/convert/monotone.py b/hgext/convert/monotone.py
--- a/hgext/convert/monotone.py
+++ b/hgext/convert/monotone.py
@@ -93,9 +93,9 @@
 kwargs = pycompat.byteskwargs(kwargs)
 command = []
 for k, v in kwargs.iteritems():
-command.append("%s:%s" % (len(k), k))
+command.append("%d:%s" % (len(k), k))
 if v:
-command.append("%s:%s" % (len(v), v))
+command.append("%d:%s" % (len(v), v))
 if command:
 command.insert(0, 'o')
 command.append('e')



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


D5736: tests: port test-hgweb-auth.py to Python 3

2019-01-29 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG30dd20a56f3e: tests: port test-hgweb-auth.py to Python 3 
(authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5736?vs=13551=13558

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

AFFECTED FILES
  contrib/python3-whitelist
  tests/test-hgweb-auth.py

CHANGE DETAILS

diff --git a/tests/test-hgweb-auth.py b/tests/test-hgweb-auth.py
--- a/tests/test-hgweb-auth.py
+++ b/tests/test-hgweb-auth.py
@@ -24,123 +24,136 @@
 def writeauth(items):
 ui = origui.copy()
 for name, value in items.items():
-ui.setconfig('auth', name, value)
+ui.setconfig(b'auth', name, value)
 return ui
 
+def _stringifyauthinfo(ai):
+if ai is None:
+return ai
+realm, authuris, user, passwd = ai
+return (pycompat.strurl(realm),
+[pycompat.strurl(u) for u in authuris],
+pycompat.strurl(user),
+pycompat.strurl(passwd),
+)
+
 def test(auth, urls=None):
 print('CFG:', pycompat.sysstr(stringutil.pprint(auth, bprefix=True)))
 prefixes = set()
 for k in auth:
-prefixes.add(k.split('.', 1)[0])
+prefixes.add(k.split(b'.', 1)[0])
 for p in prefixes:
-for name in ('.username', '.password'):
+for name in (b'.username', b'.password'):
 if (p + name) not in auth:
 auth[p + name] = p
 auth = dict((k, v) for k, v in auth.items() if v is not None)
 
 ui = writeauth(auth)
 
 def _test(uri):
-print('URI:', uri)
+print('URI:', pycompat.strurl(uri))
 try:
 pm = url.passwordmgr(ui, urlreq.httppasswordmgrwithdefaultrealm())
 u, authinfo = util.url(uri).authinfo()
 if authinfo is not None:
-pm.add_password(*authinfo)
-print('', pm.find_user_password('test', u))
+pm.add_password(*_stringifyauthinfo(authinfo))
+print('', tuple(pycompat.strurl(a) for a in
+pm.find_user_password('test',
+  pycompat.strurl(u
 except error.Abort:
 print('','abort')
 
 if not urls:
 urls = [
-'http://example.org/foo',
-'http://example.org/foo/bar',
-'http://example.org/bar',
-'https://example.org/foo',
-'https://example.org/foo/bar',
-'https://example.org/bar',
-'https://x...@example.org/bar',
-'https://y...@example.org/bar',
+b'http://example.org/foo',
+b'http://example.org/foo/bar',
+b'http://example.org/bar',
+b'https://example.org/foo',
+b'https://example.org/foo/bar',
+b'https://example.org/bar',
+b'https://x...@example.org/bar',
+b'https://y...@example.org/bar',
 ]
 for u in urls:
 _test(u)
 
 
 print('\n*** Test in-uri schemes\n')
-test({'x.prefix': 'http://example.org'})
-test({'x.prefix': 'https://example.org'})
-test({'x.prefix': 'http://example.org', 'x.schemes': 'https'})
-test({'x.prefix': 'https://example.org', 'x.schemes': 'http'})
+test({b'x.prefix': b'http://example.org'})
+test({b'x.prefix': b'https://example.org'})
+test({b'x.prefix': b'http://example.org', b'x.schemes': b'https'})
+test({b'x.prefix': b'https://example.org', b'x.schemes': b'http'})
 
 print('\n*** Test separately configured schemes\n')
-test({'x.prefix': 'example.org', 'x.schemes': 'http'})
-test({'x.prefix': 'example.org', 'x.schemes': 'https'})
-test({'x.prefix': 'example.org', 'x.schemes': 'http https'})
+test({b'x.prefix': b'example.org', b'x.schemes': b'http'})
+test({b'x.prefix': b'example.org', b'x.schemes': b'https'})
+test({b'x.prefix': b'example.org', b'x.schemes': b'http https'})
 
 print('\n*** Test prefix matching\n')
-test({'x.prefix': 'http://example.org/foo',
-  'y.prefix': 'http://example.org/bar'})
-test({'x.prefix': 'http://example.org/foo',
-  'y.prefix': 'http://example.org/foo/bar'})
-test({'x.prefix': '*', 'y.prefix': 'https://example.org/bar'})
+test({b'x.prefix': b'http://example.org/foo',
+  b'y.prefix': b'http://example.org/bar'})
+test({b'x.prefix': b'http://example.org/foo',
+  b'y.prefix': b'http://example.org/foo/bar'})
+test({b'x.prefix': b'*', b'y.prefix': b'https://example.org/bar'})
 
 print('\n*** Test user matching\n')
-test({'x.prefix': 'http://example.org/foo',
-  'x.username': None,
-  'x.password': 'xpassword'},
- urls=['http://y...@example.org/foo'])
-test({'x.prefix': 'http://example.org/foo',
-  'x.username': None,
-  'x.password': 'xpassword',
-  'y.prefix': 'http://example.org/foo',
-  'y.username': 'y',
-  'y.password': 'ypassword'},
- urls=['http://y...@example.org/foo'])
-test({'x.prefix': 

D5735: url: convert some variables back to bytes

2019-01-29 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd437d1e2a711: url: convert some variables back to bytes 
(authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5735?vs=13550=13557

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

AFFECTED FILES
  mercurial/url.py

CHANGE DETAILS

diff --git a/mercurial/url.py b/mercurial/url.py
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -62,6 +62,7 @@
 assert isinstance(authuri, str)
 authinfo = self.passwddb.find_user_password(realm, authuri)
 user, passwd = authinfo
+user, passwd = pycompat.bytesurl(user), pycompat.bytesurl(passwd)
 if user and passwd:
 self._writedebug(user, passwd)
 return (user, passwd)



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


D5734: url: add some defensive asserts on expected incoming types

2019-01-29 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGbc776c31c093: url: add some defensive asserts on expected 
incoming types (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5734?vs=13549=13556

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

AFFECTED FILES
  mercurial/url.py

CHANGE DETAILS

diff --git a/mercurial/url.py b/mercurial/url.py
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -58,6 +58,8 @@
 return self.passwddb.add_password(realm, uri, user, passwd)
 
 def find_user_password(self, realm, authuri):
+assert isinstance(realm, (type(None), str))
+assert isinstance(authuri, str)
 authinfo = self.passwddb.find_user_password(realm, authuri)
 user, passwd = authinfo
 if user and passwd:



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


D5736: tests: port test-hgweb-auth.py to Python 3

2019-01-29 Thread indygreg (Gregory Szorc)
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  Excellent! I had poked at this test a few days ago without much luck. Your 
solutions are much cleaner.

REPOSITORY
  rHG Mercurial

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

To: durin42, pulkit, #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


D5732: changegroup: initialize the state variable a bit earlier

2019-01-29 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG73a33fe625bb: changegroup: initialize the state variable a 
bit earlier (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5732?vs=13545=13554

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

AFFECTED FILES
  mercurial/changegroup.py

CHANGE DETAILS

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -930,6 +930,13 @@
 changedfiles = set()
 clrevtomanifestrev = {}
 
+state = {
+'clrevorder': clrevorder,
+'manifests': manifests,
+'changedfiles': changedfiles,
+'clrevtomanifestrev': clrevtomanifestrev,
+}
+
 # Callback for the changelog, used to collect changed files and
 # manifest nodes.
 # Returns the linkrev node (identity in the changelog case).
@@ -970,13 +977,6 @@
 
 return x
 
-state = {
-'clrevorder': clrevorder,
-'manifests': manifests,
-'changedfiles': changedfiles,
-'clrevtomanifestrev': clrevtomanifestrev,
-}
-
 gen = deltagroup(
 self._repo, cl, nodes, True, lookupcl,
 self._forcedeltaparentprev,



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


D5717: tests: conditionalize test output on Python 3.7

2019-01-29 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd5357238eda9: tests: conditionalize test output on Python 
3.7 (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5717?vs=13510=13553

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

AFFECTED FILES
  tests/test-static-http.t

CHANGE DETAILS

diff --git a/tests/test-static-http.t b/tests/test-static-http.t
--- a/tests/test-static-http.t
+++ b/tests/test-static-http.t
@@ -227,9 +227,11 @@
   /.hg/requires
   /.hg/store/00changelog.i
   /.hg/store/00manifest.i
-  /.hg/store/data/%7E2ehgsub.i
-  /.hg/store/data/%7E2ehgsubstate.i
+  /.hg/store/data/%7E2ehgsub.i (no-py37 !)
+  /.hg/store/data/%7E2ehgsubstate.i (no-py37 !)
   /.hg/store/data/a.i
+  /.hg/store/data/~2ehgsub.i (py37 !)
+  /.hg/store/data/~2ehgsubstate.i (py37 !)
   /notarepo/.hg/00changelog.i
   /notarepo/.hg/requires
   /remote-with-names/.hg/bookmarks
@@ -243,8 +245,9 @@
   /remote-with-names/.hg/requires
   /remote-with-names/.hg/store/00changelog.i
   /remote-with-names/.hg/store/00manifest.i
-  /remote-with-names/.hg/store/data/%7E2ehgtags.i
+  /remote-with-names/.hg/store/data/%7E2ehgtags.i (no-py37 !)
   /remote-with-names/.hg/store/data/foo.i
+  /remote-with-names/.hg/store/data/~2ehgtags.i (py37 !)
   /remote/.hg/bookmarks
   /remote/.hg/bookmarks.current
   /remote/.hg/cache/branch2-base
@@ -258,10 +261,12 @@
   /remote/.hg/requires
   /remote/.hg/store/00changelog.i
   /remote/.hg/store/00manifest.i
-  /remote/.hg/store/data/%7E2edotfile%20with%20spaces.i
-  /remote/.hg/store/data/%7E2ehgtags.i
+  /remote/.hg/store/data/%7E2edotfile%20with%20spaces.i (no-py37 !)
+  /remote/.hg/store/data/%7E2ehgtags.i (no-py37 !)
   /remote/.hg/store/data/bar.i
   /remote/.hg/store/data/quux.i
+  /remote/.hg/store/data/~2edotfile%20with%20spaces.i (py37 !)
+  /remote/.hg/store/data/~2ehgtags.i (py37 !)
   /remotempty/.hg/bookmarks
   /remotempty/.hg/bookmarks.current
   /remotempty/.hg/requires
@@ -275,5 +280,6 @@
   /sub/.hg/requires
   /sub/.hg/store/00changelog.i
   /sub/.hg/store/00manifest.i
-  /sub/.hg/store/data/%7E2ehgtags.i
+  /sub/.hg/store/data/%7E2ehgtags.i (no-py37 !)
   /sub/.hg/store/data/test.i
+  /sub/.hg/store/data/~2ehgtags.i (py37 !)



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


D5088: hghave: add pyXY features for Python version numbers

2019-01-29 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1a6a01a21d6a: hghave: add pyXY features for Python version 
numbers (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5088?vs=13509=13552

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

AFFECTED FILES
  tests/hghave.py

CHANGE DETAILS

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -646,6 +646,13 @@
 # chg disables demandimport intentionally for performance wins.
 return ((not has_chg()) and os.environ.get('HGDEMANDIMPORT') != 'disable')
 
+@checkvers("py", "Python >= %s", (2.7, 3.5, 3.6, 3.7, 3.8, 3.9))
+def has_python_range(v):
+major, minor = v.split('.')[0:2]
+py_major, py_minor = sys.version_info.major, sys.version_info.minor
+
+return (py_major, py_minor) >= (int(major), int(minor))
+
 @check("py3", "running with Python 3.x")
 def has_py3():
 return 3 == sys.version_info[0]



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


D5088: hghave: add pyXY features for Python version numbers

2019-01-29 Thread durin42 (Augie Fackler)
durin42 added a comment.


  I still don't love this, but I'm landing it to make forward progress on 3.7. 
:/

REPOSITORY
  rHG Mercurial

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

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


D5736: tests: port test-hgweb-auth.py to Python 3

2019-01-29 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: pulkit.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/python3-whitelist
  tests/test-hgweb-auth.py

CHANGE DETAILS

diff --git a/tests/test-hgweb-auth.py b/tests/test-hgweb-auth.py
--- a/tests/test-hgweb-auth.py
+++ b/tests/test-hgweb-auth.py
@@ -24,123 +24,136 @@
 def writeauth(items):
 ui = origui.copy()
 for name, value in items.items():
-ui.setconfig('auth', name, value)
+ui.setconfig(b'auth', name, value)
 return ui
 
+def _stringifyauthinfo(ai):
+if ai is None:
+return ai
+realm, authuris, user, passwd = ai
+return (pycompat.strurl(realm),
+[pycompat.strurl(u) for u in authuris],
+pycompat.strurl(user),
+pycompat.strurl(passwd),
+)
+
 def test(auth, urls=None):
 print('CFG:', pycompat.sysstr(stringutil.pprint(auth, bprefix=True)))
 prefixes = set()
 for k in auth:
-prefixes.add(k.split('.', 1)[0])
+prefixes.add(k.split(b'.', 1)[0])
 for p in prefixes:
-for name in ('.username', '.password'):
+for name in (b'.username', b'.password'):
 if (p + name) not in auth:
 auth[p + name] = p
 auth = dict((k, v) for k, v in auth.items() if v is not None)
 
 ui = writeauth(auth)
 
 def _test(uri):
-print('URI:', uri)
+print('URI:', pycompat.strurl(uri))
 try:
 pm = url.passwordmgr(ui, urlreq.httppasswordmgrwithdefaultrealm())
 u, authinfo = util.url(uri).authinfo()
 if authinfo is not None:
-pm.add_password(*authinfo)
-print('', pm.find_user_password('test', u))
+pm.add_password(*_stringifyauthinfo(authinfo))
+print('', tuple(pycompat.strurl(a) for a in
+pm.find_user_password('test',
+  pycompat.strurl(u
 except error.Abort:
 print('','abort')
 
 if not urls:
 urls = [
-'http://example.org/foo',
-'http://example.org/foo/bar',
-'http://example.org/bar',
-'https://example.org/foo',
-'https://example.org/foo/bar',
-'https://example.org/bar',
-'https://x...@example.org/bar',
-'https://y...@example.org/bar',
+b'http://example.org/foo',
+b'http://example.org/foo/bar',
+b'http://example.org/bar',
+b'https://example.org/foo',
+b'https://example.org/foo/bar',
+b'https://example.org/bar',
+b'https://x...@example.org/bar',
+b'https://y...@example.org/bar',
 ]
 for u in urls:
 _test(u)
 
 
 print('\n*** Test in-uri schemes\n')
-test({'x.prefix': 'http://example.org'})
-test({'x.prefix': 'https://example.org'})
-test({'x.prefix': 'http://example.org', 'x.schemes': 'https'})
-test({'x.prefix': 'https://example.org', 'x.schemes': 'http'})
+test({b'x.prefix': b'http://example.org'})
+test({b'x.prefix': b'https://example.org'})
+test({b'x.prefix': b'http://example.org', b'x.schemes': b'https'})
+test({b'x.prefix': b'https://example.org', b'x.schemes': b'http'})
 
 print('\n*** Test separately configured schemes\n')
-test({'x.prefix': 'example.org', 'x.schemes': 'http'})
-test({'x.prefix': 'example.org', 'x.schemes': 'https'})
-test({'x.prefix': 'example.org', 'x.schemes': 'http https'})
+test({b'x.prefix': b'example.org', b'x.schemes': b'http'})
+test({b'x.prefix': b'example.org', b'x.schemes': b'https'})
+test({b'x.prefix': b'example.org', b'x.schemes': b'http https'})
 
 print('\n*** Test prefix matching\n')
-test({'x.prefix': 'http://example.org/foo',
-  'y.prefix': 'http://example.org/bar'})
-test({'x.prefix': 'http://example.org/foo',
-  'y.prefix': 'http://example.org/foo/bar'})
-test({'x.prefix': '*', 'y.prefix': 'https://example.org/bar'})
+test({b'x.prefix': b'http://example.org/foo',
+  b'y.prefix': b'http://example.org/bar'})
+test({b'x.prefix': b'http://example.org/foo',
+  b'y.prefix': b'http://example.org/foo/bar'})
+test({b'x.prefix': b'*', b'y.prefix': b'https://example.org/bar'})
 
 print('\n*** Test user matching\n')
-test({'x.prefix': 'http://example.org/foo',
-  'x.username': None,
-  'x.password': 'xpassword'},
- urls=['http://y...@example.org/foo'])
-test({'x.prefix': 'http://example.org/foo',
-  'x.username': None,
-  'x.password': 'xpassword',
-  'y.prefix': 'http://example.org/foo',
-  'y.username': 'y',
-  'y.password': 'ypassword'},
- urls=['http://y...@example.org/foo'])
-test({'x.prefix': 'http://example.org/foo/bar',
-  'x.username': None,
-  'x.password': 'xpassword',
-  'y.prefix': 'http://example.org/foo',

D5735: url: convert some variables back to bytes

2019-01-29 Thread durin42 (Augie Fackler)
durin42 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/D5735

AFFECTED FILES
  mercurial/url.py

CHANGE DETAILS

diff --git a/mercurial/url.py b/mercurial/url.py
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -62,6 +62,7 @@
 assert isinstance(authuri, str)
 authinfo = self.passwddb.find_user_password(realm, authuri)
 user, passwd = authinfo
+user, passwd = pycompat.bytesurl(user), pycompat.bytesurl(passwd)
 if user and passwd:
 self._writedebug(user, passwd)
 return (user, passwd)



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


[Bug 6064] New: `hg tracked --addinclude` does not work.

2019-01-29 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6064

Bug ID: 6064
   Summary: `hg tracked --addinclude` does not work.
   Product: Mercurial
   Version: 4.8
  Hardware: PC
OS: Windows
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: 7895pul...@gmail.com
CC: mercurial-devel@mercurial-scm.org

Errors out with the following traceback:

```
searching for changes
adding changesets
adding manifests
adding file changes
added 0 changesets with 218 changes to 163 files
Traceback (most recent call last):
  File "contrib/python/hg/mercurial/scmutil.py", line 166, in callcatch
return func()
  File "contrib/python/hg/mercurial/dispatch.py", line 359, in _runcatchfunc
return _dispatch(req)
  File "contrib/python/hg/mercurial/dispatch.py", line 1006, in _dispatch
cmdpats, cmdoptions)
  File "contrib/python/hg/mercurial/dispatch.py", line 748, in runcommand
ret = _runcommand(ui, options, cmd, d)
  File "contrib/python/hg/mercurial/dispatch.py", line 1015, in _runcommand
return cmdfunc()
  File "contrib/python/hg/mercurial/dispatch.py", line 1003, in 
d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "contrib/python/hg/mercurial/util.py", line 1644, in check
return func(*args, **kwargs)
  File "contrib/python/hg/hgext/narrow/narrowcommands.py", line 469, in
trackedcmd
newincludes, newexcludes)
  File "contrib/python/hg/hgext/narrow/narrowcommands.py", line 317, in _widen
mf = repo['.'].manifest().matches(newmatch)
  File "contrib/python/hg/mercurial/manifest.py", line 1074, in matches
return self._matches(match)
  File "contrib/python/hg/mercurial/manifest.py", line 1109, in _matches
m = subm._matches(match)
  File "contrib/python/hg/mercurial/manifest.py", line 1110, in _matches
if not m._isempty():
  File "contrib/python/hg/mercurial/manifest.py", line 771, in _isempty
self._load() # for consistency; already loaded by all callers
  File "contrib/python/hg/mercurial/manifest.py", line 938, in _load
cf(self)
  File "contrib/python/hg/mercurial/manifest.py", line 959, in _copyfunc
self._load()
  File "contrib/python/hg/mercurial/manifest.py", line 935, in _load
lf(self)
  File "contrib/python/hg/mercurial/manifest.py", line 1215, in _load_for_read
s.parse(gettext(), readsubtree)
  File "contrib/python/hg/mercurial/manifest.py", line 1883, in gettext
return store.revision(self._node)
  File "contrib/python/hg/mercurial/manifest.py", line 1565, in revision
return self._revlog.revision(node, _df=_df, raw=raw)
  File "contrib/python/hg/mercurial/revlog.py", line 1571, in revision
rev = self.rev(node)
  File "contrib/python/hg/mercurial/revlog.py", line 578, in rev
raise error.LookupError(node, self.indexfile, _('no node'))
LookupError: meta/f1/f2/00manifest.i@abcdef123456: no node
abort: meta/f1/f2/00manifest.i@abcdef123456: no node!
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 2 V2] perf: add a perfnodemap command

2019-01-29 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1548460545 18000
#  Fri Jan 25 18:55:45 2019 -0500
# Node ID 3414a69b2e99e8fa605f63f9973894c80dd144b3
# Parent  7eb7637e34bf412374a165fbd234022a5a804683
# EXP-Topic perf-ext
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
3414a69b2e99
perf: add a perfnodemap command

The command focus on timing of the nodemap object itself.

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -1036,7 +1036,8 @@ def perfindex(ui, repo, **opts):
 * -1:
 * -1: + 0
 
-It is not currently possible to check for lookup of a missing node."""
+It is not currently possible to check for lookup of a missing node. For
+deeper lookup benchmarking, checkout the `perfnodemap` command."""
 import mercurial.revlog
 opts = _byteskwargs(opts)
 timer, fm = gettimer(ui, opts)
@@ -1066,6 +1067,58 @@ def perfindex(ui, repo, **opts):
 timer(d, setup=setup)
 fm.end()
 
+@command(b'perfnodemap', [
+(b'', b'rev', [], b'revision to be looked up (default tip)'),
+] + formatteropts)
+def perfnodemap(ui, repo, **opts):
+"""benchmark the time necessary to look up revision from a cold nodemap
+
+Depending on the implementation, the amount and order of revision we look
+up can varies. Example of useful set to test:
+* tip
+* 0
+* -10:
+* :10
+* -10: + :10
+* :10: + -10:
+* -1:
+* -1: + 0
+
+The command currently focus on valid binary lookup. Benchmarking for
+hexlookup, prefix lookup and missing lookup would also be valuable.
+"""
+import mercurial.revlog
+opts = _byteskwargs(opts)
+timer, fm = gettimer(ui, opts)
+mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg
+
+unfi = repo.unfiltered()
+# find the filecache func directly
+# This avoid polluting the benchmark with the filecache logic
+makecl = unfi.__class__.changelog.func
+if not opts[b'rev']:
+raise error.Abort('use --rev to specify revisions to look up')
+revs = scmutil.revrange(repo, opts[b'rev'])
+cl = repo.changelog
+nodes = [cl.node(r) for r in revs]
+
+# use a list to pass reference to a nodemap from one closure to the next
+nodeget = [None]
+def setnodeget():
+# probably not necessary, but for good measure
+clearchangelog(unfi)
+nodeget[0] = makecl(unfi).nodemap.get
+
+def setup():
+setnodeget()
+def d():
+get = nodeget[0]
+for n in nodes:
+get(n)
+
+timer(d, setup=setup)
+fm.end()
+
 @command(b'perfstartup', formatteropts)
 def perfstartup(ui, repo, **opts):
 opts = _byteskwargs(opts)
diff --git a/tests/test-contrib-perf.t b/tests/test-contrib-perf.t
--- a/tests/test-contrib-perf.t
+++ b/tests/test-contrib-perf.t
@@ -109,6 +109,8 @@ perfstatus
perfmoonwalk  benchmark walking the changelog backwards
perfnodelookup
  (no help text available)
+   perfnodemap   benchmark the time necessary to look up revision from a cold
+ nodemap
perfparents   (no help text available)
perfpathcopies
  benchmark the copy tracing logic
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 2 V2] perf: add a --[no-]clear-caches option to `perfnodemap`

2019-01-29 Thread Boris Feld
# HG changeset patch
# User Boris Feld 
# Date 1548664893 18000
#  Mon Jan 28 03:41:33 2019 -0500
# Node ID 4ecd8c3fa0df874dcae358025c160b0bbbaf57d1
# Parent  3414a69b2e99e8fa605f63f9973894c80dd144b3
# EXP-Topic perf-ext
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
4ecd8c3fa0df
perf: add a --[no-]clear-caches option to `perfnodemap`

The option is useful to look at pure lookup performance on a warm data
structure.

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -1068,7 +1068,8 @@ def perfindex(ui, repo, **opts):
 fm.end()
 
 @command(b'perfnodemap', [
-(b'', b'rev', [], b'revision to be looked up (default tip)'),
+  (b'', b'rev', [], b'revision to be looked up (default tip)'),
+  (b'', b'clear-caches', True, b'clear revlog cache between calls'),
 ] + formatteropts)
 def perfnodemap(ui, repo, **opts):
 """benchmark the time necessary to look up revision from a cold nodemap
@@ -1093,6 +1094,7 @@ def perfnodemap(ui, repo, **opts):
 mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg
 
 unfi = repo.unfiltered()
+clearcaches = opts['clear_caches']
 # find the filecache func directly
 # This avoid polluting the benchmark with the filecache logic
 makecl = unfi.__class__.changelog.func
@@ -1109,13 +,18 @@ def perfnodemap(ui, repo, **opts):
 clearchangelog(unfi)
 nodeget[0] = makecl(unfi).nodemap.get
 
-def setup():
-setnodeget()
 def d():
 get = nodeget[0]
 for n in nodes:
 get(n)
 
+setup = None
+if clearcaches:
+def setup():
+setnodeget()
+else:
+setnodeget()
+d() # prewarm the data structure
 timer(d, setup=setup)
 fm.end()
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Stop bugzilla bot from marking issues as "RESOLVED ARCHIVED".

2019-01-29 Thread Pulkit Goyal
Hey everyone,

I am quite annoyed by the bugzilla bot marking inactive issues as RESOLVED
ARCHIVED. Following are the reasons why I want the bot should be stopped to
do that.

1) Handful of issues only live in a state of bot marking that as "resolved
archived" and then author marking that as "CONFIRMED" again. This goes on
until author of the issues decides to surrender. This is not a good UX.

2) Hides bugs. There are some existing bugs which are marked as "RESOLVED
ARCHIVED" because nobody looked at them when they was filed. This does not
mean that nobody will look at them or need them. Having a bug active helps
in:
  * Looking for existing bugs in a certain component. For example, I want
to try narrow, and there are let's say 2 bugs related to narrow with
"RESOLVED ARCHIVED" state, it won't be obvious for me to look for bugs in
that state. Also I might hit the bug again in future.
  * With programmes like summer of code, we have few new contributors
coming every year. Or there are people who just want to contribute, having
those bugs there might help to them.

3) It's harmless. I don't see an harm in having those bug remained open.

Thanks and regards
Pulkit
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5720: keepalive: implement _close_conn() so closes are known

2019-01-29 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG44d752efdbce: keepalive: implement _close_conn() so closes 
are known (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5720?vs=13519=13547

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

AFFECTED FILES
  mercurial/keepalive.py

CHANGE DETAILS

diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py
--- a/mercurial/keepalive.py
+++ b/mercurial/keepalive.py
@@ -403,14 +403,22 @@
 _raw_read = httplib.HTTPResponse.read
 _raw_readinto = getattr(httplib.HTTPResponse, 'readinto', None)
 
+# Python 2.7 has a single close() which closes the socket handle.
+# This method was effectively renamed to _close_conn() in Python 3. But
+# there is also a close(). _close_conn() is called by methods like
+# read().
+
 def close(self):
 if self.fp:
 self.fp.close()
 self.fp = None
 if self._handler:
 self._handler._request_closed(self, self._host,
   self._connection)
 
+def _close_conn(self):
+self.close()
+
 def close_connection(self):
 self._handler._remove_connection(self._host, self._connection, close=1)
 self.close()



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


D5731: py3: whitelist couple more passing tests found by buildbot

2019-01-29 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe7fcbeb95249: py3: whitelist couple more passing tests 
found by buildbot (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5731?vs=13544=13548

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

AFFECTED FILES
  contrib/python3-whitelist

CHANGE DETAILS

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -122,6 +122,7 @@
 test-convert-splicemap.t
 test-convert-svn-sink.t
 test-convert-tagsbranch-topology.t
+test-convert.t
 test-copy-move-merge.t
 test-copy.t
 test-copytrace-heuristics.t
@@ -155,6 +156,7 @@
 test-dirstate-race.t
 test-dirstate.t
 test-dispatch.py
+test-dispatch.t
 test-doctest.py
 test-double-merge.t
 test-drawdag.t



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


[Bug 6063] New: `hg update` on windows says "The system cannot find specified path"

2019-01-29 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6063

Bug ID: 6063
   Summary: `hg update` on windows says "The system cannot find
specified path"
   Product: Mercurial
   Version: unspecified
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: 7895pul...@gmail.com
CC: mercurial-devel@mercurial-scm.org

`hg update` on a new cloned repository aborts saying "The system cannot find
the specified path".

Following is the traceback:

```
Traceback (most recent call last):
  File "contrib/python/hg/mercurial/scmutil.py", line 166, in callcatch
return func()
  File "contrib/python/hg/mercurial/dispatch.py", line 359, in _runcatchfunc
return _dispatch(req)
  File "contrib/python/hg/mercurial/dispatch.py", line 1006, in _dispatch
cmdpats, cmdoptions)
  File "contrib/python/hg/mercurial/dispatch.py", line 748, in runcommand
ret = _runcommand(ui, options, cmd, d)
  File "contrib/python/hg/mercurial/dispatch.py", line 1015, in _runcommand
return cmdfunc()
  File "contrib/python/hg/mercurial/dispatch.py", line 1003, in 
d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "contrib/python/hg/mercurial/util.py", line 1644, in check
return func(*args, **kwargs)
  File "contrib/python/hg/mercurial/commands.py", line 6094, in update
updatecheck=updatecheck)
  File "vcs/hg/client/hgext3rd/narrowupdate.py", line 31, in wrapupdatetotally
ret = orig(ui, repo, checkout, brev, **opts)
  File "contrib/python/hg/mercurial/hg.py", line 921, in updatetotally
ret = _update(repo, checkout, updatecheck=updatecheck)
  File "contrib/python/hg/mercurial/hg.py", line 858, in update
stats = updaterepo(repo, node, False, updatecheck=updatecheck)
  File "contrib/python/hg/mercurial/hg.py", line 854, in updaterepo
updatecheck=updatecheck)
  File "contrib/python/hg/mercurial/extensions.py", line 417, in closure
return func(*(args + a), **kw)
  File "contrib/python/hg/hgext/fsmonitor/__init__.py", line 753, in wrapupdate
labels, matcher, **kwargs)
  File "contrib/python/hg/mercurial/merge.py", line 2178, in update
stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels)
  File "contrib/python/hg/mercurial/merge.py", line 1646, in applyupdates
for i, item in prog:
  File "contrib/python/hg/mercurial/merge.py", line 1510, in batchget
atomictemp=atomictemp)
  File "contrib/python/hg/mercurial/context.py", line 1668, in write
**kwargs)
  File "contrib/python/hg/mercurial/localrepo.py", line 1662, in wwrite
**kwargs)
  File "contrib/python/hg/mercurial/vfs.py", line 86, in write
with self(path, 'wb', backgroundclose=backgroundclose, **kwargs) as fp:
  File "contrib/python/hg/mercurial/vfs.py", line 413, in __call__
fp = util.posixfile(f, mode)
  File "contrib/python/hg/mercurial/windows.py", line 168, in posixfile
encoding.strfromlocal(name), err.strerror))
IOError: [Errno 2] : The system cannot find the path specified
abort: : The system cannot find the path specified
```

Happens with both workers enabled and disabled. I am using command prompt in
windows.

Interesting thing is  is of the form:

"D:\SRC\pulkit\repo_root\some_folder_in_repo/subfolder/subfolder2/some_file"

The path is shortened up. The interesting part is that the path initially has
'\' and then has '/' as separator.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5732: changegroup: initialize the state variable a bit earlier

2019-01-29 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This will make the next patch much easier.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/changegroup.py

CHANGE DETAILS

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -930,6 +930,13 @@
 changedfiles = set()
 clrevtomanifestrev = {}
 
+state = {
+'clrevorder': clrevorder,
+'manifests': manifests,
+'changedfiles': changedfiles,
+'clrevtomanifestrev': clrevtomanifestrev,
+}
+
 # Callback for the changelog, used to collect changed files and
 # manifest nodes.
 # Returns the linkrev node (identity in the changelog case).
@@ -970,13 +977,6 @@
 
 return x
 
-state = {
-'clrevorder': clrevorder,
-'manifests': manifests,
-'changedfiles': changedfiles,
-'clrevtomanifestrev': clrevtomanifestrev,
-}
-
 gen = deltagroup(
 self._repo, cl, nodes, True, lookupcl,
 self._forcedeltaparentprev,



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 V3] extdiff: add --per-file and --confirm options

2019-01-29 Thread Yuya Nishihara
On Mon, 28 Jan 2019 08:50:28 -0800, Ludovic Chabant wrote:
> > I do understand however that it would be easy for users to get in a 
> > messy situation so I guess I'll add a "--batch" option to "--per-file" 
> > if that's OK?
> 
> Another way to solve this would be to actually default to "--prompt" when 
> "--per-file" is specified, and require "--no-prompt" if you want the "batch 
> fire processes" mode for tools like Meld or BeyondCompare. It looks like 
> that's how Git does it, and that would save us an option, which I like.

My point was that it could be addressed by checking the gui flag (or adding
new dedicated flag to [diff/merge-tools].) It's a tool property whether
multiple processes can be spawned or not.

Anyway, I think it's better to finish the core --per-file/--(prompt|confirm)
feature first, and add some mitigation for this problem later.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH STABLE] revlog: make sure we never use sparserevlog without general delta (issue6056)

2019-01-29 Thread Yuya Nishihara
On Tue, 29 Jan 2019 09:25:34 +0100, Mathias De Maré wrote:
> On Mon, Jan 28, 2019 at 1:21 PM Yuya Nishihara  wrote:
> > On Fri, 25 Jan 2019 15:00:52 -0500, Boris Feld wrote:
> > > # HG changeset patch
> > > # User Boris Feld 
> > > # Date 1548372167 18000
> > > #  Thu Jan 24 18:22:47 2019 -0500
> > > # Branch stable
> > > # Node ID c7661fdcaeac457aa5b8ae6b6a10b259713934b9
> > > # Parent  26ee61c33dee366576a0f7266fea9834985e78ec
> > > # EXP-Topic issue6056
> > > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > > #  hg pull https://bitbucket.org/octobus/mercurial-devel/
> > -r c7661fdcaeac
> > > revlog: make sure we never use sparserevlog without general delta
> > (issue6056)
> > >
> > > We are getting user report where the delta code tries to use
> > `sparse-revlog`
> > > logic on repository where `generaldelta` is disabled. This can't work so
> > we
> > > ensure the two booleans have a consistent value.
> > >
> > > Creating this kind of repository is not expected to be possible and we
> > weren't
> > > able to create one for testing purpose. But if users run into this, we
> > better
> > > put stronger protection.
> >
> > Mathias, do you have any idea how the broken repository could be created?
> >
> 
> I think the issue might be related to our use of streaming clonebundles and
> a mismatch between some repositories on our server.
> For one specific repository, I see on the server that .hg/requires contains
> "revlogv1 store fncache dotencode".
> On the client that cloned (and cannot commit), the requires contains:
> "dotencode fncache generaldelta revlogv1 sparserevlog store"

That makes sense, thanks.

The problem could be reproduced by adding --config format.usegeneraldelta=0
--config format.sparse-revlog=0 to test-clonebundles.t.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D4783: narrow: add 'narrowstream' server capability to use streamclones with narrow

2019-01-29 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  Abandoning this stack as narrow stream clones were implemented using 
streamclone v2.

REPOSITORY
  rHG Mercurial

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

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


Re: [PATCH STABLE] revlog: make sure we never use sparserevlog without general delta (issue6056)

2019-01-29 Thread Yuya Nishihara
On Mon, 28 Jan 2019 21:20:07 +0900, Yuya Nishihara wrote:
> On Fri, 25 Jan 2019 15:00:52 -0500, Boris Feld wrote:
> > # HG changeset patch
> > # User Boris Feld 
> > # Date 1548372167 18000
> > #  Thu Jan 24 18:22:47 2019 -0500
> > # Branch stable
> > # Node ID c7661fdcaeac457aa5b8ae6b6a10b259713934b9
> > # Parent  26ee61c33dee366576a0f7266fea9834985e78ec
> > # EXP-Topic issue6056
> > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
> > c7661fdcaeac
> > revlog: make sure we never use sparserevlog without general delta 
> > (issue6056)
> > 
> > We are getting user report where the delta code tries to use `sparse-revlog`
> > logic on repository where `generaldelta` is disabled. This can't work so we
> > ensure the two booleans have a consistent value.
> > 
> > Creating this kind of repository is not expected to be possible and we 
> > weren't
> > able to create one for testing purpose. But if users run into this, we 
> > better
> > put stronger protection.

> > --- a/mercurial/revlog.py
> > +++ b/mercurial/revlog.py
> > @@ -497,6 +497,9 @@ class revlog(object):
> >  else:
> >  raise error.RevlogError(_('unknown version (%d) in revlog %s') 
> > %
> >  (fmt, self.indexfile))
> > +# sparse-revlog can't be on without general-delta (issue6056)
> > +if not self._generaldelta:
> > +self._sparserevlog = False
> 
> Maybe this can be handled at localrepo.ensurerequirements*() or
> esolverevlogstorevfsoptions(), where ui is available so we can add
> some debug/warning messages.

Okay, it doesn't work since generaldelta is a revlog flag, whereas sparserevlog
is a global requirement. I don't know if sparserevlog should be a revlog flag
or not, but anyway only thing we can do here is to turn off the sparse, as your
patch does.

Can you add some tests with crafted repo?

Also, I noticed format.sparse-revlog isn't documented. Since it's incompatible
with older versions, it needs some doc.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D5731: py3: whitelist couple more passing tests found by buildbot

2019-01-29 Thread pulkit (Pulkit Goyal)
pulkit 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/D5731

AFFECTED FILES
  contrib/python3-whitelist

CHANGE DETAILS

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -122,6 +122,7 @@
 test-convert-splicemap.t
 test-convert-svn-sink.t
 test-convert-tagsbranch-topology.t
+test-convert.t
 test-copy-move-merge.t
 test-copy.t
 test-copytrace-heuristics.t
@@ -155,6 +156,7 @@
 test-dirstate-race.t
 test-dirstate.t
 test-dispatch.py
+test-dispatch.t
 test-doctest.py
 test-double-merge.t
 test-drawdag.t



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] lfs: explicitly add the Content-Length header when uploading blobs, for py3

2019-01-29 Thread Yuya Nishihara
On Mon, 28 Jan 2019 21:48:49 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1548729306 18000
> #  Mon Jan 28 21:35:06 2019 -0500
> # Node ID 1bc01490178a97d4af903c87581bc270362bc079
> # Parent  7eb7637e34bf412374a165fbd234022a5a804683
> lfs: explicitly add the Content-Length header when uploading blobs, for py3

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


Re: [PATCH STABLE] revlog: make sure we never use sparserevlog without general delta (issue6056)

2019-01-29 Thread Mathias De Maré
On Mon, Jan 28, 2019 at 1:21 PM Yuya Nishihara  wrote:

> On Fri, 25 Jan 2019 15:00:52 -0500, Boris Feld wrote:
> > # HG changeset patch
> > # User Boris Feld 
> > # Date 1548372167 18000
> > #  Thu Jan 24 18:22:47 2019 -0500
> > # Branch stable
> > # Node ID c7661fdcaeac457aa5b8ae6b6a10b259713934b9
> > # Parent  26ee61c33dee366576a0f7266fea9834985e78ec
> > # EXP-Topic issue6056
> > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > #  hg pull https://bitbucket.org/octobus/mercurial-devel/
> -r c7661fdcaeac
> > revlog: make sure we never use sparserevlog without general delta
> (issue6056)
> >
> > We are getting user report where the delta code tries to use
> `sparse-revlog`
> > logic on repository where `generaldelta` is disabled. This can't work so
> we
> > ensure the two booleans have a consistent value.
> >
> > Creating this kind of repository is not expected to be possible and we
> weren't
> > able to create one for testing purpose. But if users run into this, we
> better
> > put stronger protection.
>
> Mathias, do you have any idea how the broken repository could be created?
>

I think the issue might be related to our use of streaming clonebundles and
a mismatch between some repositories on our server.
For one specific repository, I see on the server that .hg/requires contains
"revlogv1 store fncache dotencode".
On the client that cloned (and cannot commit), the requires contains:
"dotencode fncache generaldelta revlogv1 sparserevlog store"

I did an 'hg debugupgraderepo' on the server and regenerated the
clonebundle. Cloning again and committing on the client then works fine.

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