[PATCH 4 of 5] help: explain what the term "revset" means

2017-01-11 Thread Martin von Zweigbergk via Mercurial-devel
# HG changeset patch
# User Martin von Zweigbergk 
# Date 1484203567 28800
#  Wed Jan 11 22:46:07 2017 -0800
# Node ID f4f54de30261c007dd9565c5b0007d2d6a9c3665
# Parent  03f51cd7c078e769a8db3c4fceebd2e24a7fbc69
help: explain what the term "revset" means

We refer to revsets in a few places (e.g. in "hg help config"), but we
never explained what they are. Until now.

diff -r 03f51cd7c078 -r f4f54de30261 mercurial/help/revisions.txt
--- a/mercurial/help/revisions.txt  Wed Jan 11 11:37:38 2017 -0800
+++ b/mercurial/help/revisions.txt  Wed Jan 11 22:46:07 2017 -0800
@@ -33,7 +33,7 @@
 =
 
 Mercurial supports a functional language for selecting a set of
-revisions.
+revisions. Expressions in this language are called revsets.
 
 The language supports a number of predicates which are joined by infix
 operators. Parenthesis can be used for grouping.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 5 of 5] help: explain that revsets can be used where 1 or 2 revs are wanted

2017-01-11 Thread Martin von Zweigbergk via Mercurial-devel
# HG changeset patch
# User Martin von Zweigbergk 
# Date 1484205180 28800
#  Wed Jan 11 23:13:00 2017 -0800
# Node ID a997378ca98dad8fd8daed6cc4e73b5c2badcef6
# Parent  f4f54de30261c007dd9565c5b0007d2d6a9c3665
help: explain that revsets can be used where 1 or 2 revs are wanted

We did not seem to document that one can do things like "hg up :@"
where the last revision of the revset ":@".

diff -r f4f54de30261 -r a997378ca98d mercurial/help/revisions.txt
--- a/mercurial/help/revisions.txt  Wed Jan 11 22:46:07 2017 -0800
+++ b/mercurial/help/revisions.txt  Wed Jan 11 23:13:00 2017 -0800
@@ -29,6 +29,12 @@
 uncommitted merge is in progress, "." is the revision of the first
 parent.
 
+Finally, commands that expect a single revision (like ``hg update``) also
+accept revsets (see below for details). When given a revset, they use the
+last revision of the revset. A few commands accept two single revisions
+(like ``hg diff``). When given a revset, they use the first and the last
+revisions of the revset.
+
 Specifying multiple revisions
 =
 
@@ -188,3 +194,13 @@
   release::
 
 hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tag())"
+
+- Update to commit that bookmark @ is pointing too, without activating the
+  bookmark (this works because the last revision of the revset is used)::
+
+hg update :@
+
+- Show diff between tags 1.3 and 1.5 (this works because the first and the
+  last revisions of the revset are used)::
+
+hg diff -r 1.3::1.5
diff -r f4f54de30261 -r a997378ca98d tests/test-extension.t
--- a/tests/test-extension.tWed Jan 11 22:46:07 2017 -0800
+++ b/tests/test-extension.tWed Jan 11 23:13:00 2017 -0800
@@ -731,14 +731,14 @@
   $ echo "multirevs = multirevs.py" >> $HGRCPATH
 
   $ hg help multirevs | tail
+bookmark (this works because the last revision of the revset is used):
   
-  - Changesets committed in May 2008, sorted by user:
+  hg update :@
   
-  hg log -r "sort(date('May 2008'), user)"
+  - Show diff between tags 1.3 and 1.5 (this works because the first and 
the
+last revisions of the revset are used):
   
-  - Changesets mentioning "bug" or "issue" that are not in a tagged 
release:
-  
-  hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tag())"
+  hg diff -r 1.3::1.5
   
   use 'hg help -c multirevs' to see help for the multirevs command
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 5] tests: use `hg help dates` instead of `hg help revs` in test

2017-01-11 Thread Martin von Zweigbergk via Mercurial-devel
# HG changeset patch
# User Martin von Zweigbergk 
# Date 1484163640 28800
#  Wed Jan 11 11:40:40 2017 -0800
# Node ID e57922b04e9004bd580888148b4cb898b629b7b2
# Parent  b75ebd3e375f85852b81aabc64639457ff796328
tests: use `hg help dates` instead of `hg help revs` in test

The revisions help is already long and will get longer, so switch to
another short and stable topic.

diff -r b75ebd3e375f -r e57922b04e90 tests/test-help.t
--- a/tests/test-help.t Wed Jan 11 11:28:54 2017 -0800
+++ b/tests/test-help.t Wed Jan 11 11:40:40 2017 -0800
@@ -1154,37 +1154,49 @@
 
 Test a help topic
 
