Commit Graph

8841 Commits

Author SHA1 Message Date
Thomas Arendsen Hein
01adf7776d merge heads 2012-06-07 15:55:12 +02:00
Thomas Arendsen Hein
b3cb4187dd help: fix 'hg help -k' matching an extension without docs
getattr is not needed, __doc__ always exists and defaults to None
2012-06-07 15:54:40 +02:00
Matt Mackall
cb4824284b merge with stable 2012-06-06 21:17:33 -05:00
Bryan O'Sullivan
1de6d211c8 util: simplify queue management in chunkbuffer
This also fixes a small wire protocol performance regression.
2012-06-05 16:52:20 -07:00
Kevin Bullock
926372b575 update: fix help regarding update to ancestor
As pointed out on the user mailing list, hg will update just as happily
to an ancestor if there are uncommitted changes as to a descendant.
2012-06-05 13:33:52 -05:00
Matt Mackall
49a9d0006f help: drop -a from heads syntax summary (issue3483) 2012-06-04 17:22:09 -05:00
Brad Hall
f20c06750f revlog: zlib.error sent to the user (issue3424)
Give the user the zlib error message instead of a backtrace when decompression
fails.
2012-06-04 14:46:42 -07:00
Idan Kamara
897b2d782b graft: restore config option on correct ui 2012-06-04 15:43:16 +03:00
wujek srujek
a4762c56c6 hgweb: fixes linebreak location in gitweb filediff.tmpl view
It is consistent with other templates now and doesn't cause the help link to
(incorrectly) appear on the next line.
2012-06-04 18:03:23 +02:00
Bryan O'Sullivan
ca79cf4afa scmutil: seen.union should be seen.update (issue3476) 2012-05-31 20:55:30 -07:00
Patrick Mezard
5315858d38 patch: keep patching after missing copy source (issue3480)
When applying a patch renaming/copying 'a' to 'b' on a revision where
'a' does not exist, the patching process would abort immediately,
without processing the remaining hunks and without reporting it. This
patch makes the patching no longer abort and possible hunks applied on
the copied/renamed file be written in reject files.
2012-06-01 17:37:56 +02:00
Idan Kamara
6259990e39 localrepo: clear _filecache earlier to really force reloading (issue3462)
b67b333b0d8a attempted to force the filecaches in localrepo to reload
everything after a rollback. But simply clearing _filecache isn't enough,
invalidate() needs to be called before/after. localrepo._rollback calls
invalidate() already, so we clear the map right afterwards which ensures
everything will be reread.
2012-05-29 18:27:12 +03:00
Matt Mackall
d4e4a5b5be revpair: handle odd ranges (issue3474) 2012-05-30 14:13:57 -05:00
Matt Mackall
b536e9c850 merge with stable 2012-06-04 17:57:57 -05:00
Olav Reinert
514c0b4725 help: fix keyword search result formatting
This patch fixes the broken formatting of keyword search results. Some blank
lines were missing from the RST markup, which caused markup to be printed.
2012-06-05 00:32:18 +02:00
Joshua Redstone
e38b770424 revlog: add optional stoprev arg to revlog.ancestors()
This will be used as a step in removing reachable() in a future diff.
Doing it now because bryano is in the process of rewriting ancestors in
C.  This depends on bryano's patch to replace *revs with revs in the
declaration of revlog.ancestors.
2012-06-01 15:44:13 -07:00
Bryan O'Sullivan
141bd09daa revlog: descendants(*revs) becomes descendants(revs) (API)
Once again making the API more rational, as with ancestors.
2012-06-01 12:45:16 -07:00
Bryan O'Sullivan
6ba97b40c1 revlog: ancestors(*revs) becomes ancestors(revs) (API)
Accepting a variable number of arguments as the old API did is
deeply ugly, particularly as it means the API can't be extended
with new arguments.  Partly as a result, we have at least three
different implementations of the same ancestors algorithm (!?).

Most callers were forced to call ancestors(*somelist), adding to
both inefficiency and ugliness.
2012-06-01 12:37:18 -07:00
Angel Ezquerra
d0a81b6fbd config: make sortdict keys() and iterkeys() methods respect the item order
The config.sortdict class is a simple "sorted dictionary" container
class, based on python's regular dict container. The main difference
compared to regular dicts is that sortdicts remember the order in
which items have been added to it.

