Re: [PATCH 3 of 3] hgweb: add missing semicolons to followlines.js

2017-11-10 Thread Anton Shestakov
On Fri, 10 Nov 2017 17:28:33 -0500
Augie Fackler  wrote:

> On Fri, Nov 10, 2017 at 08:39:06PM +0800, Anton Shestakov wrote:
> > # HG changeset patch
> > # User Anton Shestakov 
> > # Date 1510312446 -28800
> > #  Fri Nov 10 19:14:06 2017 +0800
> > # Node ID 981d7ebd7dc74a88493f39982649a52ed09a199b
> > # Parent  95cb67784e3c0d05e24e387acda45fd1c8aa4653
> > hgweb: add missing semicolons to followlines.js
> 
> Queued, thanks.
> 
> >
> > Minor stylistic issues caught by jshint.
> 
> Should we have some sort of test-jshint.t that can automatically run?
> or does it have lots of false positives?

Not a lot, no. And there are plenty of things to tweak:
http://jshint.com/docs/options/

Detecting its availability can be tricky though. It's not as widespread
as even pyflakes, for example there's no node-jshint package in Debian
or Ubuntu. And not everybody is fine using npm install --global (and
messing with their distro's package manager), so my guess is that most
of the time it's installed, it's installed somewhere local, which makes
it impossible to detect and use in a test.

But installing locally, putting a symlink into ~/bin and adding ~/bin
to $PATH does the trick. It's not a very user-friendly way to install a
dependency for just one test file, but it works. Patches sent.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 2] hgweb: fix jshint issues in mercurial.js

2017-11-10 Thread Anton Shestakov
# HG changeset patch
# User Anton Shestakov 
# Date 1510380878 -28800
#  Sat Nov 11 14:14:38 2017 +0800
# Node ID 36e26161d81233a8ef18e40b4198d86b23113159
# Parent  981d7ebd7dc74a88493f39982649a52ed09a199b
hgweb: fix jshint issues in mercurial.js

Everything is pretty self-explanatory except the last hunk, where jshint
complains: "Misleading line break before '||'; readers may interpret this as an
expression boundary."

There is a tweakable called "laxbreak" that allows line breaks before
operators, but I think it's fine to simply join this one line and avoid extra
config for now (we can cook up and add a sensible .jshintrc later).

diff --git a/mercurial/templates/static/mercurial.js 
b/mercurial/templates/static/mercurial.js
--- a/mercurial/templates/static/mercurial.js
+++ b/mercurial/templates/static/mercurial.js
@@ -42,13 +42,13 @@ function Graph() {
this.columns = 0;
document.getElementById('nodebgs').innerHTML = '';
document.getElementById('graphnodes').innerHTML = '';
-   }
+   };
 
this.scale = function(height) {
this.bg_height = height;
this.box_size = Math.floor(this.bg_height / 1.2);
this.cell_height = this.box_size;
-   }
+   };
 
this.setColor = function(color, bg, fg) {
 
@@ -78,7 +78,7 @@ function Graph() {
this.ctx.fillStyle = s;
return s;
 
-   }
+   };
 
this.edge = function(x0, y0, x1, y1, color, width) {
 
@@ -90,7 +90,7 @@ function Graph() {
this.ctx.lineTo(x1, y1);
this.ctx.stroke();
 
-   }
+   };
 
this.render = function(data) {
 
@@ -127,7 +127,7 @@ function Graph() {
}
 
if (start == this.columns && start > end) {
-   var fold = true;
+   fold = true;
}
 
x0 = this.cell[0] + this.box_size * start + 
this.box_size / 2;
@@ -142,8 +142,8 @@ function Graph() {
 
// Draw the revision node in the right column
 
-   column = node[0]
-   color = node[1]
+   column = node[0];
+   color = node[1];
 
radius = this.box_size / 8;
x = this.cell[0] + this.box_size * column + 
this.box_size / 2;
@@ -159,7 +159,7 @@ function Graph() {
document.getElementById('nodebgs').innerHTML += backgrounds;
document.getElementById('graphnodes').innerHTML += nodedata;
 
-   }
+   };
 
 }
 
@@ -228,7 +228,7 @@ function process_dates(parentSelector){
return shortdate(once);
}
 