-  $ hg help revs
-  Specifying Single Revisions
-  """
-  
-  Mercurial supports several ways to specify individual revisions.
-  
-  A plain integer is treated as a revision number. Negative integers are
-  treated as sequential offsets from the tip, with -1 denoting the tip, -2
-  denoting the revision prior to the tip, and so forth.
-  
-  A 40-digit hexadecimal string is treated as a unique revision identifier.
-  A hexadecimal string less than 40 characters long is treated as a unique
-  revision identifier and is referred to as a short-form identifier. A
-  short-form identifier is only valid if it is the prefix of exactly one
-  full-length identifier.
-  
-  Any other string is treated as a bookmark, tag, or branch name. A 
bookmark
-  is a movable pointer to a revision. A tag is a permanent name associated
-  with a revision. A branch name denotes the tipmost open branch head of
-  that branch - or if they are all closed, the tipmost closed head of the
-  branch. Bookmark, tag, and branch names must not contain the ":"
-  character.
-  
-  The reserved name "tip" always identifies the most recent revision.
-  
-  The reserved name "null" indicates the null revision. This is the 
revision
-  of an empty repository, and the parent of revision 0.
-  
-  The reserved name "." indicates the working directory parent. If no
-  working directory is checked out, it is equivalent to null. If an
-  uncommitted merge is in progress, "." is the revision of the first 
parent.
+  $ hg help dates
+  Date Formats
+  
+  
+  Some commands allow the user to specify a date, e.g.:
+  
+  - backout, commit, import, tag: Specify the commit date.
+  - log, revert, update: Select revision(s) by date.
+  
+  Many date formats are valid. Here are some examples:
+  
+  - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
+  - "Dec 6 13:18 -0600" (year assumed, time offset provided)
+  - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +)
+  - "Dec 6" (midnight)
+  - "13:18" (today assumed)
+  - "3:39" (3:39AM assumed)
+  - "3:39pm" (15:39)
+  - "2006-12-06 13:18:29" (ISO 8601 format)
+  - "2006-12-6 13:18"
+  - "2006-12-6"
+  - "12-6"
+  - "12/6"
+  - "12/6/6" (Dec 6 2006)
+  - "today" (midnight)
+  - "yesterday" (midnight)
+  - "now" - right now
+  
+  Lastly, there is Mercurial's internal format:
+  
+  - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
+  
+  This is the internal representation format for dates. The first number is
+  the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
+  is the offset of the local timezone, in seconds west of UTC (negative if
+  the timezone is east of UTC).
+  
+  The log command also accepts date ranges:
+  
+  - "DATE" - on or after a given date/time
+  - "DATE to DATE" - a date range, inclusive
+  - "-DAYS" - within a given number of days of today
 
 Test repeated config section name
 
@@ -2729,7 +2741,7 @@
   
   
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT "help/revisions"
+  $ get-with-headers.py 127.0.0.1:$HGPORT "help/dates"
   200 Script output follows
   
   http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
@@ -2740,7 +2752,7 @@
   
   
   
-  Help: revisions
+  Help: dates
   
   
   
@@ -2764,7 +2776,7 @@
   
   
   Mercurial 
-  Help: revisions
+  Help: dates
   
   
   
@@ -2773,42 +2785,56 @@
   number or hash, or revset expression.
   
   
-  Specifying Single Revisions
+  Date Formats
   
-  Mercurial supports several ways to specify individual revisions.
+  Some commands allow the user to specify a date, e.g.:
   
+  
+backout, commit, import, tag: Specify the commit date.
+log, revert, update: Select revision(s) by date.
+  
   
-  A plain integer is treated as a revision number. Negative integers are
-  treated as sequential offsets from the tip, with -1 denoting the tip,
-  -2 denoting the revision prior to the tip, and so forth.
+  Many date formats are valid. Here are some examples:
   
+  
+"Wed Dec 6 13:18:29 2006" (local timezone assumed)
+"Dec 6 13:18 -0600" (year assumed, time offset provided)
+"Dec 6 13:18 UTC" (UTC and GMT are aliases for +)
+"Dec 6" (midnight)
+"13:18" (today assumed)
+"

[PATCH 3 of 5] help: merge revsets.txt into revisions.txt

2017-01-11 Thread Martin von Zweigbergk via Mercurial-devel
# HG changeset patch
# User Martin von Zweigbergk 
# Date 1484163458 28800
#  Wed Jan 11 11:37:38 2017 -0800
# Node ID 03f51cd7c078e769a8db3c4fceebd2e24a7fbc69
# Parent  e57922b04e9004bd580888148b4cb898b629b7b2
help: merge revsets.txt into revisions.txt

Selecting single and multiple revisions is closely related, so let's
put it in one place, so users can easily find it. We actually did not
even point to "hg help revsets" from "hg help revisions", but now that
they're on a single page, that won't be necessary.

diff -r e57922b04e90 -r 03f51cd7c078 contrib/wix/help.wxs
--- a/contrib/wix/help.wxs  Wed Jan 11 11:40:40 2017 -0800
+++ b/contrib/wix/help.wxs  Wed Jan 11 11:37:38 2017 -0800
@@ -28,7 +28,6 @@
   
   
   
-  
   
   
   
diff -r e57922b04e90 -r 03f51cd7c078 mercurial/help.py
--- a/mercurial/help.py Wed Jan 11 11:40:40 2017 -0800
+++ b/mercurial/help.py Wed Jan 11 11:37:38 2017 -0800
@@ -210,10 +210,8 @@
 (["patterns"], _("File Name Patterns"), loaddoc('patterns')),
 (['environment', 'env'], _('Environment Variables'),
  loaddoc('environment')),
-(['revisions', 'revs'], _('Specifying Single Revisions'),
- loaddoc('revisions')),
-(['revsets', 'revset', 'multirevs', 'mrevs'],
- _("Specifying Revision Sets"), loaddoc('revsets')),
+(['revisions', 'revs', 'revsets', 'revset', 'multirevs', 'mrevs'],
+  _('Specifying Revisions'), loaddoc('revisions')),
 (['filesets', 'fileset'], _("Specifying File Sets"), loaddoc('filesets')),
 (['diffs'], _('Diff Formats'), loaddoc('diffs')),
 (['merge-tools', 'mergetools'], _('Merge Tools'), loaddoc('merge-tools')),
@@ -280,7 +278,7 @@
 addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols)
 addtopicsymbols('merge-tools', '.. internaltoolsmarker',
 filemerge.internalsdoc)
-addtopicsymbols('revsets', '.. predicatesmarker', revset.symbols)
+addtopicsymbols('revisions', '.. predicatesmarker', revset.symbols)
 addtopicsymbols('templates', '.. keywordsmarker', templatekw.keywords)
 addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
 addtopicsymbols('templates', '.. functionsmarker', templater.funcs)
diff -r e57922b04e90 -r 03f51cd7c078 mercurial/help/revisions.txt
--- a/mercurial/help/revisions.txt  Wed Jan 11 11:40:40 2017 -0800
+++ b/mercurial/help/revisions.txt  Wed Jan 11 11:37:38 2017 -0800
@@ -1,4 +1,7 @@
-Mercurial supports several ways to specify individual revisions.
+Mercurial supports several ways to specify revisions.
+
+Specifying single revisions
+===
 
 A plain integer is treated as a revision number. Negative integers are
 treated as sequential offsets from the tip, with -1 denoting the tip,
@@ -25,3 +28,163 @@
 working directory is checked out, it is equivalent to null. If an
 uncommitted merge is in progress, "." is the revision of the first
 parent.
+
+Specifying multiple revisions
+=
+
+Mercurial supports a functional language for selecting a set of
+revisions.
+
+The language supports a number of predicates which are joined by infix
+operators. Parenthesis can be used for grouping.
+
+Identifiers such as branch names may need quoting with single or
+double quotes if they contain characters like ``-`` or if they match
+one of the predefined predicates.
+
+Special characters can be used in quoted identifiers by escaping them,
+e.g., ``\n`` is interpreted as a newline. To prevent them from being
+interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``.
+
+Operators
+=
+
+There is a single prefix operator:
+
+``not x``
+  Changesets not in x. Short form is ``! x``.
+
+These are the supported infix operators:
+
+``x::y``
+  A DAG range, meaning all changesets that are descendants of x and
+  ancestors of y, including x and y themselves. If the first endpoint
+  is left out, this is equivalent to ``ancestors(y)``, if the second
+  is left out it is equivalent to ``descendants(x)``.
+
+  An alternative syntax is ``x..y``.
+
+``x:y``
+  All changesets with revision numbers between x and y, both
+  inclusive. Either endpoint can be left out, they default to 0 and
+  tip.
+
+``x and y``
+  The intersection of changesets in x and y. Short form is ``x & y``.
+
+``x or y``
+  The union of changesets in x and y. There are two alternative short
+  forms: ``x | y`` and ``x + y``.
+
+``x - y``
+  Changesets in x but not in y.
+
+``x % y``
+  Changesets that are ancestors of x but not ancestors of y (i.e. ::x - ::y).
+  This is shorthand notation for ``only(x, y)`` (see below). The second
+  argument is optional and, if left out, is equivalent to ``only(x)``.
+
+``x^n``
+  The nth parent of x, n == 0, 1, or 2.
+  For n == 0, x; for n == 1, the first parent of each changeset in x;
+  for n == 2, the second parent of changeset in x.
+
+``x~n``
+  The nth first ancestor of x; ``x~0`` is x; ``x~3`` is ``x^^^``.
+
+``x ## y``
+  Concaten

[PATCH 1 of 5] help: use a single paragraph to describe full and abbreviated nodeids

2017-01-11 Thread Martin von Zweigbergk via Mercurial-devel
# HG changeset patch
# User Martin von Zweigbergk 
# Date 1484162934 28800
#  Wed Jan 11 11:28:54 2017 -0800
# Node ID b75ebd3e375f85852b81aabc64639457ff796328
# Parent  493935e0327a2dca0987a702bf06fa89b62e6a5c
help: use a single paragraph to describe full and abbreviated nodeids

The texts describing 40-digit strings and the abbreviated form are
closely related, so make it a single paragraph.

diff -r 493935e0327a -r b75ebd3e375f mercurial/help/revisions.txt
--- a/mercurial/help/revisions.txt  Tue Jan 10 06:59:31 2017 +0800
+++ b/mercurial/help/revisions.txt  Wed Jan 11 11:28:54 2017 -0800
@@ -4,9 +4,7 @@
 treated as sequential offsets from the tip, with -1 denoting the tip,
 -2 denoting the revision prior to the tip, and so forth.
 
-A 40-digit hexadecimal string is treated as a unique revision
-identifier.
-
+A 40-digit hexadecimal string is treated as a unique revision identifier.
 A hexadecimal string less than 40 characters long is treated as a
 unique revision identifier and is referred to as a short-form
 identifier. A short-form identifier is only valid if it is the prefix
diff -r 493935e0327a -r b75ebd3e375f tests/test-help.t
--- a/tests/test-help.t Tue Jan 10 06:59:31 2017 +0800
+++ b/tests/test-help.t Wed Jan 11 11:28:54 2017 -0800
@@ -1165,7 +1165,6 @@
   denoting the revision prior to the tip, and so forth.
   
   A 40-digit hexadecimal string is treated as a unique revision identifier.
-  
   A hexadecimal string less than 40 characters long is treated as a unique
   revision identifier and is referred to as a short-form identifier. A
   short-form identifier is only valid if it is the prefix of exactly one
@@ -2784,10 +2783,7 @@
   -2 denoting the revision prior to the tip, and so forth.
   
   
-  A 40-digit hexadecimal string is treated as a unique revision
-  identifier.
-  
-  
+  A 40-digit hexadecimal string is treated as a unique revision identifier.
   A hexadecimal string less than 40 characters long is treated as a
   unique revision identifier and is referred to as a short-form
   identifier. A short-form identifier is only valid if it is the prefix
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[Bug 5464] New: notification email of subscribed wiki page still uses "selenic.com" domain in some headers

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

Bug ID: 5464
   Summary: notification email of subscribed wiki page still uses
"selenic.com" domain in some headers
   Product: Mercurial
   Version: unspecified
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: wiki
  Assignee: mercurial-de...@selenic.com
  Reporter: fo...@lares.dti.ne.jp
CC: mercurial-de...@selenic.com

I noticed that recent notification emails of 4.2sprint wiki page still
use "mercurial-w...@selenic.com" in "From:", "To:", and "Return-Path:".

Is this email address still valid ?

-- 
You are receiving this mail because:
You are the assignee for the bug.
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


Re: [PATCH] rebase: provide detailed hint to abort message if working dir is not clean

2017-01-11 Thread Gregory Szorc


> On Jan 10, 2017, at 07:42, Augie Fackler  wrote:
> 
>> On Tue, Jan 10, 2017 at 12:48:34PM +0100, Valters Vingolds wrote:
>> # HG changeset patch
>> # User Valters Vingolds 
>> # Date 1484037147 -3600
>> #  Tue Jan 10 09:32:27 2017 +0100
>> # Node ID 90b94e9a35acd2f8b7ec74211a0b3e01fe70215b
>> # Parent  656598cf7dd2204dc3553c10e1ac83dc5db8f296
>> rebase: provide detailed hint to abort message if working dir is not clean
> 
> Queued, thanks!

Thank you for following up with this improvement, Valters! Small enhancements 
like this that help people in times of confusion really matter to product 
usability and enjoyment.

> 
>> 
>> Detailed hint message is now provided when 'pull --rebase' operation detects
>> unclean working dir, for example:
>>  abort: uncommitted changes
>>  (cannot pull with rebase: please commit or shelve your changes first)
>> 
>> Added tests for uncommitted merge, and for subrepo support verifying that 
>> same
>> hint is also passed to subrepo state check.
>> 
>> diff --git a/hgext/rebase.py b/hgext/rebase.py
>> --- a/hgext/rebase.py
>> +++ b/hgext/rebase.py
>> @@ -1316,9 +1316,9 @@
>> ui.debug('--update and --rebase are not compatible, ignoring 
>> '
>>  'the update flag\n')
>> 
>> -ui.debug('before rebase: ensure working dir is clean\n')
>> cmdutil.checkunfinished(repo)
>> -cmdutil.bailifchanged(repo)
>> +cmdutil.bailifchanged(repo, hint=_('cannot pull with rebase: '
>> +'please commit or shelve your changes first'))
>> 
>> revsprepull = len(repo)
>> origpostincoming = commands.postincoming
>> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
>> --- a/mercurial/cmdutil.py
>> +++ b/mercurial/cmdutil.py
>> @@ -355,15 +355,23 @@
>> 
>> return p
>> 
>> -def bailifchanged(repo, merge=True):
>> +def bailifchanged(repo, merge=True, hint=None):
>> +""" enforce the precondition that working directory must be clean.
>> +
>> +'merge' can be set to false if a pending uncommitted merge should be
>> +ignored (such as when 'update --check' runs).
>> +
>> +'hint' is the usual hint given to Abort exception.
>> +"""
>> +
>> if merge and repo.dirstate.p2() != nullid:
>> -raise error.Abort(_('outstanding uncommitted merge'))
>> +raise error.Abort(_('outstanding uncommitted merge'), hint=hint)
>> modified, added, removed, deleted = repo.status()[:4]
>> if modified or added or removed or deleted:
>> -raise error.Abort(_('uncommitted changes'))
>> +raise error.Abort(_('uncommitted changes'), hint=hint)
>> ctx = repo[None]
>> for s in sorted(ctx.substate):
>> -ctx.sub(s).bailifchanged()
>> +ctx.sub(s).bailifchanged(hint=hint)
>> 
>> def logmessage(ui, opts):
>> """ get the log message according to -m and -l option """
>> diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
>> --- a/mercurial/subrepo.py
>> +++ b/mercurial/subrepo.py
>> @@ -464,12 +464,12 @@
>> return _("uncommitted changes in subrepository '%s'"
>>  ) % subrelpath(self)
>> 
>> -def bailifchanged(self, ignoreupdate=False):
>> +def bailifchanged(self, ignoreupdate=False, hint=None):
>> """raise Abort if subrepository is ``dirty()``
>> """
>> dirtyreason = self.dirtyreason(ignoreupdate=ignoreupdate)
>> if dirtyreason:
>> -raise error.Abort(dirtyreason)
>> +raise error.Abort(dirtyreason, hint=hint)
>> 
>> def basestate(self):
>> """current working directory base state, disregarding .hgsubstate
>> diff --git a/tests/test-rebase-pull.t b/tests/test-rebase-pull.t
>> --- a/tests/test-rebase-pull.t
>> +++ b/tests/test-rebase-pull.t
>> @@ -78,6 +78,7 @@
>>   $ echo L1-mod > L1
>>   $ hg pull --rebase
>>   abort: uncommitted changes
>> +  (cannot pull with rebase: please commit or shelve your changes first)
>>   [255]
>>   $ hg update --clean --quiet
>> 
>> @@ -95,6 +96,41 @@
>>   [255]
>>   $ hg histedit --abort --quiet
>> 
>> +Abort pull early with pending uncommitted merge:
>> +
>> +  $ cd ..
>> +  $ hg clone --noupdate c d
>> +  $ cd d
>> +  $ hg tglog
>> +  o  1: 'C2'
>> +  |
>> +  o  0: 'C1'
>> +
>> +  $ hg update --quiet 0
>> +  $ echo M1 > M1
>> +  $ hg commit --quiet -Am M1
>> +  $ hg update --quiet 1
>> +  $ hg merge 2
>> +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>> +  (branch merge, don't forget to commit)
>> +  $ hg pull --rebase
>> +  abort: outstanding uncommitted merge
>> +  (cannot pull with rebase: please commit or shelve your changes first)
>> +  [255]
>> +  $ hg update --clean --quiet
>> +
>> +Abort pull early with unclean subrepo:
>> +  $ echo s = s > .hgsub
>> +  $ hg add .hgsub
>> +  $ hg init s
>> +  $ hg commit -m "generated a subrepo"
>> +  $ echo a > s/a
>> +  $ hg -R s add s/a
>> +  $ hg pull --rebase
>> +  abort: uncommitted changes in subrepository 's

Re: [PATCH] hgweb: call process_dates() via DOM event listener

2017-01-11 Thread Gregory Szorc


> On Jan 11, 2017, at 21:43, Anton Shestakov  wrote:
> 
> On Wed, 11 Jan 2017 19:38:17 -0800
> Gregory Szorc  wrote:
> 
>> # HG changeset patch
>> # User Gregory Szorc 
>> # Date 1484110068 28800
>> #  Tue Jan 10 20:47:48 2017 -0800
>> # Node ID 79314c9a79b3aa033b6f79d066b97d7157ecac33
>> # Parent  9cb0bb0f29f06fa88ac4f41d8743871b33c48548
>> hgweb: call process_dates() via DOM event listener
>> 
>> All the hgweb templates include mercurial.js in their header. All
>> the hgweb templates have the same 

[PATCH 3 of 3] revset: point to 'grep' in the 'keyword' help for regex searches

2017-01-11 Thread Matt Harbison
# HG changeset patch
# User Matt Harbison 
# Date 1484194431 18000
#  Wed Jan 11 23:13:51 2017 -0500
# Node ID 1d88ac8809e20256e3702f25c77a411a53367474
# Parent  41eac69037f03733374ea658a6a13de3973860bc
revset: point to 'grep' in the 'keyword' help for regex searches

The help for 'grep' already points to 'keyword'.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -1253,6 +1253,9 @@
 def keyword(repo, subset, x):
 """Search commit message, user name, and names of changed files for
 string. The match is case-insensitive.
+
+For a regular expression or case sensitive search of these fields, use
+``grep(regex)``.
 """
 # i18n: "keyword" is a keyword
 kw = encoding.lower(getstring(x, _("keyword requires a string")))
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 3] revset: stop lowercasing the regex pattern for 'author'