Without this patch the items() method returns the sortdict elements in
the right order. However, getting the list of keys by using the keys()
or iterkeys() methods, and consequencly, looping through the container
elements in a for loop does not respect that order. This patch fixes
this problem.
2012-05-29 23:26:55 +02:00
Matt Mackall
ea8120ba7b merge with stable 2012-06-04 16:59:57 -05:00
Bryan O'Sullivan
7edc7069a5 parsers: replace magic number 64 with symbolic constant 2012-06-01 15:19:08 -07:00
Bryan O'Sullivan
8585634f4d revset: introduce and use _revsbetween
This is similar in spirit to revlog.nodesbetween, but less ambitious,
much simpler, and ~2x faster.
2012-06-01 15:50:22 -07:00
Bryan O'Sullivan
609ea1623d revset: implement dagrange directly
This is much faster than the older implementation (~8x).
2012-06-01 15:50:22 -07:00
Bryan O'Sullivan
a5d8345282 revset: turn dagrange into a function 2012-06-01 15:50:22 -07:00
Bryan O'Sullivan
4fbcddec79 revset: drop unreachable code 2012-06-01 15:50:22 -07:00
Olav Reinert
f234123b57 help: fix keyword search output for extension commands
This patch fixes the help keyword search "hg help -k" to show correct results
in the section listing extension commands.
2012-06-03 17:49:04 +02:00
Olav Reinert
c77c77574f help: format all output using RST
This change is the last patch needed to implement help text generation based
only on formatting a single text object marked up with RST.
2012-06-02 11:28:43 +02:00
Olav Reinert
54cafa029d help: format command and option list help using RST
This patch changes the function which generates help text about commands and
options to use RST formatting. Tables describing options have been formatted
using RST table markup for some time already, so their appearance does not
change. Command lists, however, change appearance.

To format non-verbose command lists, RST field list markup was chosen, because
it resembles the old format:

<http://docutils.sourceforge.net/docs/user/rst/quickref.html#field-lists>

In the old (hand-coded) format of non-verbose command lists, the left column is
12 characters wide. Our minirst implementation formats field lists with a left
column 14 characters wide, so this patch changes the appearance of help output
correspondingly:

<http://markmail.org/message/krl4cxopsnii7s6z?q=mercurial+reinert+from:%22Olav+Reinert%22&page=2>

The minirst markup most closely resembling the old verbose command lists is
definition lists. But using it would cause a blank line to be inserted between
each command definition, making the output excessively long, and no more
useful than before. To avoid this, I chose to use field lists also for verbose
command help, resulting in output like this example:

 add           add the specified files on the next commit
 annotate, blame
               show changeset information by line for each file
 clone         make a copy of an existing repository
 commit, ci    commit the specified files or all outstanding changes
 diff          diff repository (or selected files)
 export        dump the header and diffs for one or more changesets
 forget        forget the specified files on the next commit
 init          create a new repository in the given directory
 log, history  show revision history of entire repository or files
 merge         merge working directory with another revision
 phase         set or show the current phase name
 pull          pull changes from the specified source
 push          push changes to the specified destination
 qdiff         diff of the current patch and subsequent modifications
 qinit         init a new queue repository (DEPRECATED)
 qnew          create a new patch
 qpop          pop the current patch off the stack
 qpush         push the next patch onto the stack
 qrefresh      update the current patch
 remove, rm    remove the specified files on the next commit
 serve         start stand-alone webserver
 status, st    show changed files in the working directory
 summary, sum  summarize working directory state
 update, up, checkout, co
               update working directory (or switch revisions)

This change is a move towards generating all help text as a list of strings
marked up with RST.
2012-06-02 11:25:40 +02:00
Olav Reinert
8cf6a50897 help: format extension lists using RST
This change is a move towards generating all help text as a list of strings
marked up with RST.
2012-06-02 11:22:33 +02:00
Adrian Buehlmann
996ab163f9 base85: cast Py_ssize_t values to int (issue3481)
If it outputs a nonsense value, no harm done, it was nonsense to start with.
2012-06-04 16:59:34 +02:00
Nikolaj Sjujskij
a32492fbe8 help: fix search with -k option in non-ASCII locales
Keyword search in help (introduced in d455a324f54f and ff267c569bea by Augie
Fackler) tries to translate already translated strings, which results in
Unicode errors in gettext when non-ASCII locale is used. Also command
descriptions should be translated before searching there (thanks to FUJIWARA
Katsunori for pointing this out and actual fix), (issue3482).
2012-06-04 10:45:56 +04:00
Adrian Buehlmann
cf5a074e7d dispatch: tolerate non-standard version strings in tuplever() (issue3470)
When developing, we may see non-standard version strings of the form

  5d64306f39bb+20120525

which caused tuplever() to raise

  ValueError: invalid literal for int() with base 10: '5d64306f39bb'