-   for (unit in scales){
+   for (var unit in scales){
var s = scales[unit];
var n = Math.floor(delta / s);
if ((n >= 2) || (s == 1)){
@@ -273,7 +273,8 @@ function toggleLinewrap() {
 
 function setLinewrap(enable) {
 var nodes = document.getElementsByClassName('sourcelines');
-for (var i = 0; i < nodes.length; i++) {
+var i;
+for (i = 0; i < nodes.length; i++) {
 if (enable) {
 nodes[i].classList.add('wrap');
 } else {
@@ -282,7 +283,7 @@ function toggleLinewrap() {
 }
 
 var links = document.getElementsByClassName('linewraplink');
-for (var i = 0; i < links.length; i++) {
+for (i = 0; i < links.length; i++) {
 links[i].innerHTML = enable ? 'on' : 'off';
 }
 }
@@ -354,8 +355,7 @@ function ajaxScrollInit(urlFormat,
 
 var scrollHeight = document.documentElement.scrollHeight;
 var clientHeight = document.documentElement.clientHeight;
-var scrollTop = document.body.scrollTop
-|| document.documentElement.scrollTop;
+var scrollTop = document.body.scrollTop || 
document.documentElement.scrollTop;
 
 if (scrollHeight - (scrollTop + clientHeight) < 50) {
 updateInitiated = true;
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 2] tests: use jshint when available to check .js files

2017-11-10 Thread Anton Shestakov
# HG changeset patch
# User Anton Shestakov 
# Date 1510384041 -28800
#  Sat Nov 11 15:07:21 2017 +0800
# Node ID 42809ebcbc783e0d27385c6ea1e1731df44a4f4e
# Parent  36e26161d81233a8ef18e40b4198d86b23113159
tests: use jshint when available to check .js files

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -444,6 +444,10 @@ def has_clang_format():
 return matchoutput("clang-format --help",
br"^OVERVIEW: A tool to format C/C\+\+[^ ]+ code.")
 
+@check("jshint", "JSHint static code analysis tool")
+def has_jshint():
+return matchoutput("jshint --version 2>&1", br"jshint v")
+
 @check("pygments", "Pygments source highlighting library")
 def has_pygments():
 try:
diff --git a/tests/test-check-jshint.t b/tests/test-check-jshint.t
new file mode 100644
--- /dev/null
+++ b/tests/test-check-jshint.t
@@ -0,0 +1,12 @@
+#require test-repo jshint hg10
+
+  $ . "$TESTDIR/helpers-testrepo.sh"
+
+run jshint on all tracked files ending in .js except vendored dependencies
+
+  $ cd "`dirname "$TESTDIR"`"
+
+  $ testrepohg locate 'set:**.js' \
+  > -X mercurial/templates/static/excanvas.js \
+  > 2>/dev/null \
+  > | xargs jshint
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D1336: remove: print message for each file in verbose mode only while using `-A`

2017-11-10 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  @pavanpc Looks pretty good- just a few things that popped up in the last 
revision.

INLINE COMMENTS

> cmdutil.py:2982
> +ui.progress(_('skipping'), None)
> +ret = 1
>  else:

This will need to be protected by seeing if there are any files in modified + 
added + clean, like it was before.  Otherwise, using -A will always return non 
zero, even if it succeeded without warning cases.  Maybe hoist the 'remaining = 
...' line out of the conditional?

> test-remove.t:236
>\r (no-eol) 
> (esc)
> -  exit code: 0
> +  exit code: 1
>R foo

Here's the evidence of the exit code problem.

> test-remove.t:451
>$ rm d1/a
> -  $ hg rm --after d1
> +  $ hg rm --after   d1
>\r (no-eol) (esc)

Please avoid unnecessary changes like this.  It may seem trivial, but if 
everyone did it, it would make annotating more of a chore.

> test-remove.t:458
>\r (no-eol) 
> (esc)
> -  removing d1/a (glob)
> +  removing d1/a
> +  [1]

I don't see any reason for the glob to go away.  I suspect it may have been due 
to the exit code changing in the next line.  In general, be careful about not 
dropping these.  The test runner generally doesn't stick them in when run on 
anything but Windows, and not having them causes test failures on Windows.  
It's a work around for Windows printing 'removing d1\a' on this same line.

REPOSITORY
  rHG Mercurial

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

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


D821: unamend: move fb extension unamend to core

2017-11-10 Thread durham (Durham Goode)
durham accepted this revision.
durham added a comment.


  Overall looks good to me.  My one comment is probably not enough to block 
this going in.

INLINE COMMENTS

> uncommit.py:260
> +prednode = markers[0].prednode()
> +predctx = unfi[prednode]
> +

Might be worth doing the predecessor check in the lock as well, since the 
result of this verification could technically change between now and when the 
lock is taken.

REPOSITORY
  rHG Mercurial

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

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


Re: [PATCH] [v2] outgoing: respect ":pushurl" paths (issue5365)

2017-11-10 Thread Augie Fackler

> On Nov 10, 2017, at 18:06, Augie Fackler  wrote:
> 
> 
>> On Nov 10, 2017, at 12:21, Hollis Blanchard > > wrote:
>> 
>> Any additional comments?
> 
> Hearing nothing else from anyone, I've queued this.

Actually, this fails tests pretty badly, dropping it. Failures:

--- /home/augie/hg/tests/test-url-rev.t
+++ /home/augie/hg/tests/test-url-rev.t.err
@@ -106,6 +106,7 @@
   remote: 2 outgoing
   $ hg -q outgoing '../clone#foo'
   2:faba9097cad4
+  3:4cd725637392
   $ hg summary --remote --config paths.default='../clone#foo'
   parent: 3:4cd725637392 tip
add bar
@@ -308,6 +309,8 @@

   $ hg clone -q -r 0 . ../another
   $ hg -q outgoing '../another#default'
+  1:cd2a86ecc814
+  2:faba9097cad4
   3:4cd725637392
   4:d515801a8f3d


ERROR: test-url-rev.t output changed

--- /home/augie/hg/tests/test-histedit-outgoing.t
+++ /home/augie/hg/tests/test-histedit-outgoing.t.err
@@ -142,6 +142,8 @@
   $ hg -q outgoing -G --template '{node|short}({branch})' '../r#default'
   @  3879dc049647(default)

+  o  f26599ee3441(foo)
+
   o  652413bf663e(default)
   |
   o  e860deea161a(default)

--- /home/augie/hg/tests/test-revset-outgoing.t
+++ /home/augie/hg/tests/test-revset-outgoing.t.err
@@ -73,6 +73,7 @@
   comparing with $TESTTMP/a (glob)
   searching for changes
   2:1d4099801a4e: '3' stable
+  3:f0461977a3db: '4'

   $ hg tlog -r 'outgoing()'
   2:1d4099801a4e: '3' stable
@@ -80,6 +81,7 @@
   $ hg tout ../a#default
   comparing with ../a
   searching for changes
+  2:1d4099801a4e: '3' stable
   3:f0461977a3db: '4'

   $ hg tlog -r 'outgoing("../a#default")'
@@ -105,8 +107,7 @@
   green = ../a#default

   $ hg tout green
-  comparing with green
-  abort: repository green not found!
+  abort: repository green does not exist!
   [255]

   $ hg tlog -r 'outgoing("green")'


etc. Could you take a look and send a v3? Thanks!

>> Hollis Blanchard  
>> 
>> Mentor Graphics Emulation Division
>> On 11/03/2017 02:07 PM, Hollis Blanchard wrote:
>>> # HG changeset patch
>>> # User Hollis Blanchard  
>>> 
>>> # Date 1509731952 25200
>>> #  Fri Nov 03 10:59:12 2017 -0700
>>> # Branch stable
>>> # Node ID a952cae0303fa38d1b246561704071d41bbfa1ea
>>> # Parent  f445b10dc7fb3495d24d1c22b0996148864c77f7
>>> [v2] outgoing: respect ":pushurl" paths (issue5365)
>>> 
>>> Make 'hg outgoing' respect "paths.default:pushurl" in addition to
>>> "paths.default-push".
>>> 
>>> 'hg outgoing' has always meant "what will happen if I run 'hg push'?" and 
>>> it's
>>> still documented that way:
>>> 
>>> Show changesets not found in the specified destination repository or the
>>> default push location. These are the changesets that would be pushed if 
>>> a
>>> push was requested.
>>> 
>>> If the user uses the now-deprecated "paths.default-push" path, it continues 
>>> to
>>> work that way. However, as described at
>>> https://bz.mercurial-scm.org/show_bug.cgi?id=5365 
>>> , it doesn't behave the 
>>> same
>>> with "paths.default:pushurl".
>>> 
>>> Why does it matter? Similar to the bugzilla reporter, I have a read-only 
>>> mirror
>>> of a non-Mercurial repository:
>>> 
>>>   upstream -> imported mirror -> user clone
>>>  ^---/
>>> 
>>> Users push directly to upstream, and that content is then imported into the
>>> mirror. However, those repositories are not the same; it's possible that the
>>> mirroring has either broken completely, or an import process is running and 
>>> not
>>> yet complete. In those cases, 'hg outgoing' will list changesets that have
>>> already been pushed.
>>> 
>>> Mozilla's desired behavior described in bug 5365 can be accomplished through
>>> other means (e.g. 'hg outgoing default'), preserving the consistency and
>>> meaning of 'hg outgoing'.
>>> 
>>> diff --git a/mercurial/hg.py b/mercurial/hg.py
>>> --- a/mercurial/hg.py
>>> +++ b/mercurial/hg.py
>>> @@ -910,7 +910,11 @@ def incoming(ui, repo, source, opts):
>>>  return _incoming(display, subreporecurse, ui, repo, source, opts)
>>>  
>>>  def _outgoing(ui, repo, dest, opts):
>>> -dest = ui.expandpath(dest or 'default-push', dest or 'default')
>>> +path = ui.paths.getpath(dest, default=('default-push', 'default'))
>>> +if not path:
>>> +raise error.Abort(_('default repository not configured!'),
>>> +hint=_("see 'hg help config.paths'"))
>>> +dest = path.pushloc or path.loc
>>>  dest, branches = parseurl(dest, opts.get('branch'))
>>>  ui.status(_('comparing with %s\n') % util.hidepassword(dest))
>>>  revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev'))
>>> diff --git a/tests/test-incoming-outgoing.t b/tests/test-incoming-outgoing.t
>>> --- a/tests/test-incoming-outgoing.t
>>> +++ b/tests/test-incoming-outgoing.t
>>> @@ -491,3 +491,71 @@ incoming from empty remote repository
>>>searching for chang

Re: [PATCH] [v2] outgoing: respect ":pushurl" paths (issue5365)

2017-11-10 Thread Augie Fackler

> On Nov 10, 2017, at 12:21, Hollis Blanchard  
> wrote:
> 
> Any additional comments?

Hearing nothing else from anyone, I've queued this.
> Hollis Blanchard  
> 
> Mentor Graphics Emulation Division
> On 11/03/2017 02:07 PM, Hollis Blanchard wrote:
>> # HG changeset patch
>> # User Hollis Blanchard  
>> 
>> # Date 1509731952 25200
>> #  Fri Nov 03 10:59:12 2017 -0700
>> # Branch stable
>> # Node ID a952cae0303fa38d1b246561704071d41bbfa1ea
>> # Parent  f445b10dc7fb3495d24d1c22b0996148864c77f7
>> [v2] outgoing: respect ":pushurl" paths (issue5365)
>> 
>> Make 'hg outgoing' respect "paths.default:pushurl" in addition to
>> "paths.default-push".
>> 
>> 'hg outgoing' has always meant "what will happen if I run 'hg push'?" and 
>> it's
>> still documented that way:
>> 
>> Show changesets not found in the specified destination repository or the
>> default push location. These are the changesets that would be pushed if a
>> push was requested.
>> 
>> If the user uses the now-deprecated "paths.default-push" path, it continues 
>> to
>> work that way. However, as described at
>> https://bz.mercurial-scm.org/show_bug.cgi?id=5365 
>> , it doesn't behave the 
>> same
>> with "paths.default:pushurl".
>> 
>> Why does it matter? Similar to the bugzilla reporter, I have a read-only 
>> mirror
>> of a non-Mercurial repository:
>> 
>>   upstream -> imported mirror -> user clone
>>  ^---/
>> 
>> Users push directly to upstream, and that content is then imported into the
>> mirror. However, those repositories are not the same; it's possible that the
>> mirroring has either broken completely, or an import process is running and 
>> not
>> yet complete. In those cases, 'hg outgoing' will list changesets that have
>> already been pushed.
>> 
>> Mozilla's desired behavior described in bug 5365 can be accomplished through
>> other means (e.g. 'hg outgoing default'), preserving the consistency and
>> meaning of 'hg outgoing'.
>> 
>> diff --git a/mercurial/hg.py b/mercurial/hg.py
>> --- a/mercurial/hg.py
>> +++ b/mercurial/hg.py
>> @@ -910,7 +910,11 @@ def incoming(ui, repo, source, opts):
>>  return _incoming(display, subreporecurse, ui, repo, source, opts)
>>  
>>  def _outgoing(ui, repo, dest, opts):
>> -dest = ui.expandpath(dest or 'default-push', dest or 'default')
>> +path = ui.paths.getpath(dest, default=('default-push', 'default'))
>> +if not path:
>> +raise error.Abort(_('default repository not configured!'),
>> +hint=_("see 'hg help config.paths'"))
>> +dest = path.pushloc or path.loc
>>  dest, branches = parseurl(dest, opts.get('branch'))
>>  ui.status(_('comparing with %s\n') % util.hidepassword(dest))
>>  revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev'))
>> diff --git a/tests/test-incoming-outgoing.t b/tests/test-incoming-outgoing.t
>> --- a/tests/test-incoming-outgoing.t
>> +++ b/tests/test-incoming-outgoing.t
>> @@ -491,3 +491,71 @@ incoming from empty remote repository
>>searching for changes
>>no changes found
>>[1]
>> +
>> +Create a "split" repo that pulls from r1 and pushes to r2, using 
>> default-push
>> +
>> +  $ hg clone r1 split
>> +  updating to branch default
>> +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>> +  $ ed -s split/.hg/hgrc << EOF
>> +  > /^default
>> +  > a
>> +  > default-push = file://$TESTTMP/r2 
>> +  > .
>> +  > w
>> +  > q
>> +  > EOF
>> +  default = $TESTTMP/r1
>> +  $ hg -R split paths
>> +  default = $TESTTMP/r1
>> +  default-push = file://$TESTTMP/r2 
>> +  $ hg -R split outgoing
>> +  comparing with file://$TESTTMP/r2 
>> +  searching for changes
>> +  changeset:   0:3e92d79f743a
>> +  tag: tip
>> +  user:test
>> +  date:Thu Jan 01 00:00:00 1970 +
>> +  summary: a
>> +  
>> +
>> +Use default:pushurl instead of default-push
>> +
>> +  $ ed -s split/.hg/hgrc <> +  > /^default-push
>> +  > c
>> +  > default:pushurl = file://$PWD/r2 
>> +  > .
>> +  > w
>> +  > EOF
>> +  default-push = file://$TESTTMP/r2 
>> +  $ hg -R split paths
>> +  default = $TESTTMP/r1
>> +  default:pushurl = file://$TESTTMP/r2 
>> +  $ hg -R split outgoing
>> +  comparing with file://$TESTTMP/r2 
>> +  searching for changes
>> +  changeset:   0:3e92d79f743a
>> +  tag: tip
>> +  user:test
>> +  date:Thu Jan 01 00:00:00 1970 +
>> +  summary: a
>> +  
>> +
>> +Push and then double-check outgoing
>> +
>> +  $ echo a >> split/foo
>> +  $ hg -R split commit -Ama
>> +  $ hg -R split push
>> +  pushing to file://$TESTTMP/r2 
>> +  searching for changes
>> +  adding changesets
>> +  adding manifests
>> +  adding file changes
>> +  added 2 changesets with 2 changes to 1 files
>> +  $ hg -R split outgoing
>> +  comparing with file://$TESTTMP/r2 
>> +  searching for changes
>> +  no ch

Re: Storage format for remotenames.

2017-11-10 Thread Augie Fackler

> On Nov 10, 2017, at 18:03, Gregory Szorc  wrote:
> 
> 
>> Would it make sense to try and come to an agreement on a single format we 
>> can use for node->label storage? It's come up in the bookmarks binary part 
>> patches as well...
>> 
> Perhaps. But that could quickly devolve into such topics as:
> 
> * Unified vs per-domain storage
> * Label specific versus generic node metadata storage

I mostly meant around a record format that would let us map node->label, but 
maybe I'm being ambitious even on that front. :/


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


D1355: pull: clarify that -u only updates linearly

2017-11-10 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe61d661b0350: pull: clarify that -u only updates linearly 
(authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1355?vs=3392&id=3414

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

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
@@ -3918,7 +3918,7 @@
 
 @command('^pull',
 [('u', 'update', None,
- _('update to new branch head if changesets were pulled')),
+ _('update to new branch head if new descendants were pulled')),
 ('f', 'force', None, _('run even when remote repository is unrelated')),
 ('r', 'rev', [], _('a remote changeset intended to be added'), _('REV')),
 ('B', 'bookmark', [], _("bookmark to pull"), _('BOOKMARK')),



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


Re: Storage format for remotenames.

2017-11-10 Thread Gregory Szorc
On Fri, Nov 10, 2017 at 2:48 PM, Augie Fackler  wrote:

>
> On Nov 10, 2017, at 17:46, Gregory Szorc  wrote:
>
> On Fri, Nov 10, 2017 at 2:24 PM, Augie Fackler  wrote:
>
>> On Mon, Nov 06, 2017 at 09:46:18AM -0800, Gregory Szorc wrote:
>> > On Mon, Nov 6, 2017 at 4:34 AM, Pulkit Goyal <7895pul...@gmail.com>
>> wrote:
>> >
>> > > Hey,
>> > >
>> > > I am working on porting functionalities from hgremotenames extension
>> > > to core. The hgremotenames extensions pull the information about
>> > > remote branches and remote bookmarks and store them to provide a
>> > > better workflow.
>> > >
>> > > The current storage format which hgremotenames has is having a file
>> > > `.hg/remotenames` in which each line is of the format `node nametype
>> > > name`, where
>> > >   - `node` refers to node where the remotename was last seen
>> > >   -  `nametype` refers whether it's a bookmark or branch
>> > >   - `name` consists of name of the remote and name of the remote
>> > > bookmark/branch
>> > >
>> > > At sprint, Ryan suggested to split the file according to bookmark and
>> > > branches so that we can read and write more easily which makes sense.
>> > >
>> > > While working on the patches, I found out that if the name of the
>> > > remote contains a '/', then the current storage format is not good and
>> > > we can fail to parse things correctly.
>> > >
>> > > Do you guys have any better ideas on how we can store remotenames?
>> > >
>> >
>> > I have somewhat strong feels that we should strive to use append-only
>> file
>> > formats as much as possible. This will enable us to more easily
>> implement a
>> > "time machine" feature that allows the full state of the repository at a
>> > previous point in time to be seen. It also makes transactions lighter,
>> as
>> > we don't need to perform a full file backup: you merely record the
>> offset
>> > of files being appended to.
>> >
>> > A problem with naive append-only files is you need to scan the entire
>> file
>> > to obtain the most recent state. But this can be rectified with either
>> > periodic "snapshots" in the data stream (like how revlogs periodically
>> > store a fulltext) or via separate cache files holding snapshot(s). The
>> tags
>> > and branches caches kinda work this way: they effectively prevent full
>> > scans or expensive reads of changelog and/or manifest-based data.
>> >
>> > A revlog may actually not be a bad solution to this problem space. A bit
>> > heavyweight. But the solution exists and should be relatively easy to
>> > integrate.
>>
>> I think for now we should not let the perfect (generalized undo) be
>> the enemy of the good (keeping track of where labels were on
>> remotes). For now, I'd be fine with using some sort of null-separated
>> file format. It's gross, but it should let Pulkit land the feature,
>> and since it's largely advisory data it's not a crisis if we improve
>> it later.
>>
>
> I agree. A generalized undo format is a lot of work and is definitely
> scope bloat for remote names.
>
> But my point about append-only data structures still stands. You basically
> get the Git equivalent of the "reflog" for free if you e.g. store this data
> in a revlog.
>
>
> That sounds relevant for journal, less so for remotenames.
>

Fair enough.


>
> Would it make sense to try and come to an agreement on a single format we
> can use for node->label storage? It's come up in the bookmarks binary part
> patches as well...
>

Perhaps. But that could quickly devolve into such topics as:

* Unified vs per-domain storage
* Label specific versus generic node metadata storage
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D1337: util: add util.clearcachedproperty

2017-11-10 Thread mbthomas (Mark Thomas)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGbe6aa0cff8ea: util: add util.clearcachedproperty (authored 
by mbthomas, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1337?vs=3337&id=3411

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

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
@@ -931,6 +931,11 @@
 # __dict__ assignment required to bypass __setattr__ (eg: repoview)
 obj.__dict__[self.name] = value
 
+def clearcachedproperty(obj, prop):
+'''clear a cached property value, if one has been set'''
+if prop in obj.__dict__:
+del obj.__dict__[prop]
+
 def pipefilter(s, cmd):
 '''filter string S through command CMD, returning its output'''
 p = subprocess.Popen(cmd, shell=True, close_fds=closefds,



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


D1339: dirstate: don't remove normallookup files from nonnormalset

2017-11-10 Thread mbthomas (Mark Thomas)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1664dc7ccd8a: dirstate: don't remove normallookup 
files from nonnormalset (authored by mbthomas, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1339?vs=3339&id=3413

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -458,8 +458,6 @@
 return
 self._addpath(f, 'n', 0, -1, -1)
 self._map.copymap.pop(f, None)
-if f in self._map.nonnormalset:
-self._map.nonnormalset.remove(f)
 
 def otherparent(self, f):
 '''Mark as coming from the other parent, always dirty.'''



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


D1338: dirstate: clear map cached properties when clearing the map

2017-11-10 Thread mbthomas (Mark Thomas)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGecede5263adb: dirstate: clear map cached properties when 
clearing the map (authored by mbthomas, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1338?vs=3338&id=3412

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -1226,6 +1226,11 @@
 self._map.clear()
 self.copymap.clear()
 self.setparents(nullid, nullid)
+util.clearcachedproperty(self, "dirs")
+util.clearcachedproperty(self, "filefoldmap")
+util.clearcachedproperty(self, "dirfoldmap")
+util.clearcachedproperty(self, "nonnormalset")
+util.clearcachedproperty(self, "otherparentset")
 
 def iteritems(self):
 return self._map.iteritems()



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


Re: Desired use case for obsmarkers / visibility

2017-11-10 Thread Augie Fackler
(+junw for visibility in case he's got an idea, +martinvonz in case he
remembers downsides we thought of I've since forgotten.)

On Thu, Nov 02, 2017 at 10:06:43AM -0700, Gregory Szorc wrote:
> I have a potential use case for obsmarkers / visibility that I want to run
> by people to see if it can be supported.

[...]

> Instead of performing backouts and leaving the final repo history in a
> sub-optimal state, we want to instead "drop" "bad" changesets before they
> are published. e.g.
>
> o E' (draft) (rebased from discarded D to C)
> | x D (draft) (discarded)
> o C (public)
> o B (public)
> o A (public) (root)
>
> Since we can identify "bad" changesets relatively quickly, this would
> enable us to remove the vast majority of backouts and "bad" changesets from
> the final, published repo history.
>
> Again, obsolescence as it exists today facilitates this. We can perform
> these drops via `hg histedit` (or similar) and the appropriate "prune"
> obsmarkers are written so the canonical repo has the appropriate final
> history.
>
> However, the way it works today isn't friendly to end-user workflows.
>
> If we were to deploy this, the following would happen:
>
> 1) User creates changeset X and submits for landing.
> 2) Landing service rebases to X' and writes X->X' marker.
> 3) X' turns out to be bad and is dropped. X'->null marker is written to
> convey the prune.
> 4) User pulls and sees X->X'->null and hides X because its most recent
> successor is pruned.
> 5) User is left wondering what happened to X. They possibly forget they
> need to fix and reland X.
>
> This is bad UX. What we want to happen instead is:
>
> a) User pulls after X' drop and X is still visible.
> b) Something else happens and some form of X remains visible/accessible to
> user
>
> The server can't expose X' because everyone would see it. We have 1 head
> per repo and don't want to be exposing random "bad" changesets to everyone.
> This seems to rule out the traditional evolve solution of "touch" a
> changeset to revive a prune because I'm not sure how we'd send X' to only
> the user that cares about it. There's also no way in obsolescence today to
> unhide X once it has been obsoleted.

[...]

>
> I /think/ the new visibility work proposed by Jun, Durham, and others might
> offer some solutions to this problem. Rather than speculate based on my
> limited knowledge of that proposal, I am hoping someone with more knowledge
> could weigh in more definitively.

Here's a proposal I ran by Martin probably a year ago, and that he
didn't immediately hate:

Prunes are different from regular obsolete markers. By default, you
don't push prunes, and pulled prunes are not applied, but merely
warned about. Push and pull could both grow a new flag
(`--exchange-death` is my intentionally-bad name because I haven't
come up with a good one).

Anecdotally, nearly all of the prune markers in my repo of hg are
mine, and probably haven't ever been exchanged. In the entire history
of hg, we've exchanged 21062 prune markers, but only 361 prune markers
(minus any that are mine, I'm too lazy to make ane extra clone to get
that info), out of that 21k are actually prunes of something I've got
locally. I don't know how many of those locally-pruned revisions then
later got resurrected and finally landed in the repo. That suggests to
me that we could actually do pretty well by only exchanging prunes
when it's actually relevant to the destination.

Thoughts?
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: Storage format for remotenames.

2017-11-10 Thread Augie Fackler

> On Nov 10, 2017, at 17:46, Gregory Szorc  wrote:
> 
> On Fri, Nov 10, 2017 at 2:24 PM, Augie Fackler  > wrote:
> On Mon, Nov 06, 2017 at 09:46:18AM -0800, Gregory Szorc wrote:
> > On Mon, Nov 6, 2017 at 4:34 AM, Pulkit Goyal <7895pul...@gmail.com 
> > > wrote:
> >
> > > Hey,
> > >
> > > I am working on porting functionalities from hgremotenames extension
> > > to core. The hgremotenames extensions pull the information about
> > > remote branches and remote bookmarks and store them to provide a
> > > better workflow.
> > >
> > > The current storage format which hgremotenames has is having a file
> > > `.hg/remotenames` in which each line is of the format `node nametype
> > > name`, where
> > >   - `node` refers to node where the remotename was last seen
> > >   -  `nametype` refers whether it's a bookmark or branch
> > >   - `name` consists of name of the remote and name of the remote
> > > bookmark/branch
> > >
> > > At sprint, Ryan suggested to split the file according to bookmark and
> > > branches so that we can read and write more easily which makes sense.
> > >
> > > While working on the patches, I found out that if the name of the
> > > remote contains a '/', then the current storage format is not good and
> > > we can fail to parse things correctly.
> > >
> > > Do you guys have any better ideas on how we can store remotenames?
> > >
> >
> > I have somewhat strong feels that we should strive to use append-only file
> > formats as much as possible. This will enable us to more easily implement a
> > "time machine" feature that allows the full state of the repository at a
> > previous point in time to be seen. It also makes transactions lighter, as
> > we don't need to perform a full file backup: you merely record the offset
> > of files being appended to.
> >
> > A problem with naive append-only files is you need to scan the entire file
> > to obtain the most recent state. But this can be rectified with either
> > periodic "snapshots" in the data stream (like how revlogs periodically
> > store a fulltext) or via separate cache files holding snapshot(s). The tags
> > and branches caches kinda work this way: they effectively prevent full
> > scans or expensive reads of changelog and/or manifest-based data.
> >
> > A revlog may actually not be a bad solution to this problem space. A bit
> > heavyweight. But the solution exists and should be relatively easy to
> > integrate.
> 
> I think for now we should not let the perfect (generalized undo) be
> the enemy of the good (keeping track of where labels were on
> remotes). For now, I'd be fine with using some sort of null-separated
> file format. It's gross, but it should let Pulkit land the feature,
> and since it's largely advisory data it's not a crisis if we improve
> it later.
> 
> I agree. A generalized undo format is a lot of work and is definitely scope 
> bloat for remote names.
> 
> But my point about append-only data structures still stands. You basically 
> get the Git equivalent of the "reflog" for free if you e.g. store this data 
> in a revlog.

That sounds relevant for journal, less so for remotenames.

Would it make sense to try and come to an agreement on a single format we can 
use for node->label storage? It's come up in the bookmarks binary part patches 
as well...

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


Re: Storage format for remotenames.

2017-11-10 Thread Gregory Szorc
On Fri, Nov 10, 2017 at 2:24 PM, Augie Fackler  wrote:

> On Mon, Nov 06, 2017 at 09:46:18AM -0800, Gregory Szorc wrote:
> > On Mon, Nov 6, 2017 at 4:34 AM, Pulkit Goyal <7895pul...@gmail.com>
> wrote:
> >
> > > Hey,
> > >
> > > I am working on porting functionalities from hgremotenames extension
> > > to core. The hgremotenames extensions pull the information about
> > > remote branches and remote bookmarks and store them to provide a
> > > better workflow.
> > >
> > > The current storage format which hgremotenames has is having a file
> > > `.hg/remotenames` in which each line is of the format `node nametype
> > > name`, where
> > >   - `node` refers to node where the remotename was last seen
> > >   -  `nametype` refers whether it's a bookmark or branch
> > >   - `name` consists of name of the remote and name of the remote
> > > bookmark/branch
> > >
> > > At sprint, Ryan suggested to split the file according to bookmark and
> > > branches so that we can read and write more easily which makes sense.
> > >
> > > While working on the patches, I found out that if the name of the
> > > remote contains a '/', then the current storage format is not good and
> > > we can fail to parse things correctly.
> > >
> > > Do you guys have any better ideas on how we can store remotenames?
> > >
> >
> > I have somewhat strong feels that we should strive to use append-only
> file
> > formats as much as possible. This will enable us to more easily
> implement a
> > "time machine" feature that allows the full state of the repository at a
> > previous point in time to be seen. It also makes transactions lighter, as
> > we don't need to perform a full file backup: you merely record the offset
> > of files being appended to.
> >
> > A problem with naive append-only files is you need to scan the entire
> file
> > to obtain the most recent state. But this can be rectified with either
> > periodic "snapshots" in the data stream (like how revlogs periodically
> > store a fulltext) or via separate cache files holding snapshot(s). The
> tags
> > and branches caches kinda work this way: they effectively prevent full
> > scans or expensive reads of changelog and/or manifest-based data.
> >
> > A revlog may actually not be a bad solution to this problem space. A bit
> > heavyweight. But the solution exists and should be relatively easy to
> > integrate.
>
> I think for now we should not let the perfect (generalized undo) be
> the enemy of the good (keeping track of where labels were on
> remotes). For now, I'd be fine with using some sort of null-separated
> file format. It's gross, but it should let Pulkit land the feature,
> and since it's largely advisory data it's not a crisis if we improve
> it later.
>

I agree. A generalized undo format is a lot of work and is definitely scope
bloat for remote names.

But my point about append-only data structures still stands. You basically
get the Git equivalent of the "reflog" for free if you e.g. store this data
in a revlog.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 15 of 15 V2] exchange: drop unused '_getbookmarks' function

2017-11-10 Thread Augie Fackler
On Thu, Nov 02, 2017 at 02:18:12PM +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld 
> # Date 1508248540 -7200
> #  Tue Oct 17 15:55:40 2017 +0200
> # Node ID cfaaca09ba21da03f44a253348bc5de968928da3
> # Parent  018fdb537668a81bd1f949ae6fe987a58b281ebf
> # EXP-Topic b2.bookmarks
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
> cfaaca09ba21
> exchange: drop unused '_getbookmarks' function

This one is also queued with a tweak to the log message to not
reference things I didn't take yet. :)

I think the path for these should be a brief round of discussion on
the binary payload format (major bonus points if it can be used for
the forthcoming remotenames stuff pulkit has in mind), and then do a
v2 with the bits I didn't already take.

I can probably make myself available Monday morning to discuss wire
formats over VC if that'd be easier, but hopefully we can work out it
quickly enough via email.

>
> The function was introduced in 8491845a75b2 in mid-November 2016 but is never
> used anywhere in core. Binary support for bookmarks has now landed in core and
> the getbundle API makes it easy to override it. So we just remove the dead
> (unborn?) code.
>
> diff --git a/mercurial/exchange.py b/mercurial/exchange.py
> --- a/mercurial/exchange.py
> +++ b/mercurial/exchange.py
> @@ -1875,17 +1875,6 @@ def _getbundletagsfnodes(bundler, repo,
>  outgoing = _computeoutgoing(repo, heads, common)
>  bundle2.addparttagsfnodescache(repo, bundler, outgoing)
>
> -def _getbookmarks(repo, **kwargs):
> -"""Returns bookmark to node mapping.
> -
> -This function is primarily used to generate `bookmarks` bundle2 part.
> -It is a separate function in order to make it easy to wrap it
> -in extensions. Passing `kwargs` to the function makes it easy to
> -add new parameters in extensions.
> -"""
> -
> -return dict(bookmod.listbinbookmarks(repo))
> -
>  def check_heads(repo, their_heads, context):
>  """check if the heads of a repo have been modified
>
> ___
> 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


Re: [PATCH 12 of 15 V2] bundle2: support a 'records' mode for the 'bookmarks' part

2017-11-10 Thread Augie Fackler
On Thu, Nov 02, 2017 at 02:18:09PM +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld 
> # Date 1508246776 -7200
> #  Tue Oct 17 15:26:16 2017 +0200
> # Node ID 68bbec307c142b6b41893512b1c76320c87c2fa1
> # Parent  bd3927325fe48e104b1627e5681ccd09a9a49e44
> # EXP-Topic b2.bookmarks
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
> 68bbec307c14
> bundle2: support a 'records' mode for the 'bookmarks' part
>
> In this mode, the bookmarks changes are record in the 'bundleoperation' 
> records
> instead of inflicted to the repository. This is necessary to use the part when

s/inflicted/applied/?

> pulling.
>

I'm confused. Why do we not want to apply the part when we're pulling?
This log message could use some expansion.

>
> diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
> --- a/mercurial/bundle2.py
> +++ b/mercurial/bundle2.py
> @@ -1897,40 +1897,55 @@ def handlepushkey(op, inpart):
>  def handlebookmark(op, inpart):
>  """transmit bookmark information
>
> -The part contains binary encoded bookmark information. The bookmark
> -information is applied as is to the unbundling repository. Make sure a
> -'check:bookmarks' part is issued earlier to check for race condition in
> -such update.
> +The part contains binary encoded bookmark information.
> +
> +The exact behavior of this part can be controlled by the 'bookmarks' mode
> +on the bundle operation.
>
> -This behavior is suitable for pushing. Semantic adjustment will be needed
> -for pull.
> +When mode is 'apply' (the default) the bookmark information is applied as
> +is to the unbundling repository. Make sure a 'check:bookmarks' part is
> +issued earlier to check for push races in such update. This behavior is
> +suitable for pushing.
> +
> +When mode is 'records', the information is recorded into the 'bookmarks'
> +records of the bundle operation. This behavior is suitable for pulling.
>  """
>  changes = bookmarks.binarydecode(inpart)
>
> -tr = op.gettransaction()
> -bookstore = op.repo._bookmarks
> +pushkeycompat = op.repo.ui.configbool('server', 
> 'bookmarks-pushkey-compat')
> +bookmarksmode = op.modes.get('bookmarks', 'apply')
>
> -pushkeycompat = op.repo.ui.configbool('server', 
> 'bookmarks-pushkey-compat')
> -if pushkeycompat:
> -allhooks = []
> +if bookmarksmode == 'apply':
> +tr = op.gettransaction()
> +bookstore = op.repo._bookmarks
> +if pushkeycompat:
> +allhooks = []
> +for book, node in changes:
> +hookargs = tr.hookargs.copy()
> +hookargs['pushkeycompat'] = '1'
> +hookargs['namespace'] = 'bookmark'
> +hookargs['key'] = book
> +hookargs['old'] = nodemod.hex(bookstore.get(book, ''))
> +hookargs['new'] = nodemod.hex(node if node is not None else 
> '')
> +allhooks.append(hookargs)
> +
> +for hookargs in allhooks:
> +op.repo.hook('prepushkey', throw=True, **hookargs)
> +
> +bookstore.applychanges(op.repo, op.gettransaction(), changes)
> +
> +if pushkeycompat:
> +def runhook():
> +for hookargs in allhooks:
> +op.repo.hook('prepushkey', **hookargs)
> +op.repo._afterlock(runhook)
> +
> +elif bookmarksmode == 'records':
>  for book, node in changes:
> -hookargs = tr.hookargs.copy()
> -hookargs['pushkeycompat'] = '1'
> -hookargs['namespace'] = 'bookmark'
> -hookargs['key'] = book
> -hookargs['old'] = nodemod.hex(bookstore.get(book, ''))
> -hookargs['new'] = nodemod.hex(node if node is not None else '')
> -allhooks.append(hookargs)
> -for hookargs in allhooks:
> -op.repo.hook('prepushkey', throw=True, **hookargs)
> -
> -bookstore.applychanges(op.repo, tr, changes)
> -
> -if pushkeycompat:
> -def runhook():
> -for hookargs in allhooks:
> -op.repo.hook('prepushkey', **hookargs)
> -op.repo._afterlock(runhook)
> +record = {'bookmark': book, 'node': node}
> +op.records.add('bookmarks', record)
> +else:
> +raise error.ProgrammingError('unkown bookmark mode: %s' % 
> bookmarksmode)
>
>  @parthandler('phase-heads')
>  def handlephases(op, inpart):
> ___
> 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


Re: [PATCH 04 of 15 V2] bookmark: use bundle2 debug output in one push tests

2017-11-10 Thread Augie Fackler
On Thu, Nov 02, 2017 at 02:18:01PM +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld 
> # Date 1508073707 -7200
> #  Sun Oct 15 15:21:47 2017 +0200
> # Node ID 71c59800667fd81b3e13d10f418ee8876a8ddf74
> # Parent  d9c0b8c5d92f97ba3fb32cd6d819258a39a27e63
> # EXP-Topic b2.bookmarks
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
> 71c59800667f
> bookmark: use bundle2 debug output in one push tests

Took this one too, thanks.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 02 of 15 V2] bookmark: add methods to binary encode and decode bookmark values

2017-11-10 Thread Augie Fackler
(+indygreg, who also is a formats enthusiast)

On Thu, Nov 02, 2017 at 02:17:59PM +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld 
> # Date 1508072395 -7200
> #  Sun Oct 15 14:59:55 2017 +0200
> # Node ID 4d0c6772a81aa1e2b25f32f944563db1f33fd327
> # Parent  8c9a9eecdcd61401a1604a08a5272f7dabd4b912
> # EXP-Topic b2.bookmarks
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
> 4d0c6772a81a
> bookmark: add methods to binary encode and decode bookmark values
>
> Coming new bundle2 parts related to bookmark will use a binary encoding. It
> encodes a series of '(bookmark, node)' pairs. Bookmark name has a high enough
> size limit to not be affected by issue5165. (64K length, we are well covered)

I'm not thrilled here. Could we do some sort of varint encoding, which
would be generally useful going forward for a variety of things,
rather than just shrugging and setting a limit which we (today) deem
absurdly large?

I agree that practically speaking, nobody should have a 64k bookmark,
but we can do better. We also know that \0 shouldn't appear in a
bookmark name, so we could just make the format be
null-terminated. I'd much rather we get in the practice of
deliberately crafting formats that are maximally flexible and
reusable.

IOW, encode something like this:

struct {
  node [20]byte
  name [] byte // continues until you see the first NUL
}

Greg, am I talking crazy?


>
> diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
> --- a/mercurial/bookmarks.py
> +++ b/mercurial/bookmarks.py
> @@ -8,12 +8,14 @@
>  from __future__ import absolute_import
>
>  import errno
> +import struct
>
>  from .i18n import _
>  from .node import (
>  bin,
>  hex,
>  short,
> +wdirid,
>  )
>  from . import (
>  encoding,
> @@ -550,6 +552,60 @@ def unhexlifybookmarks(marks):
>  binremotemarks[name] = bin(node)
>  return binremotemarks
>
> +_binaryentry = struct.Struct('>20sH')
> +
> +def binaryencode(bookmarks):
> +"""encode a '(bookmark, node)' iterable into a binary stream
> +
> +the binary format is:
> +
> +
> +
> +:node: is a 20 bytes binary node,
> +:bookmark-length: an unsigned short,
> +:bookmark-name: the name of the bookmark (of length )
> +
> +wdirid (all bits set) will be used as a special value for "missing"
> +"""
> +binarydata = []
> +for book, node in bookmarks:
> +if not node: # None or ''
> +node = wdirid
> +binarydata.append(_binaryentry.pack(node, len(book)))
> +binarydata.append(book)
> +return ''.join(binarydata)
> +
> +def binarydecode(stream):
> +"""decode a binary stream into an '(bookmark, node)' iterable
> +
> +the binary format is:
> +
> +
> +
> +:node: is a 20 bytes binary node,
> +:bookmark-length: an unsigned short,
> +:bookmark-name: the name of the bookmark (of length ))
> +
> +wdirid (all bits set) will be used as a special value for "missing"
> +"""
> +entrysize = _binaryentry.size
> +books = []
> +while True:
> +entry = stream.read(entrysize)
> +if len(entry) < entrysize:
> +if entry:
> +raise error.Abort(_('bad bookmark stream'))
> +break
> +node, length = _binaryentry.unpack(entry)
> +bookmark = stream.read(length)
> +if len(bookmark) < length:
> +if entry:
> +raise error.Abort(_('bad bookmark stream'))
> +if node == wdirid:
> +node = None
> +books.append((bookmark, node))
> +return books
> +
>  def updatefromremote(ui, repo, remotemarks, path, trfunc, explicit=()):
>  ui.debug("checking for updated bookmarks\n")
>  localmarks = repo._bookmarks
> ___
> 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


Re: [PATCH 01 of 15 V2] pull: store binary node in pullop.remotebookmarks

2017-11-10 Thread Augie Fackler
On Thu, Nov 02, 2017 at 02:17:58PM +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld 
> # Date 1508230905 -7200
> #  Tue Oct 17 11:01:45 2017 +0200
> # Node ID 8c9a9eecdcd61401a1604a08a5272f7dabd4b912
> # Parent  3ce0e4b51f789eff195ec900a07c1fa5e8d5c5f2
> # EXP-Topic b2.bookmarks
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
> 8c9a9eecdcd6
> pull: store binary node in pullop.remotebookmarks

I've taken this one, thanks.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 2 of 2] config: rename allow_push to allow-push

2017-11-10 Thread Augie Fackler
On Fri, Nov 10, 2017 at 03:09:22PM +0100, David Demelier wrote:
> # HG changeset patch
> # User David Demelier 
> # Date 1508406401 -7200
> #  Thu Oct 19 11:46:41 2017 +0200
> # Node ID 7618db2f7c818bcfd73393fff45a13e50fa9250b
> # Parent  4157480049dabdf7bd54160c909baf13ea8d5107
> config: rename allow_push to allow-push

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


Re: [PATCH 3 of 3] hgweb: add missing semicolons to followlines.js

2017-11-10 Thread Augie Fackler
On Fri, Nov 10, 2017 at 08:39:06PM +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov 
> # Date 1510312446 -28800
> #  Fri Nov 10 19:14:06 2017 +0800
> # Node ID 981d7ebd7dc74a88493f39982649a52ed09a199b
> # Parent  95cb67784e3c0d05e24e387acda45fd1c8aa4653
> hgweb: add missing semicolons to followlines.js

Queued, thanks.

>
> Minor stylistic issues caught by jshint.

Should we have some sort of test-jshint.t that can automatically run?
or does it have lots of false positives?

>
> diff --git a/mercurial/templates/static/followlines.js 
> b/mercurial/templates/static/followlines.js
> --- a/mercurial/templates/static/followlines.js
> +++ b/mercurial/templates/static/followlines.js
> @@ -38,7 +38,7 @@ document.addEventListener('DOMContentLoa
>  // element
>  var selectableElements = Array.prototype.filter.call(
>  sourcelines.children,
> -function(x) { return x.tagName === selectableTag });
> +function(x) { return x.tagName === selectableTag; });
>
>  var btnTitleStart = 'start following lines history from here';
>  var btnTitleEnd = 'terminate line block selection here';
> @@ -62,7 +62,7 @@ document.addEventListener('DOMContentLoa
>  }
>
>  // extend DOM with CSS class for selection highlight and action buttons
> -var followlinesButtons = []
> +var followlinesButtons = [];
>  for (var i = 0; i < selectableElements.length; i++) {
>  selectableElements[i].classList.add('followlines-select');
>  var btn = createButton();
> ___
> 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


Re: [PATCH 6 of 6 STABLE] amend: update .hgsubstate before committing a memctx (issue5677)

2017-11-10 Thread Augie Fackler
On Wed, Nov 08, 2017 at 10:13:55PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1509793660 -32400
> #  Sat Nov 04 20:07:40 2017 +0900
> # Branch stable
> # Node ID 17f13d94fbfb4f59bdae5e7a0deb04c3314a992e
> # Parent  34c95aad895f0a96e3becbdfec61a073fbe759f3
> amend: update .hgsubstate before committing a memctx (issue5677)

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


Re: [PATCH 1 of 6 STABLE] tests: add more complete test for status changes on amend

2017-11-10 Thread Augie Fackler
On Wed, Nov 08, 2017 at 10:13:50PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1509806426 -32400
> #  Sat Nov 04 23:40:26 2017 +0900
> # Branch stable
> # Node ID a300140d16436606c8fd73f82dd7c8943de38240
> # Parent  4cc910cd81d04a9b29c48e0890e06047f21dd8fb
> tests: add more complete test for status changes on amend
>
> This demonstrates that missing/untracked files are handled incorrectly. The
> correct outputs are suppressed by (false !), and wrong outputs are added with
> (true !) instead.

This is a genius way to mark expected failures! I love it.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: Storage format for remotenames.

2017-11-10 Thread Augie Fackler
On Mon, Nov 06, 2017 at 09:46:18AM -0800, Gregory Szorc wrote:
> On Mon, Nov 6, 2017 at 4:34 AM, Pulkit Goyal <7895pul...@gmail.com> wrote:
>
> > Hey,
> >
> > I am working on porting functionalities from hgremotenames extension
> > to core. The hgremotenames extensions pull the information about
> > remote branches and remote bookmarks and store them to provide a
> > better workflow.
> >
> > The current storage format which hgremotenames has is having a file
> > `.hg/remotenames` in which each line is of the format `node nametype
> > name`, where
> >   - `node` refers to node where the remotename was last seen
> >   -  `nametype` refers whether it's a bookmark or branch
> >   - `name` consists of name of the remote and name of the remote
> > bookmark/branch
> >
> > At sprint, Ryan suggested to split the file according to bookmark and
> > branches so that we can read and write more easily which makes sense.
> >
> > While working on the patches, I found out that if the name of the
> > remote contains a '/', then the current storage format is not good and
> > we can fail to parse things correctly.
> >
> > Do you guys have any better ideas on how we can store remotenames?
> >
>
> I have somewhat strong feels that we should strive to use append-only file
> formats as much as possible. This will enable us to more easily implement a
> "time machine" feature that allows the full state of the repository at a
> previous point in time to be seen. It also makes transactions lighter, as
> we don't need to perform a full file backup: you merely record the offset
> of files being appended to.
>
> A problem with naive append-only files is you need to scan the entire file
> to obtain the most recent state. But this can be rectified with either
> periodic "snapshots" in the data stream (like how revlogs periodically
> store a fulltext) or via separate cache files holding snapshot(s). The tags
> and branches caches kinda work this way: they effectively prevent full
> scans or expensive reads of changelog and/or manifest-based data.
>
> A revlog may actually not be a bad solution to this problem space. A bit
> heavyweight. But the solution exists and should be relatively easy to
> integrate.

I think for now we should not let the perfect (generalized undo) be
the enemy of the good (keeping track of where labels were on
remotes). For now, I'd be fine with using some sort of null-separated
file format. It's gross, but it should let Pulkit land the feature,
and since it's largely advisory data it's not a crisis if we improve
it later.


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


D1270: help: adding a topic on flags

2017-11-10 Thread durin42 (Augie Fackler)
durin42 accepted this revision as: durin42.
durin42 added a comment.


  I'm +1 on this, but won't accept as a reviewer since I've got at least two 
biases here (it makes permanent my --no- boolean prefix for flags, and it'll 
solve some support problems at G).

REPOSITORY
  rHG Mercurial

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

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


mercurial@35012: 5 new changesets (2 on stable)

2017-11-10 Thread Mercurial Commits
5 new changesets (2 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/ad671b4cb9fc
changeset:   35008:ad671b4cb9fc
branch:  stable
parent:  34995:4cc910cd81d0
user:Mark Thomas 
date:Fri Nov 03 09:27:35 2017 -0700
summary: tests: add a test demonstrating issue5731

https://www.mercurial-scm.org/repo/hg/rev/99ab7bc944d2
changeset:   35009:99ab7bc944d2
branch:  stable
user:Mark Thomas 
date:Fri Nov 03 09:27:36 2017 -0700
summary: scmutil: don't try to delete origbackup symlinks to directories 
(issue5731)

https://www.mercurial-scm.org/repo/hg/rev/b81ad5b78a81
changeset:   35010:b81ad5b78a81
parent:  35007:407ec7f3ff02
user:Boris Feld 
date:Thu Oct 19 12:35:47 2017 +0200
summary: obsfate: makes successorsetverb takes the markers as argument

https://www.mercurial-scm.org/repo/hg/rev/a2dfc723b6b5
changeset:   35011:a2dfc723b6b5
user:Durham Goode 
date:Tue Nov 07 10:16:53 2017 -0800
summary: bundle: allow bundlerepo to support alternative manifest 
implementations

https://www.mercurial-scm.org/repo/hg/rev/d80380ba8e7d
changeset:   35012:d80380ba8e7d
bookmark:@
tag: tip
user:Kyle Lippincott 
date:Wed Nov 08 18:24:43 2017 -0800
summary: changegroup: use any node, not min(), in treemanifest's 
generatemanifests

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


D1354: dirstate: change all writes to dirstatemap._map to go through one method

2017-11-10 Thread durin42 (Augie Fackler)
durin42 added a comment.


  I'm not really happy with this. Why can't eden be replacing the dirstatemap 
entirely, and be intercepting things at that layer?

REPOSITORY
  rHG Mercurial

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

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


D1341: dirstate: move management of nonnormal sets into dirstate map

2017-11-10 Thread durin42 (Augie Fackler)
durin42 added a comment.


  I strongly suspect that (if you agree with my feedback on 
https://phab.mercurial-scm.org/D1340) this will need some adjustments to 
document the expanded behavior of dirstatemap WRT nonnormalset (whatever a 
nonnormalset is)

REPOSITORY
  rHG Mercurial

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

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


D1340: dirstate: add explicit methods for modifying dirstate

2017-11-10 Thread durin42 (Augie Fackler)
durin42 requested changes to this revision.
durin42 added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> dirstate.py:130
>  def _map(self):
> -'''Return the dirstate contents as a map from filename to
> -(state, mode, size, time).'''
> +'''Returns the dirstate map.'''
>  self._map = dirstatemap(self._ui, self._opener, self._root)

Why is ~all the interesting content of this docstring removed? Where is the 
meaning of the dirstate map documented other than this docstring?

> dirstate.py:1196
>  
>  class dirstatemap(object):
>  def __init__(self, ui, opener, root):

Per my comment above, let's insert a patch before this one that documents in 
more detail the API that dirstatemap is supposed to be providing, probably in a 
docstring on this class. Sound reasonable?

(Then the above docstring I complained about could point to this docstring.)

REPOSITORY
  rHG Mercurial

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

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


D1339: dirstate: don't remove normallookup files from nonnormalset

2017-11-10 Thread durin42 (Augie Fackler)
durin42 added a comment.


  Based on a very shaky understanding of the code gained by spending 10 minutes 
looking around at uses of nonnormalset, I think this is right.
  
  I'd appreciate a patch that describes what all these attributes are intended 
to contain, especially if there's about to be some api-ish contracts going on 
between this and other code (even if there's no stability contract)

REPOSITORY
  rHG Mercurial

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

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


Re: [PATCH 3 of 3] hgweb: add missing semicolons to followlines.js

2017-11-10 Thread Denis Laxalde

The series looks good to me, thanks.

Anton Shestakov a écrit :

# HG changeset patch
# User Anton Shestakov 
# Date 1510312446 -28800
#  Fri Nov 10 19:14:06 2017 +0800
# Node ID 981d7ebd7dc74a88493f39982649a52ed09a199b
# Parent  95cb67784e3c0d05e24e387acda45fd1c8aa4653
hgweb: add missing semicolons to followlines.js

Minor stylistic issues caught by jshint.

diff --git a/mercurial/templates/static/followlines.js 
b/mercurial/templates/static/followlines.js
--- a/mercurial/templates/static/followlines.js
+++ b/mercurial/templates/static/followlines.js
@@ -38,7 +38,7 @@ document.addEventListener('DOMContentLoa
  // element
  var selectableElements = Array.prototype.filter.call(
  sourcelines.children,
-function(x) { return x.tagName === selectableTag });
+function(x) { return x.tagName === selectableTag; });
  
  var btnTitleStart = 'start following lines history from here';

  var btnTitleEnd = 'terminate line block selection here';
@@ -62,7 +62,7 @@ document.addEventListener('DOMContentLoa
  }
  
  // extend DOM with CSS class for selection highlight and action buttons

-var followlinesButtons = []
+var followlinesButtons = [];
  for (var i = 0; i < selectableElements.length; i++) {
  selectableElements[i].classList.add('followlines-select');
  var btn = createButton();
___
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


D1348: histedit: add support to output nodechanges using formatter

2017-11-10 Thread dlax (Denis Laxalde)
dlax requested changes to this revision.
dlax added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> histedit.py:920
> + ('r', 'rev', [], _('first revision to be edited'), _('REV'))] +
> +  cmdutil.templateopts,
>   _("[OPTIONS] ([ANCESTOR] | --outgoing [URL])"))

`formatteropts` should be enought (you don't need `--style` I guess)

REPOSITORY
  rHG Mercurial

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

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


[Bug 5738] New: hg revert has problems with large files

2017-11-10 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=5738

Bug ID: 5738
   Summary: hg revert has problems with large files
   Product: Mercurial
   Version: 4.4.1
  Hardware: Macintosh
OS: Mac OS
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: largefiles
  Assignee: bugzi...@mercurial-scm.org
  Reporter: mo...@macports.org
CC: mercurial-devel@mercurial-scm.org, nato...@gmail.com

First of all, please excuse me for being a total newbie with hg and I'm not
sure how to properly file a bug report or what to file at all.

Description:

I have a repository with large files and keep switching between Mac and Windows
VM. At some point I decided I wanted the files in a different subfolder (and
also accidentally used the wrong path separator as I was copy-pasting from
Windows). Once I noticed the problem, I tried to revert, to no avail.

Now I cannot find a way to revert the changes back.

Here's an attempt of reproducing the steps:

> mkdir TestRepo
> cd TestRepo
> hg init .
> mkdir DirA
> touch DirA/hello.txt
> touch DirA/world.txt
> hg add --large DirA/hello.txt
> hg add DirA/world.txt
> hg commit
> hg mv DirA DirA\DirB
moving DirA/world.txt to DirADirB/world.txt
moving .hglf/DirA/hello.txt to .hglf/DirADirB/DirA/hello.txt
> hg status
A DirADirB/DirA/hello.txt
A DirADirB/world.txt
R DirA/hello.txt
R DirA/world.txt
> find .
./DirADirB
./DirADirB/world.txt
./DirADirB/DirA
./DirADirB/DirA/hello.txt
> hg status -C
A DirADirB/DirA/hello.txt
  DirA/hello.txt
A DirADirB/world.txt
  DirA/world.txt
R DirA/hello.txt
R DirA/world.txt
> hg mv DirADirB/DirA/* DirA
> hg status
A DirA
A DirADirB/world.txt
R DirA/hello.txt
R DirA/world.txt
R DirADirB/DirA/hello.txt
> hg revert --all
forgetting .hglf/DirA
undeleting .hglf/DirA/hello.txt
undeleting DirA/world.txt
forgetting DirADirB/world.txt
abort: Not a directory: '/private/tmp/TestRepo/.hglf/DirA/hello.txt'


Trying to keep working on that repo (I tried reverting individual files) would
crash TornoiseHg (with a request to report to their bug tracker):

#!python
** Mercurial version (4.3.1).  TortoiseHg version (4.3.1)
** Command: 
** CWD: /
** Encoding: US-ASCII
** Extensions loaded: largefiles, shelve
** Python version: 2.7.14 (default, Sep 30 2017, 11:56:16) [GCC 4.2.1
Compatible Apple LLVM 9.0.0 (clang-900.0.37)]
** System: Darwin xxx.local 17.2.0 Darwin Kernel Version 17.2.0: Fri Sep 29
18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64
** Qt-4.8.7 PyQt-4.12.1 QScintilla-2.10.1
Traceback (most recent call last):
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tortoisehg/hgqt/status.py",
line 394, in reloadComplete
self.refthread.patchecked)
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tortoisehg/hgqt/status.py",
line 441, in updateModel
self.updateCheckCount()
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tortoisehg/hgqt/status.py",
line 516, in updateCheckCount
model.checkCount = len(self.getChecked())
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tortoisehg/hgqt/status.py",
line 548, in getChecked
checked = model.getChecked()
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tortoisehg/hgqt/status.py",
line 1001, in getChecked
assert len(self.checked) == len(self.unfiltered)
AssertionError

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


D1358: remotenames: store journal entry for bookmarks if journal is loaded

2017-11-10 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/D1358

AFFECTED FILES
  mercurial/remotenames.py

CHANGE DETAILS

diff --git a/mercurial/remotenames.py b/mercurial/remotenames.py
--- a/mercurial/remotenames.py
+++ b/mercurial/remotenames.py
@@ -8,12 +8,18 @@
 
 from __future__ import absolute_import
 
-from .node import hex
+from .node import (
+bin,
+hex,
+)
 
 from . import (
+util,
 vfs as vfsmod,
 )
 
+# namespace to use when recording an hg journal entry
+journalremotebookmarktype = 'remotebookmark'
 # directory name in .hg/ in which remotenames files will be present
 remotenamedir = 'remotenames'
 
@@ -61,14 +67,26 @@
 bookmarks is a dictionary of remote bookmarks.
 """
 olddata = set(readremotenamefile(repo, 'bookmarks'))
+oldbooks = {}
 
 vfs = vfsmod.vfs(repo.vfs.join(remotenamedir))
 f = vfs('bookmarks', 'w', atomictemp=True)
 
 # re-save the data from a different remote than this one.
 for node, oldpath, rname in sorted(olddata):
 if oldpath != remotepath:
 f.write('%s %s %s\n' % (node, oldpath, rname))
+else:
+oldbooks[rname] = node
+
+# record a journal entry if journal is loaded
+if util.safehasattr(repo, 'journal'):
+for bname, newnode in bookmarks.iteritems():
+oldnode = oldbooks.get(bname, hex(nullid))
+if oldnode != newnode:
+joinedremotename = remotepath + '/' + bname
+repo.journal.record(journalremotebookmarktype, 
joinedremotename,
+bin(oldnode), bin(newnode))
 
 for bookmark, node in sorted(bookmarks.iteritems()):
 if node:



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


D939: remotenames: add functionality to store remotenames under .hg/hgremotenames/

2017-11-10 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 3393.
pulkit edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D939?vs=2436&id=3393

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

AFFECTED FILES
  mercurial/remotenames.py
  tests/test-remotenames.t

CHANGE DETAILS

diff --git a/tests/test-remotenames.t b/tests/test-remotenames.t
--- a/tests/test-remotenames.t
+++ b/tests/test-remotenames.t
@@ -59,14 +59,11 @@
   added 9 changesets with 9 changes to 9 files (+1 heads)
   adding remote bookmark bar
   adding remote bookmark foo
-  
-  Remotenames info
-  path: file:$TESTTMP/server
-  Bookmarks:
-  foo: 62615734edd52f06b6fb9c2beb429e4fe30d57b8
-  bar: 87d6d66763085b629e6d7ed56778c79827273022
-  Branches:
-  wat: ['3e1487808078543b0af6d10dadf5d46943578db0']
-  default: ['ec2426147f0e39dbc9cef599b066be6035ce691d']
-  
   (run 'hg heads' to see heads)
+
+  $ cat .hg/remotenames/bookmarks
+  87d6d66763085b629e6d7ed56778c79827273022 file:$TESTTMP/server bar
+  62615734edd52f06b6fb9c2beb429e4fe30d57b8 file:$TESTTMP/server foo
+  $ cat .hg/remotenames/branches
+  ec2426147f0e39dbc9cef599b066be6035ce691d file:$TESTTMP/server default
+  3e1487808078543b0af6d10dadf5d46943578db0 file:$TESTTMP/server wat
diff --git a/mercurial/remotenames.py b/mercurial/remotenames.py
--- a/mercurial/remotenames.py
+++ b/mercurial/remotenames.py
@@ -10,6 +10,62 @@
 
 from .node import hex
 
+from . import (
+vfs as vfsmod,
+)
+
+# directory name in .hg/ in which remotenames files will be present
+remotenamedir = 'remotenames'
+
+def saveremotebookmarks(repo, remotepath, bookmarks):
+"""
+save remote bookmarks in .hg/remotenames/bookmarks.
+The format of the data stored will be:
+
+`node remotepath bookmarkname`
+
+bookmarks is a dictionary of remote bookmarks.
+"""
+vfs = vfsmod.vfs(repo.vfs.join(remotenamedir))
+f = vfs('bookmarks', 'w', atomictemp=True)
+
+for bookmark, node in sorted(bookmarks.iteritems()):
+if node:
+f.write('%s %s %s\n' % (node, remotepath, bookmark))
+f.close()
+
+def saveremotebranches(repo, remotepath, branches):
+"""
+save remote branches is .hg/remotenames/branches.
+The format of the data stored will be:
+
+`node remotepath branchname`
+
+branches is a dictionary of remote branches.
+"""
+vfs = vfsmod.vfs(repo.vfs.join(remotenamedir))
+f = vfs('branches', 'w', atomictemp=True)
+
+for branch, nodes in sorted(branches.iteritems()):
+for n in nodes:
+f.write('%s %s %s\n' % (n, remotepath, branch))
+
+f.close()
+
+def saveremotenames(repo, remotepath, branches=None, bookmarks=None):
+"""
+save remotenames i.e. remotebookmarks and remotebranches in their
+respective files under ".hg/remotenames/" directory.
+"""
+wlock = repo.wlock()
+try:
+if bookmarks:
+saveremotebookmarks(repo, remotepath, bookmarks)
+if branches:
+saveremotebranches(repo, remotepath, branches)
+finally:
+wlock.release()
+
 def pullremotenames(localrepo, remoterepo):
 """
 pulls bookmarks and branches information of the remote repo during a
@@ -31,13 +87,4 @@
 if node in repo and not repo[node].obsolete():
 bmap[branch].append(hex(node))
 
-# writing things to ui till the time we import the saving functionality
-ui = localrepo.ui
-ui.write("\nRemotenames info\npath: %s\n" % remotepath)
-ui.write("Bookmarks:\n")
-for bm, node in bookmarks.iteritems():
-ui.write("%s: %s\n" % (bm, node))
-ui.write("Branches:\n")
-for branch, node in bmap.iteritems():
-ui.write("%s: %s\n" % (branch, node))
-ui.write("\n")
+saveremotenames(localrepo, remotepath, bmap, bookmarks)



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


D1357: remotenames: consider existing data while storing newer data

2017-11-10 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/D1357

AFFECTED FILES
  mercurial/remotenames.py
  tests/test-remotenames.t

CHANGE DETAILS

diff --git a/tests/test-remotenames.t b/tests/test-remotenames.t
--- a/tests/test-remotenames.t
+++ b/tests/test-remotenames.t
@@ -93,8 +93,12 @@
   searching for changes
   no changes found
   $ cat .hg/remotenames/bookmarks
+  62615734edd52f06b6fb9c2beb429e4fe30d57b8 file:$TESTTMP/server foo
+  87d6d66763085b629e6d7ed56778c79827273022 file:$TESTTMP/server bar
   87d6d66763085b629e6d7ed56778c79827273022 file:$TESTTMP/server2 bar
   62615734edd52f06b6fb9c2beb429e4fe30d57b8 file:$TESTTMP/server2 foo
   $ cat .hg/remotenames/branches
+  3e1487808078543b0af6d10dadf5d46943578db0 file:$TESTTMP/server wat
+  ec2426147f0e39dbc9cef599b066be6035ce691d file:$TESTTMP/server default
   ec2426147f0e39dbc9cef599b066be6035ce691d file:$TESTTMP/server2 default
   3e1487808078543b0af6d10dadf5d46943578db0 file:$TESTTMP/server2 wat
diff --git a/mercurial/remotenames.py b/mercurial/remotenames.py
--- a/mercurial/remotenames.py
+++ b/mercurial/remotenames.py
@@ -60,9 +60,16 @@
 
 bookmarks is a dictionary of remote bookmarks.
 """
+olddata = set(readremotenamefile(repo, 'bookmarks'))
+
 vfs = vfsmod.vfs(repo.vfs.join(remotenamedir))
 f = vfs('bookmarks', 'w', atomictemp=True)
 
+# re-save the data from a different remote than this one.
+for node, oldpath, rname in sorted(olddata):
+if oldpath != remotepath:
+f.write('%s %s %s\n' % (node, oldpath, rname))
+
 for bookmark, node in sorted(bookmarks.iteritems()):
 if node:
 f.write('%s %s %s\n' % (node, remotepath, bookmark))
@@ -77,9 +84,16 @@
 
 branches is a dictionary of remote branches.
 """
+olddata = set(readremotenamefile(repo, 'branches'))
+
 vfs = vfsmod.vfs(repo.vfs.join(remotenamedir))
 f = vfs('branches', 'w', atomictemp=True)
 
+# re-save the data from a different remote than this one.
+for node, oldpath, rname in sorted(olddata):
+if oldpath != remotepath:
+f.write('%s %s %s\n' % (node, oldpath, rname))
+
 for branch, nodes in sorted(branches.iteritems()):
 for n in nodes:
 f.write('%s %s %s\n' % (n, remotepath, branch))



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


D940: remotenames: add functions to read remotenames data from .hg/remotenames/

2017-11-10 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 3395.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D940?vs=2437&id=3395

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

AFFECTED FILES
  mercurial/remotenames.py

CHANGE DETAILS

diff --git a/mercurial/remotenames.py b/mercurial/remotenames.py
--- a/mercurial/remotenames.py
+++ b/mercurial/remotenames.py
@@ -17,6 +17,40 @@
 # directory name in .hg/ in which remotenames files will be present
 remotenamedir = 'remotenames'
 
+def readremotenamefile(repo, filename):
+"""
+reads a file from .hg/remotenames/ directory and yields it's content
+filename: the file to be read
+yield a tuple (node, remotepath, name)
+"""
+
+vfs = vfsmod.vfs(repo.vfs.join(remotenamedir))
+if not vfs.exists(filename):
+return
+f = vfs(filename)
+for line in f:
+line = line.strip()
+if not line:
+continue
+
+node, remote, rname = line.split()
+yield node, remote, rname
+
+f.close()
+
+def readremotenames(repo):
+"""
+read the details about the remotenames stored in .hg/remotenames/ and
+yields a tuple (node, remotepath, name). It does not yields information
+about whether an entry yielded is branch or bookmark. To get that
+information, call the respective functions.
+"""
+
+for bmentry in readremotenamefile(repo, 'bookmarks'):
+yield bmentry
+for branchentry in readremotenamefile(repo, 'branches'):
+yield branchentry
+
 def saveremotebookmarks(repo, remotepath, bookmarks):
 """
 save remote bookmarks in .hg/remotenames/bookmarks.



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


D1356: remotenames: add test showing overwriting on remotenames data

2017-11-10 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The current storage logic every time overwrites the existing data with the new
  data. This patch adds test to demonstrate that. To fix this, we need to add
  logic to read existing remotenames data and merge with existing data which 
will
  be added in upcoming changesets.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-remotenames.t

CHANGE DETAILS

diff --git a/tests/test-remotenames.t b/tests/test-remotenames.t
--- a/tests/test-remotenames.t
+++ b/tests/test-remotenames.t
@@ -67,3 +67,34 @@
   $ cat .hg/remotenames/branches
   ec2426147f0e39dbc9cef599b066be6035ce691d file:$TESTTMP/server default
   3e1487808078543b0af6d10dadf5d46943578db0 file:$TESTTMP/server wat
+
+Making a new server
+---
+
+  $ cd ..
+  $ hg init server2
+  $ cd server2
+  $ hg pull ../server/
+  pulling from ../server/
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 9 changesets with 9 changes to 9 files (+1 heads)
+  adding remote bookmark bar
+  adding remote bookmark foo
+  (run 'hg heads' to see heads)
+
+Pulling form the new server
+---
+  $ cd ../client/
+  $ hg pull ../server2/
+  pulling from ../server2/
+  searching for changes
+  no changes found
+  $ cat .hg/remotenames/bookmarks
+  87d6d66763085b629e6d7ed56778c79827273022 file:$TESTTMP/server2 bar
+  62615734edd52f06b6fb9c2beb429e4fe30d57b8 file:$TESTTMP/server2 foo
+  $ cat .hg/remotenames/branches
+  ec2426147f0e39dbc9cef599b066be6035ce691d file:$TESTTMP/server2 default
+  3e1487808078543b0af6d10dadf5d46943578db0 file:$TESTTMP/server2 wat



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


D1355: pull: clarify that -u only updates linearly

2017-11-10 Thread martinvonz (Martin von Zweigbergk)
martinvonz 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/D1355

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
@@ -3918,7 +3918,7 @@
 
 @command('^pull',
 [('u', 'update', None,
- _('update to new branch head if changesets were pulled')),
+ _('update to new branch head if new descendants were pulled')),
 ('f', 'force', None, _('run even when remote repository is unrelated')),
 ('r', 'rev', [], _('a remote changeset intended to be added'), _('REV')),
 ('B', 'bookmark', [], _("bookmark to pull"), _('BOOKMARK')),



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


Re: [PATCH] [v2] outgoing: respect ":pushurl" paths (issue5365)

2017-11-10 Thread Hollis Blanchard

Any additional comments?

Hollis Blanchard 
Mentor Graphics Emulation Division

On 11/03/2017 02:07 PM, Hollis Blanchard wrote:

# HG changeset patch
# User Hollis Blanchard 
# Date 1509731952 25200
#  Fri Nov 03 10:59:12 2017 -0700
# Branch stable
# Node ID a952cae0303fa38d1b246561704071d41bbfa1ea
# Parent  f445b10dc7fb3495d24d1c22b0996148864c77f7
[v2] outgoing: respect ":pushurl" paths (issue5365)

Make 'hg outgoing' respect "paths.default:pushurl" in addition to
"paths.default-push".

'hg outgoing' has always meant "what will happen if I run 'hg push'?" and it's
still documented that way:

 Show changesets not found in the specified destination repository or the
 default push location. These are the changesets that would be pushed if a
 push was requested.

If the user uses the now-deprecated "paths.default-push" path, it continues to
work that way. However, as described at
https://bz.mercurial-scm.org/show_bug.cgi?id=5365, it doesn't behave the same
with "paths.default:pushurl".

Why does it matter? Similar to the bugzilla reporter, I have a read-only mirror
of a non-Mercurial repository:

   upstream -> imported mirror -> user clone
  ^---/

Users push directly to upstream, and that content is then imported into the
mirror. However, those repositories are not the same; it's possible that the
mirroring has either broken completely, or an import process is running and not
yet complete. In those cases, 'hg outgoing' will list changesets that have
already been pushed.

Mozilla's desired behavior described in bug 5365 can be accomplished through
other means (e.g. 'hg outgoing default'), preserving the consistency and
meaning of 'hg outgoing'.

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -910,7 +910,11 @@ def incoming(ui, repo, source, opts):
  return _incoming(display, subreporecurse, ui, repo, source, opts)
  
  def _outgoing(ui, repo, dest, opts):

-dest = ui.expandpath(dest or 'default-push', dest or 'default')
+path = ui.paths.getpath(dest, default=('default-push', 'default'))
+if not path:
+raise error.Abort(_('default repository not configured!'),
+hint=_("see 'hg help config.paths'"))
+dest = path.pushloc or path.loc
  dest, branches = parseurl(dest, opts.get('branch'))
  ui.status(_('comparing with %s\n') % util.hidepassword(dest))
  revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev'))
diff --git a/tests/test-incoming-outgoing.t b/tests/test-incoming-outgoing.t
--- a/tests/test-incoming-outgoing.t
+++ b/tests/test-incoming-outgoing.t
@@ -491,3 +491,71 @@ incoming from empty remote repository
searching for changes
no changes found
[1]
+
+Create a "split" repo that pulls from r1 and pushes to r2, using default-push
+
+  $ hg clone r1 split
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ ed -s split/.hg/hgrc << EOF
+  > /^default
+  > a
+  > default-push = file://$TESTTMP/r2
+  > .
+  > w
+  > q
+  > EOF
+  default = $TESTTMP/r1
+  $ hg -R split paths
+  default = $TESTTMP/r1
+  default-push = file://$TESTTMP/r2
+  $ hg -R split outgoing
+  comparing with file://$TESTTMP/r2
+  searching for changes
+  changeset:   0:3e92d79f743a
+  tag: tip
+  user:test
+  date:Thu Jan 01 00:00:00 1970 +
+  summary: a
+
+
+Use default:pushurl instead of default-push
+
+  $ ed -s split/.hg/hgrc < /^default-push
+  > c
+  > default:pushurl = file://$PWD/r2
+  > .
+  > w
+  > EOF
+  default-push = file://$TESTTMP/r2
+  $ hg -R split paths
+  default = $TESTTMP/r1
+  default:pushurl = file://$TESTTMP/r2
+  $ hg -R split outgoing
+  comparing with file://$TESTTMP/r2
+  searching for changes
+  changeset:   0:3e92d79f743a
+  tag: tip
+  user:test
+  date:Thu Jan 01 00:00:00 1970 +
+  summary: a
+
+
+Push and then double-check outgoing
+
+  $ echo a >> split/foo
+  $ hg -R split commit -Ama
+  $ hg -R split push
+  pushing to file://$TESTTMP/r2
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  $ hg -R split outgoing
+  comparing with file://$TESTTMP/r2
+  searching for changes
+  no changes found
+  [1]
+
___
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


[Bug 5737] New: convert is writing invalid lines into .hgtags file starting with "SKIP ..."

2017-11-10 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=5737

Bug ID: 5737
   Summary: convert is writing invalid lines into .hgtags file
starting with "SKIP ..."
   Product: Mercurial
   Version: 4.2.2
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: convert
  Assignee: bugzi...@mercurial-scm.org
  Reporter: sele...@p.dobrogost.net
CC: duri...@gmail.com, mercurial-devel@mercurial-scm.org

In the repo resulting from `hg convert (…)` the file .hgtags contains the
following invalid line:
SKIP 

I found the report from year 2012 on this subject with the proposed patch –
https://www.mercurial-scm.org/pipermail/mercurial-devel/2012-December/047256.html

Was the above patch applied?
What's the status?

Mercurial Distributed SCM (version 4.2.3) – I chose 4.2.2 as Version as there's
no 4.2.3 on the list…

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


D1336: cmdutil: hg rm -A option prints the message of every file in the repo

2017-11-10 Thread pavanpc (Pavan Kumar PC)
pavanpc marked an inline comment as done.
pavanpc added a comment.


  @mharbison72  Thank you for suggesting that. I have updated the phabricator 
titile.

INLINE COMMENTS

> mharbison72 wrote in cmdutil.py:2981
> Sorry I missed this before, but it looks like the return code is changed 
> based on if this case happens. So the “ret = 1” line needs to happen outside 
> of the ui.verbose check.

@mharbison72  I have pulled ret = 1 out of ui.verbose check.

REPOSITORY
  rHG Mercurial

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

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


D1336: Summary: Removing ui.verbose check in the elif comdition.

2017-11-10 Thread pavanpc (Pavan Kumar PC)
pavanpc updated this revision to Diff 3391.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1336?vs=3390&id=3391

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

AFFECTED FILES
  mercurial/cmdutil.py
  tests/test-remove.t

CHANGE DETAILS

diff --git a/tests/test-remove.t b/tests/test-remove.t
--- a/tests/test-remove.t
+++ b/tests/test-remove.t
@@ -168,11 +168,11 @@
   \r (no-eol) (esc)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-20 state added, options -A
+20 state added, options -Av
 
   $ echo b > bar
   $ hg add bar
-  $ remove -A bar
+  $ remove -Av bar
   \r (no-eol) (esc)
   deleting [===>] 1/1\r (no-eol) (esc)
   \r (no-eol) (esc)
@@ -189,9 +189,9 @@
   \r (no-eol) (esc)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-21 state clean, options -A
+21 state clean, options -Av
 
-  $ remove -A foo
+  $ remove -Av foo
   \r (no-eol) (esc)
   deleting [===>] 1/1\r (no-eol) (esc)
   \r (no-eol) (esc)
@@ -205,10 +205,10 @@
   ./foo
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-22 state modified, options -A
+22 state modified, options -Av
 
   $ echo b >> foo
-  $ remove -A foo
+  $ remove -Av foo
   \r (no-eol) (esc)
   deleting [===>] 1/1\r (no-eol) (esc)
   \r (no-eol) (esc)
@@ -233,7 +233,7 @@
   \r (no-eol) (esc)
   deleting [===>] 1/1\r (no-eol) (esc)
   \r (no-eol) (esc)
-  exit code: 0
+  exit code: 1
   R foo
   ? bar
   ./bar
@@ -357,10 +357,10 @@
   \r (no-eol) (esc)
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-dir, options -A
+dir, options -Av
 
   $ rm test/bar
-  $ remove -A test
+  $ remove -Av test
   \r (no-eol) (esc)
   deleting [===>] 1/1\r (no-eol) (esc)
   \r (no-eol) (esc)
@@ -448,14 +448,15 @@
   [1]
   $ hg add d1/a
   $ rm d1/a
-  $ hg rm --after d1
+  $ hg rm --after   d1
   \r (no-eol) (esc)
   deleting [===>] 1/1\r (no-eol) (esc)
   \r (no-eol) (esc)
   \r (no-eol) (esc)
   deleting [===>] 1/1\r (no-eol) (esc)
   \r (no-eol) (esc)
-  removing d1/a (glob)
+  removing d1/a
+  [1]
 
   $ hg rm --after nosuch
   nosuch: * (glob)
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2969,16 +2969,17 @@
 list = modified + deleted + clean + added
 elif after:
 list = deleted
-remaining = modified + added + clean
-total = len(remaining)
-count = 0
-for f in remaining:
-count += 1
-ui.progress(_('skipping'), count, total=total, unit=_('files'))
-warnings.append(_('not removing %s: file still exists\n')
-% m.rel(f))
-ret = 1
-ui.progress(_('skipping'), None)
+if ui.verbose:
+remaining = modified + added + clean
+total = len(remaining)
+count = 0
+for f in remaining:
+count += 1
+ui.progress(_('skipping'), count, total=total, unit=_('files'))
+warnings.append(_('not removing %s: file still exists\n')
+% m.rel(f))
+ui.progress(_('skipping'), None)
+ret = 1
 else:
 list = deleted + clean
 total = len(modified) + len(added)



To: pavanpc, #hg-reviewers
Cc: mitrandir, 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] config: rename allowpull to allow-pull

2017-11-10 Thread David Demelier
# HG changeset patch
# User David Demelier 
# Date 1508406199 -7200
#  Thu Oct 19 11:43:19 2017 +0200
# Node ID 4157480049dabdf7bd54160c909baf13ea8d5107
# Parent  407ec7f3ff02ae357074104fe892adc2b12b42a7
config: rename allowpull to allow-pull

As part of ConfigConsolidationPlan [1], rename the option according to
the new UI guidelines [2] and add an alias for backward compatibility.

[1]: https://www.mercurial-scm.org/wiki/ConfigConsolidationPlan
[2]: https://www.mercurial-scm.org/wiki/UIGuideline#adding_new_options

diff -r 407ec7f3ff02 -r 4157480049da mercurial/configitems.py
--- a/mercurial/configitems.py  Tue Nov 07 13:48:33 2017 -0800
+++ b/mercurial/configitems.py  Thu Oct 19 11:43:19 2017 +0200
@@ -1006,7 +1006,8 @@
 coreconfigitem('web', 'allowgz',
 default=False,
 )
-coreconfigitem('web', 'allowpull',
+coreconfigitem('web', 'allow-pull',
+alias=[('web', 'allowpull')],
 default=True,
 )
 coreconfigitem('web', 'allow_push',
diff -r 407ec7f3ff02 -r 4157480049da mercurial/help/config.txt
--- a/mercurial/help/config.txt Tue Nov 07 13:48:33 2017 -0800
+++ b/mercurial/help/config.txt Thu Oct 19 11:43:19 2017 +0200
@@ -2287,7 +2287,7 @@
 revisions.
 (default: False)
 
-``allowpull``
+``allow-pull``
 Whether to allow pulling from the repository. (default: True)
 
 ``allow_push``
diff -r 407ec7f3ff02 -r 4157480049da mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py  Tue Nov 07 13:48:33 2017 -0800
+++ b/mercurial/hgweb/hgweb_mod.py  Thu Oct 19 11:43:19 2017 +0200
@@ -114,7 +114,7 @@
 self.stripecount = self.configint('web', 'stripes')
 self.maxshortchanges = self.configint('web', 'maxshortchanges')
 self.maxfiles = self.configint('web', 'maxfiles')
-self.allowpull = self.configbool('web', 'allowpull')
+self.allowpull = self.configbool('web', 'allow-pull')
 
 # we use untrusted=False to prevent a repo owner from using
 # web.templates in .hg/hgrc to get access to any file readable
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 2] config: rename allow_push to allow-push

2017-11-10 Thread David Demelier
# HG changeset patch
# User David Demelier 
# Date 1508406401 -7200
#  Thu Oct 19 11:46:41 2017 +0200
# Node ID 7618db2f7c818bcfd73393fff45a13e50fa9250b
# Parent  4157480049dabdf7bd54160c909baf13ea8d5107
config: rename allow_push to allow-push

As part of ConfigConsolidationPlan [1], rename the option according to
the new UI guidelines [2] and add an alias for backward compatibility.

[1]: https://www.mercurial-scm.org/wiki/ConfigConsolidationPlan
[2]: https://www.mercurial-scm.org/wiki/UIGuideline#adding_new_options

diff -r 4157480049da -r 7618db2f7c81 mercurial/commands.py
--- a/mercurial/commands.py Thu Oct 19 11:43:19 2017 +0200
+++ b/mercurial/commands.py Thu Oct 19 11:46:41 2017 +0200
@@ -4695,7 +4695,7 @@
 
 Please note that the server does not implement access control.
 This means that, by default, anybody can read from the server and
-nobody can write to it by default. Set the ``web.allow_push``
+nobody can write to it by default. Set the ``web.allow-push``
 option to ``*`` to allow everybody to push to the server. You
 should use a real web server if you need to authenticate users.
 
diff -r 4157480049da -r 7618db2f7c81 mercurial/configitems.py
--- a/mercurial/configitems.py  Thu Oct 19 11:43:19 2017 +0200
+++ b/mercurial/configitems.py  Thu Oct 19 11:46:41 2017 +0200
@@ -1010,7 +1010,8 @@
 alias=[('web', 'allowpull')],
 default=True,
 )
-coreconfigitem('web', 'allow_push',
+coreconfigitem('web', 'allow-push',
+alias=[('web', 'allow_push')],
 default=list,
 )
 coreconfigitem('web', 'allowzip',
diff -r 4157480049da -r 7618db2f7c81 mercurial/help/config.txt
--- a/mercurial/help/config.txt Thu Oct 19 11:43:19 2017 +0200
+++ b/mercurial/help/config.txt Thu Oct 19 11:46:41 2017 +0200
@@ -2260,7 +2260,7 @@
 you want it to accept pushes from anybody, you can use the following
 command line::
 
-$ hg --config web.allow_push=* --config web.push_ssl=False serve
+$ hg --config web.allow-push=* --config web.push_ssl=False serve
 
 Note that this will allow anybody to push anything to the server and
 that this should not be used for public servers.
@@ -2290,13 +2290,13 @@
 ``allow-pull``
 Whether to allow pulling from the repository. (default: True)
 
-``allow_push``
+``allow-push``
 Whether to allow pushing to the repository. If empty or not set,
 pushing is not allowed. If the special value ``*``, any remote
 user can push, including unauthenticated users. Otherwise, the
 remote user must have been authenticated, and the authenticated
 user name must be present in this list. The contents of the
-allow_push list are examined after the deny_push list.
+allow-push list are examined after the deny_push list.
 
 ``allow_read``
 If the user has not already been denied repository access due to
@@ -2390,7 +2390,7 @@
 push is not denied. If the special value ``*``, all remote users are
 denied push. Otherwise, unauthenticated users are all denied, and
 any authenticated user name present in this list is also denied. The
-contents of the deny_push list are examined before the allow_push list.
+contents of the deny_push list are examined before the allow-push list.
 
 ``deny_read``
 Whether to deny reading/viewing of the repository. If this list is
diff -r 4157480049da -r 7618db2f7c81 mercurial/hgweb/common.py
--- a/mercurial/hgweb/common.py Thu Oct 19 11:43:19 2017 +0200
+++ b/mercurial/hgweb/common.py Thu Oct 19 11:46:41 2017 +0200
@@ -75,7 +75,7 @@
 if deny and (not user or ismember(hgweb.repo.ui, user, deny)):
 raise ErrorResponse(HTTP_UNAUTHORIZED, 'push not authorized')
 
-allow = hgweb.configlist('web', 'allow_push')
+allow = hgweb.configlist('web', 'allow-push')
 if not (allow and ismember(hgweb.repo.ui, user, allow)):
 raise ErrorResponse(HTTP_UNAUTHORIZED, 'push not authorized')
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D1336: Summary: Removing ui.verbose check in the elif comdition.

2017-11-10 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  @pavanpc this might just be me misreading phabricator, but you will want your 
summary to reflect the overall change, because all of the iterations on a 
single patch will be queued as a single commit. So maybe something like:
  
  remove: change the extant file warning with -A to verbose output
  
  Otherwise, there’s output for every file in the path on which the operation 
occurs.
  
  ——— (end of commit message) ———
  
  See here for formatting requirements: 
https://www.mercurial-scm.org/wiki/ContributingChanges

INLINE COMMENTS

> cmdutil.py:2981
> +% m.rel(f))
> +ret = 1
> +ui.progress(_('skipping'), None)

Sorry I missed this before, but it looks like the return code is changed based 
on if this case happens. So the “ret = 1” line needs to happen outside of the 
ui.verbose check.

REPOSITORY
  rHG Mercurial

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

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


[PATCH 1 of 3] paper: apply styles from annotate tooltip to followlines popup

2017-11-10 Thread Anton Shestakov
# HG changeset patch
# User Anton Shestakov 
# Date 1510310743 -28800
#  Fri Nov 10 18:45:43 2017 +0800
# Node ID a78d4fc414f798adcbfcee3237ad71095158718c
# Parent  602c168c0207c443ac61f7a7c727b31cfb0b86ad
paper: apply styles from annotate tooltip to followlines popup

These new colors and styles are already used in the tooltip that gets shown
when user hovers over line numbers on annotate page. The old styles, replaced
in this patch, look completely unrelated to paper or any other hgweb theme.

diff --git a/mercurial/templates/static/style-paper.css 
b/mercurial/templates/static/style-paper.css
--- a/mercurial/templates/static/style-paper.css
+++ b/mercurial/templates/static/style-paper.css
@@ -295,10 +295,9 @@ pre.sourcelines > span.followlines-selec
 }
 
 div#followlines {
-  background-color: #B7B7B7;
-  border: 1px solid #CCC;
-  border-radius: 5px;
-  padding: 4px;
+  background-color: #FFF;
+  border: 1px solid #999;
+  padding: 5px;
   position: fixed;
 }
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 3 of 3] hgweb: add missing semicolons to followlines.js

2017-11-10 Thread Anton Shestakov
# HG changeset patch
# User Anton Shestakov 
# Date 1510312446 -28800
#  Fri Nov 10 19:14:06 2017 +0800
# Node ID 981d7ebd7dc74a88493f39982649a52ed09a199b
# Parent  95cb67784e3c0d05e24e387acda45fd1c8aa4653
hgweb: add missing semicolons to followlines.js

Minor stylistic issues caught by jshint.

diff --git a/mercurial/templates/static/followlines.js 
b/mercurial/templates/static/followlines.js
--- a/mercurial/templates/static/followlines.js
+++ b/mercurial/templates/static/followlines.js
@@ -38,7 +38,7 @@ document.addEventListener('DOMContentLoa
 // element
 var selectableElements = Array.prototype.filter.call(
 sourcelines.children,
-function(x) { return x.tagName === selectableTag });
+function(x) { return x.tagName === selectableTag; });
 
 var btnTitleStart = 'start following lines history from here';
 var btnTitleEnd = 'terminate line block selection here';
@@ -62,7 +62,7 @@ document.addEventListener('DOMContentLoa
 }
 
 // extend DOM with CSS class for selection highlight and action buttons
-var followlinesButtons = []
+var followlinesButtons = [];
 for (var i = 0; i < selectableElements.length; i++) {
 selectableElements[i].classList.add('followlines-select');
 var btn = createButton();
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 3] gitweb: apply styles from annotate tooltip to followlines popup

2017-11-10 Thread Anton Shestakov
# HG changeset patch
# User Anton Shestakov 
# Date 1510311044 -28800
#  Fri Nov 10 18:50:44 2017 +0800
# Node ID 95cb67784e3c0d05e24e387acda45fd1c8aa4653
# Parent  a78d4fc414f798adcbfcee3237ad71095158718c
gitweb: apply styles from annotate tooltip to followlines popup

These new colors and styles are already used in the tooltip that gets shown
when user hovers over line numbers on annotate page. The old styles, replaced
in this patch, look completely unrelated to gitweb or any other hgweb theme.

diff --git a/mercurial/templates/static/style-gitweb.css 
b/mercurial/templates/static/style-gitweb.css
--- a/mercurial/templates/static/style-gitweb.css
+++ b/mercurial/templates/static/style-gitweb.css
@@ -191,10 +191,9 @@ pre.sourcelines > span.followlines-selec
 }
 
 div#followlines {
-  background-color: #B7B7B7;
-  border: 1px solid #CCC;
-  border-radius: 5px;
-  padding: 4px;
+  background-color: #FFF;
+  border: 1px solid #d9d8d1;
+  padding: 5px;
   position: fixed;
 }
 
diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
--- a/tests/test-hgweb.t
+++ b/tests/test-hgweb.t
@@ -340,7 +340,7 @@ static file
 
   $ get-with-headers.py --twice localhost:$HGPORT 'static/style-gitweb.css' - 
date etag server
   200 Script output follows
-  content-length: 9066
+  content-length: 9044
   content-type: text/css
   
   body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; 
border-width:1px; margin:10px; background: white; color: black; }
@@ -536,10 +536,9 @@ static file
   }
   
   div#followlines {
-background-color: #B7B7B7;
-border: 1px solid #CCC;
-border-radius: 5px;
-padding: 4px;
+background-color: #FFF;
+border: 1px solid #d9d8d1;
+padding: 5px;
 position: fixed;
   }
   
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D1336: Summary: Removing ui.verbose check in the elif comdition.

2017-11-10 Thread pavanpc (Pavan Kumar PC)
pavanpc added a comment.


  @mharbison72  Thank you for reviewing this diff. The diff checks for "not 
removing : file still exists". I have removed the ui.verbose check 
from elif.

INLINE COMMENTS

> mharbison72 wrote in cmdutil.py:2970
> Should ui.verbose be nested inside the elif instead?  The -v without -A case 
> would have taken the 'else' case before, so this change seems to affect other 
> things unintentionally.

@mharbison72  We should remove the ui.verbose check and check for verbose 
inside elif. I have made the change.

REPOSITORY
  rHG Mercurial

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

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


D1336: Summary: Removing ui.verbose check in the elif comdition.

2017-11-10 Thread pavanpc (Pavan Kumar PC)
pavanpc updated this revision to Diff 3390.
pavanpc edited the test plan for this revision.
pavanpc retitled this revision from "HG: hg rm -A option prints the message of 
every file in the repo" to "Summary:  Removing ui.verbose check in the elif 
comdition.".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1336?vs=&id=3390

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

AFFECTED FILES
  mercurial/cmdutil.py
  tests/test-remove.t

CHANGE DETAILS

diff --git a/tests/test-remove.t b/tests/test-remove.t
--- a/tests/test-remove.t
+++ b/tests/test-remove.t
@@ -168,11 +168,11 @@
   \r (no-eol) (esc)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-20 state added, options -A
+20 state added, options -Av
 
   $ echo b > bar
   $ hg add bar
-  $ remove -A bar
+  $ remove -Av bar
   \r (no-eol) (esc)
   deleting [===>] 1/1\r (no-eol) (esc)
   \r (no-eol) (esc)
@@ -189,9 +189,9 @@
   \r (no-eol) (esc)
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-21 state clean, options -A
+21 state clean, options -Av
 
-  $ remove -A foo
+  $ remove -Av foo
   \r (no-eol) (esc)
   deleting [===>] 1/1\r (no-eol) (esc)
   \r (no-eol) (esc)
@@ -205,10 +205,10 @@
   ./foo
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-22 state modified, options -A
+22 state modified, options -Av
 
   $ echo b >> foo
-  $ remove -A foo
+  $ remove -Av foo
   \r (no-eol) (esc)
   deleting [===>] 1/1\r (no-eol) (esc)
   \r (no-eol) (esc)
@@ -357,10 +357,10 @@
   \r (no-eol) (esc)
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-dir, options -A
+dir, options -Av
 
   $ rm test/bar
-  $ remove -A test
+  $ remove -Av test
   \r (no-eol) (esc)
   deleting [===>] 1/1\r (no-eol) (esc)
   \r (no-eol) (esc)
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2969,16 +2969,17 @@
 list = modified + deleted + clean + added
 elif after:
 list = deleted
-remaining = modified + added + clean
-total = len(remaining)
-count = 0
-for f in remaining:
-count += 1
-ui.progress(_('skipping'), count, total=total, unit=_('files'))
-warnings.append(_('not removing %s: file still exists\n')
-% m.rel(f))
-ret = 1
-ui.progress(_('skipping'), None)
+if ui.verbose:
+remaining = modified + added + clean
+total = len(remaining)
+count = 0
+for f in remaining:
+count += 1
+ui.progress(_('skipping'), count, total=total, unit=_('files'))
+warnings.append(_('not removing %s: file still exists\n')
+% m.rel(f))
+ret = 1
+ui.progress(_('skipping'), None)
 else:
 list = deleted + clean
 total = len(modified) + len(added)



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