2017-01-11 Thread Matt Harbison
# HG changeset patch
# User Matt Harbison 
# Date 1484192530 18000
#  Wed Jan 11 22:42:10 2017 -0500
# Node ID 41eac69037f03733374ea658a6a13de3973860bc
# Parent  73c65ceadc057eab288061b44e18254f674e88c6
revset: stop lowercasing the regex pattern for 'author'

It was probably unintentional for regex, as the meaning of some sequences like
\S and \s is actually inverted by changing the case.  For backward compatibility
however, the matching is forced to case insensitive.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -556,9 +556,9 @@
 """Alias for ``user(string)``.
 """
 # i18n: "author" is a keyword
-n = encoding.lower(getstring(x, _("author requires a string")))
-kind, pattern, matcher = _substringmatcher(n)
-return subset.filter(lambda x: matcher(encoding.lower(repo[x].user())),
+n = getstring(x, _("author requires a string"))
+kind, pattern, matcher = _substringmatcher(n, casesensitive=False)
+return subset.filter(lambda x: matcher(repo[x].user()),
  condrepr=('', n))
 
 @predicate('bisect(string)', safe=True)
@@ -2246,10 +2246,12 @@
 
 return subset.filter(matches, condrepr=('', pat))
 
-def _substringmatcher(pattern):
-kind, pattern, matcher = util.stringmatcher(pattern)
+def _substringmatcher(pattern, casesensitive=True):
+kind, pattern, matcher = util.stringmatcher(pattern,
+casesensitive=casesensitive)
 if kind == 'literal':
-matcher = lambda s: pattern in s
+pattern = encoding.lower(pattern)
+matcher = lambda s: pattern in encoding.lower(s)
 return kind, pattern, matcher
 
 @predicate('tag([name])', safe=True)
diff --git a/tests/test-revset.t b/tests/test-revset.t
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -865,6 +865,17 @@
   7
   8
   9
+  $ log 'author(r"re:\S")'
+  0
+  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
   $ log 'branch(é)'
   8
   9
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] hgweb: call process_dates() via DOM event listener