and shadowing the real traceback.
2012-05-25 14:24:07 +02:00
Patrick Mezard
8870ba9d24 revset: cache alias expansions
Caching has no performance effect on the revset aliases which triggered
the recent recursive evaluation bug. I wrote it not to feel bad about
expanding several times the same complicated expression.
2012-05-24 13:05:06 +02:00
Adrian Buehlmann
0583e3c14c base85: use Py_ssize_t for string lengths 2012-05-24 01:30:12 +02:00
FUJIWARA Katsunori
abfb6c35d4 match: make 'match.files()' return list object always
'exact' match objects are sometimes created with a non-list 'pattern'
argument:

  - using 'set' in queue.refresh():hgext/mq.py
        match = scmutil.matchfiles(repo, set(c[0] + c[1] + c[2] + inclsubs))

  - using 'dict' in revert():mercurial/cmdutil.py (names = {})
        m = scmutil.matchfiles(repo, names)

'exact' match objects return specified 'pattern' to callers of
'match.files()' as it is, so it is a non-list object.

but almost all implementations expect 'match.files()' to return a list
object, so this may causes problems: e.g. exception for "+" with
another list object.

this patch ensures that '_files' of 'exact' match objects is a list
object.

for non 'exact' match objects, parsing specified 'pattern' already
ensures that it it a list one.
2012-05-23 00:25:29 +09:00
Patrick Mezard
139c15da66 revset: fix infinite alias expansion detection
The alias expansion code it changed from:
1- Get replacement tree
2- Substitute arguments in the replacement tree
3- Expand the replacement tree again

into:

1- Get the replacement tree
2- Expand the replacement tree
3- Expand the arguments
4- Substitute the expanded arguments in the replacement tree

and fixes cases like:

  [revsetalias]
  level1($1, $2) = $1 or $2
  level2($1, $2) = level1($2, $1)

  $ hg log -r "level2(level1(1, 2), 3)"

where the original version incorrectly aborted on infinite expansion
error, because it was confusing the expanded aliases with their
arguments.
2012-05-19 17:19:55 +02:00
Patrick Mezard
c7a80dee31 revset: explicitely tag alias arguments for expansion
The current revset alias expansion code works like:
1- Get the replacement tree
2- Substitute the variables in the replacement tree
3- Expand the replacement tree

It makes it easy to substitute alias arguments because the placeholders
are always replaced before the updated replacement tree is expanded
again. Unfortunately, to fix other alias expansion issues, we need to
reorder the sequence and delay the argument substitution. To solve this,
a new "virtual" construct called _aliasarg() is introduced and injected
when parsing the aliases definitions. Only _aliasarg() will be
substituted in the argument expansion phase instead of all regular
matching string. We also check user inputs do not contain unexpected
_aliasarg() instances to avoid argument injections.
2012-05-19 17:18:29 +02:00
Augie Fackler
3dc5160169 util: fix bad variable use in bytecount introduced by ad5e3bec298e 2012-05-21 14:24:24 -05:00
Matt Mackall
ca006af287 context: grudging accept longs in constructor 2012-05-21 16:32:50 -05:00
Matt Mackall
c082b3d973 win32: fix encoding handling for registry strings (issue3467)
This stopped handling non-ASCII strings in 1.8
2012-05-21 16:32:49 -05:00
FUJIWARA Katsunori
db8047a1c0 doc: add detail explanation for 'present()' predicate of revsets 2012-05-16 17:02:30 +09:00
Matt Mackall
1af38adeb7 osutil: handle deletion race with readdir/stat (issue3463) 2012-05-18 14:34:33 -05:00
Levi Bard
c4e66ba62d bookmarks: allow existing remote bookmarks to become heads when pushing 2012-05-13 10:21:27 +02:00
Bryan O'Sullivan
abdf4a8227 util: subclass deque for Python 2.4 backwards compatibility
It turns out that Python 2.4's deque type is lacking a remove method.
We can't implement remove in terms of find, because it doesn't have
find either.
2012-06-01 17:05:31 -07:00
Matt Mackall
6c79e00693 localrepo: move filecache clearing into invalidate
Moving from self.destroy to _rollback fixed rollback fixed rollback
but broke mq. Move it lower rather than sideways.
2012-06-01 23:44:10 -05:00
Matt Mackall
da90115a02 merge with stable 2012-06-01 15:14:29 -05:00
Matt Mackall
acd12b376b revset: avoid validating all tag nodes for tag(x)
This generally causes the entire node->rev table to get built when
we're only interested in one node.
2012-06-01 15:13:05 -05:00
Simon King
099a5c925c revset: add pattern matching to 'extra' revset expression 2012-05-30 23:14:04 +01:00
Simon King
93954249b9 revset: add pattern matching to the 'user' revset expression 2012-05-30 23:13:58 +01:00
Simon King
e5e759a651 revset: add pattern matching to 'bookmarks' revset expression 2012-05-30 23:13:33 +01:00