2017-01-11 Thread Anton Shestakov
On Wed, 11 Jan 2017 19:38:17 -0800
Gregory Szorc  wrote:

> # HG changeset patch
> # User Gregory Szorc 
> # Date 1484110068 28800
> #  Tue Jan 10 20:47:48 2017 -0800
> # Node ID 79314c9a79b3aa033b6f79d066b97d7157ecac33
> # Parent  9cb0bb0f29f06fa88ac4f41d8743871b33c48548
> hgweb: call process_dates() via DOM event listener
> 
> All the hgweb templates include mercurial.js in their header. All
> the hgweb templates have the same 

[PATCH 1 of 3] util: teach stringmatcher to handle forced case insensitive matches

2017-01-11 Thread Matt Harbison
# HG changeset patch
# User Matt Harbison 
# Date 1484189239 18000
#  Wed Jan 11 21:47:19 2017 -0500
# Node ID 73c65ceadc057eab288061b44e18254f674e88c6
# Parent  493935e0327a2dca0987a702bf06fa89b62e6a5c
util: teach stringmatcher to handle forced case insensitive matches

The 'author' and 'desc' revsets are documented to be case insensitive.
Unfortunately, this was implemented in 'author' by forcing the input to
lowercase, including for regex like '\B'.  (This actually inverts the meaning of
the sequence.)  For backward compatibility, we will keep that a case insensitive
regex, but by using matcher options instead of brute force.

This doesn't preclude future hypothetical 'icase-literal:' style prefixes that
can be provided by the user.  Such user specified cases can probably be handled
up front by stripping 'icase-', setting the variable, and letting it drop
through the existing code.

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1990,7 +1990,7 @@
 start, stop = lower(date), upper(date)
 return lambda x: x >= start and x <= stop
 
-def stringmatcher(pattern):
+def stringmatcher(pattern, casesensitive=True):
 """
 accepts a string, possibly starting with 're:' or 'literal:' prefix.
 returns the matcher name, pattern, and matcher function.
@@ -2000,6 +2000,9 @@
 >>> def test(pattern, *tests):
 ... kind, pattern, matcher = stringmatcher(pattern)
 ... return (kind, pattern, [bool(matcher(t)) for t in tests])
+>>> def itest(pattern, *tests):
+... kind, pattern, matcher = stringmatcher(pattern, 
casesensitive=False)
+... return (kind, pattern, [bool(matcher(t)) for t in tests])
 
 exact matching (no prefix):
 >>> test('abcdefg', 'abc', 'def', 'abcdefg')
@@ -2016,18 +2019,35 @@
 unknown prefixes are ignored and treated as literals
 >>> test('foo:bar', 'foo', 'bar', 'foo:bar')
 ('literal', 'foo:bar', [False, False, True])
+
+case insensitive regex matches
+>>> itest('re:A.+b', 'nomatch', 'fooadef', 'fooadefBar')
+('re', 'A.+b', [False, False, True])
+
+case insensitive literal matches
+>>> itest('ABCDEFG', 'abc', 'def', 'abcdefg')
+('literal', 'ABCDEFG', [False, False, True])
 """
 if pattern.startswith('re:'):
 pattern = pattern[3:]
 try:
-regex = remod.compile(pattern)
+flags = 0
+if not casesensitive:
+flags = remod.I
+regex = remod.compile(pattern, flags)
 except remod.error as e:
 raise error.ParseError(_('invalid regular expression: %s')
% e)
 return 're', pattern, regex.search
 elif pattern.startswith('literal:'):
 pattern = pattern[8:]
-return 'literal', pattern, pattern.__eq__
+
+match = pattern.__eq__
+
+if not casesensitive:
+ipat = encoding.lower(pattern)
+match = lambda s: ipat == encoding.lower(s)
+return 'literal', pattern, match
 
 def shortuser(user):
 """Return a short representation of a user name or email address."""
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] revset: introduce the summary predicate

2017-01-11 Thread Matt Harbison

On Wed, 11 Jan 2017 09:15:28 -0500, Yuya Nishihara  wrote:


On Tue, 10 Jan 2017 20:09:45 -0500, Matt Harbison wrote:
On Mon, 09 Jan 2017 23:33:17 -0500, Matt Harbison  


wrote:
> On Mon, 09 Jan 2017 05:49:23 -0500, Pierre-Yves David
>> * predicate
>> * default behavior
>> * support 'rich' stringmatcher ?
>> * are 'literal:' case sensitive ?
>> * are 're:' case sensitive (and supported at all) ?
>
> TL;DR: desc, grep, keyword, and author/user are the oddballs.  grep  
and

> keyword are the regex and literal halves respectively, of the same
> search.
>
> After stripping out non string predicates, we basically end up with 4
> groups:
>
> - util.stringmatcher based:
>
>  Predicate:Case Sensitive?
>  "author"   N
>  "user" N
>  "bookmark" Y
>  "branch"   Y
>  "extra"Y
>  "named"Y
>  "subrepo"  [1] Y
>  "tag"  Y
>
> These all support 'literal:' and 're:'.  Case sensitivity applies the
> same to both prefixes, and raw pattern.
>
> [1] Not documented to support 'literal:' or 're:' prefixes.
>
>
> - Local method implementation based:
>
>  Predicate:Case Sensitive?
>  "desc" N
>  "grep" Y
>  "keyword"  N
>
> None of these support prefixes.  The grep param is a regex without
> 're:', so it doesn't make a lot of sense to support stringmatcher  
here-
> what stringmatcher thinks is literal is really regex.  If we  
internally

> bolt on 're:', it still can't support literal matches.
>
>
> - match.py based (not relevant, but for completeness):
>
>  "adds", "contains", "file", "filelog", "follow",
>  "followlines", "modifies", "removes"
>
> - "bisect" (I can't see how 're:' support here would be meaningful.)
>
>
>>  From there we'll be able to see if a pattern emerge and pick the  
best

>> way to move forward.


Thanks for the nice summary. Inline comments follow.


> The following thoughts come to mind:
>
> A) author/user has been thoroughly corrupted with the lower casing.
> Maybe come up with a 3rd one that follows modern rules, and
> deprecate/hide these?  Sad, because these seem natural.  OTOH, having
> raw pattern and prefixed patterns behave the same everywhere is  
elegant

> and simple.  Not sure what to call it.  'committer' comes to mind, but
> that has git implications.  That was suggested when I proposed  
recording
> who performed a graft in the 'extra' dict.  Then it was pointed out  
this
> tracking was related to the chain of custody proposal by Greg, so I  
let
> it drop [1].  My enthusiasm was dampened some when I saw templates  
also
> have {author} and {user}, though the latter is a filter, not a  
reference

> to the field.
>
> [1]
>  
https://www.mercurial-scm.org/pipermail/mercurial-devel/2015-April/068692.html


Yeah, that would be unfortunate to deprecate author/user() since they  
are very
common terms. Also, adding case-sensitive author() would not provide  
much user

benefit even though that could help eliminating the inconsistency.

So I'm -1 for (A).


Yeah... And given what Augie said, I can agree with that.

On the other hand, I think we should fix the re: case to not lowercase  
the

pattern but to perform case-insensitive matching so '\B' won't be '\b'.


> B) We should maybe fold grep and keyword into a new predicate
> ('search'?) that follows modern formatting, and deprecate/hide these
> two.  Simple, and drops the visible revset count by 1.  I'm not sure  
if

> 'grep' was borrowed  from git, or if it's just inspired by the unix
> command.

I had second thoughts about this.  I think if we just add documentation  
to

'keyword' that says "If you want to search these fields by regex or case
sensitively, use 'grep'".  Then the user can see how to get everything
stringmatcher will provide, and it makes it clear to developers that
'keyword' doesn't need string stringmatcher support.  I'll submit a  
patch

during the freeze.


The documentation thing sounds nice.


I threw it into this next series, since it's pretty trivial.


I also like the idea of deprecating
grep() since grep() sounds like searching the file contents.


I don't have a strong feeling on that.  If somebody makes a new search  
function though, I wonder if it should be like revset.matching() (but with  
stringmatcher support), where the user can control the fields searched, in  
order to avoid this sort of ambiguity.  I wouldn't want to fold grep()  
into author() because of the clashing case sensitive/insensitive you  
mention below.



That leaves only 'author' and 'desc' as not providing the full
functionality of the others.

> C) If we do A + B, that means 'desc' is the only oddball left.  I  
don't

> like the idea that case sensitivity for a raw pattern and a 'literal:'
> prefixed pattern would differ.  They are both literals in my mi

mercurial@30751: 11 new changesets

2017-01-11 Thread Mercurial Commits
11 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/fde9692a02c0
changeset:   30741:fde9692a02c0
user:Jun Wu 
date:Tue Jan 10 06:59:39 2017 +0800
summary: chg: remove getpager support

https://www.mercurial-scm.org/repo/hg/rev/d3e2d39b97ea
changeset:   30742:d3e2d39b97ea
user:Jun Wu 
date:Tue Jan 10 06:59:49 2017 +0800
summary: pager: do not special case chg

https://www.mercurial-scm.org/repo/hg/rev/2df983125d37
changeset:   30743:2df983125d37
user:Remi Chaintron 
date:Thu Jan 05 17:16:07 2017 +
summary: revlog: add 'raw' argument to revision and _addrevision

https://www.mercurial-scm.org/repo/hg/rev/e12c0fa1f65b
changeset:   30744:e12c0fa1f65b
user:Remi Chaintron 
date:Thu Jan 05 17:16:07 2017 +
summary: revlog: pass revlog flags to addrevision

https://www.mercurial-scm.org/repo/hg/rev/c1b7b2285522
changeset:   30745:c1b7b2285522
user:Remi Chaintron 
date:Tue Jan 10 16:15:21 2017 +
summary: revlog: flag processor

https://www.mercurial-scm.org/repo/hg/rev/9cb0bb0f29f0
changeset:   30746:9cb0bb0f29f0
user:Remi Chaintron 
date:Thu Jan 05 17:16:51 2017 +
summary: revlog: REVIDX_EXTSTORED flag

https://www.mercurial-scm.org/repo/hg/rev/4259df518223
changeset:   30747:4259df518223
user:Anton Shestakov 
date:Wed Jan 11 01:25:07 2017 +0800
summary: hgweb: test the order of archive links

https://www.mercurial-scm.org/repo/hg/rev/319914d57b9e
changeset:   30748:319914d57b9e
user:Anton Shestakov 
date:Tue Jan 10 23:34:39 2017 +0800
summary: hgweb: use util.sortdict for archivespecs

https://www.mercurial-scm.org/repo/hg/rev/e38e7ea21987
changeset:   30749:e38e7ea21987
user:Anton Shestakov 
date:Tue Jan 10 23:41:58 2017 +0800
summary: hgweb: use archivespecs for links on repo index page too

https://www.mercurial-scm.org/repo/hg/rev/378686afca52
changeset:   30750:378686afca52
user:Jun Wu 
date:Wed Jan 11 07:36:48 2017 +0800
summary: chgserver: add the setprocname interface

https://www.mercurial-scm.org/repo/hg/rev/e882c7bb5a0b
changeset:   30751:e882c7bb5a0b
bookmark:@
tag: tip
user:Jun Wu 
date:Wed Jan 11 07:40:52 2017 +0800
summary: chg: change server's process title

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


Re: [PATCH] hgweb: call process_dates() via DOM event listener

2017-01-11 Thread Augie Fackler
On Wed, Jan 11, 2017 at 07:38:17PM -0800, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc 
> # Date 1484110068 28800
> #  Tue Jan 10 20:47:48 2017 -0800
> # Node ID 79314c9a79b3aa033b6f79d066b97d7157ecac33
> # Parent  9cb0bb0f29f06fa88ac4f41d8743871b33c48548
> hgweb: call process_dates() via DOM event listener

Queued this, thanks.

>
> All the hgweb templates include mercurial.js in their header. All
> the hgweb templates have the same  boilerplate to run
> process_dates(). This patch factors that function call into
> mercurial.js as part of a DOMContentLoaded event listener.
>
> diff --git a/mercurial/templates/gitweb/footer.tmpl 
> b/mercurial/templates/gitweb/footer.tmpl
> --- a/mercurial/templates/gitweb/footer.tmpl
> +++ b/mercurial/templates/gitweb/footer.tmpl
> @@ -1,4 +1,3 @@
> -