Commit Graph

251 Commits

Author SHA1 Message Date
Dirkjan Ochtman
af6b696f0f move working dir/dirstate methods from localrepo to workingctx 2010-06-07 20:03:32 +02:00
Christian Ebert
9f4630cb27 keyword: use context to detect uncommitted merge 2010-06-03 10:37:31 +01:00
Christian Ebert
8386b76841 keyword: retrieve added and modified files from commitctx 2010-06-01 03:45:10 +02:00
Christian Ebert
a2b0bda630 keyword: force dirstate normal when all changes in a file are recorded
Before this bugfix a file whose changes were entirely recorded was still
considered modified by "hg status".

Note: the test must use hg record -l/--logfile, because this is not
reproducible with hg record -m/--message.
2010-06-01 01:05:45 +02:00
Christian Ebert
e472d468be keyword: offer svn-like default keywordmaps
svn-like default keywords can be set in a new configuration section
called [keywordset] -- thanks to timeless for the name.

Move setup of default keywordmaps into dedicated function used by
kwtemplater.__init__ and demo.

HeadURL/URL is not supported (by default).
2010-05-19 00:45:50 +02:00
Christian Ebert
dfcf923020 keyword: add 2 svn-like date filters
svnisodate yields the format the date in svn's Id keyword expands to.
svnutcdate yields the format svn's Date/LastChangedDate expands to.

http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.keywords.html
2010-05-18 22:16:38 +02:00
Martin Geisler
efb4a38a04 Use our custom hg reStructuredText role some more
I missed these occurrences on my first scan through the source.
2010-05-18 16:31:10 +02:00
Christian Ebert
1d69bedc9e keyword: support extensions using dorecord, e.g. crecord
Provide extendable keyword.recordextensions variable, so other
extensions beside hgext.record which provide the dorecord function
can cooperate with hgext.keyword like so (example from crecord):

def extsetup():
    try:
        keyword = extensions.find('keyword')
        keyword.restricted += ' crecord qcrecord'
        try:
            # use record support in keyword.py if present
            keyword.recordcommands += ' crecord qcrecord'
            keyword.recordextensions += ' crecord'
        except AttributeError:
            pass
    except KeyError:
        pass
2010-05-09 11:14:43 +02:00
Christian Ebert
7ef7102e51 keyword: omit setting extra variable for record context
Since ab6bbeb1b787 the context is always retrieved in
kwtemplater.overwrite().
2010-05-05 14:02:45 +02:00
Christian Ebert
9642b7288d keyword: simplify record switch in kwtemplater.overwrite
1) use kwtemplater.record attribute for clarity
2) drop optional context argument; consider the speed loss by
   duplicating the dictionary lookup repo['.'] as negligible
2010-05-01 23:59:39 +02:00
Christian Ebert
4edb0451d8 keyword: support (q)record
Monkeypatch hgext.dorecord to trigger keyword expansion.
Read data from working directory, not from filelog.
Prevent keyword expansion from within record's commitfunc,
thereby fixing a bug/inconsistency where files which are clean
after recording were overwritten twice.
2010-04-26 04:01:07 +02:00
Christian Ebert
40b4260377 keyword: remove mq commands from restricted list
Monkeypatching patch.diff takes care of this since 224e03d75428.

Test mq more thoroughly by loosening [keywordmaps] and comparing
the output of hg cat with keyword expansion enabled and disabled.
2010-04-26 03:54:18 +02:00
Martin Geisler
f1853c5e82 Use hg role in help strings 2010-04-22 10:24:49 +02:00
Augie Fackler
9af6a77207 keyword: monkeypatch patch so that optional args can be passed as kwargs 2010-04-17 13:38:42 -05:00
Christian Ebert
00843e594b keyword: make the templater a local variable
After 9afcbefba307 a class attribute makes no sense.
2010-04-12 17:34:12 +02:00
Matt Mackall
00f3284ee7 keywords: build a new templater to work around caching interaction 2010-04-05 15:25:08 -05:00
Christian Ebert
8900ee1dd7 keyword: do not bother about detecting extension path in demo
Detecting and showing the path to a keyword extension in a
non-standard place only made sense while keyword.py was not
shipped with Mercurial.

The test output has changed because we do not have a spurious
space at eol anymore.
2010-03-16 22:29:16 +01:00
Christian Ebert
4d1049dc50 keyword: make kwdemo less verbose
1) Set the branchname always silently with
   dirstate.setbranch().
   We create a branch so that testing the {branches} template
   does not come up empty. But kwdemo is hardly the place to
   inform the user by inference why {branches} is empty on the
   default branch.
   "demobranch" is ascii and cannot be changed, so using the
   internal command instead of commands.branch() is safe.
2) Do not show full path to temporary directory
   (distracting long lines on Mac OS X).
3) No special debug output. Output only related to keyword,
   no internals like unsetting of commit hooks etc.
2010-03-16 22:28:58 +01:00
Christian Ebert
c477dea549 keyword: 1 variable name for overwriting candidates 2010-03-16 22:28:23 +01:00
Christian Ebert
5180c9f434 keyword: do not customize ui.note() when overwriting
Behaviour change:
hg commit --verbose now prints out the names of the files
which are overwritten.
2010-03-16 22:27:22 +01:00
Christian Ebert
b6094dd4c9 keyword: update copyright 2010-03-11 18:49:41 +01:00
Christian Ebert
9903aead30 keyword: remove deprecated options 2010-03-11 18:49:14 +01:00
Christian Ebert
540e13ee5e keyword: remove spurious locks, improve handling of wlock
- kwcommitctx is inside the wlock of repo.commit: no lock
- _kwfwrite only needs wlock
  wlock outside try block, so we don't need to import lock.release

_kwfwrite should even be safer that way, as we moved the status
call inside the try-except block.

Thanks to Benoit Boissinot for help.
2010-03-07 13:03:03 +01:00
Christian Ebert
a54f17c396 keyword: use status' names instead of index 2010-03-07 13:03:03 +01:00
Christian Ebert
abe6b27034 keyword: mark improved demo commit message for translation
s/config/configuration/

Inside the quoted command put the message in single quotes in case
the translation contains apostrophes.
2010-02-18 05:55:05 +01:00
Christian Ebert
9ff7e51e84 keyword: do not postpone commit hooks
With cbda5ce5d115 in place, this hack is not needed any more.
2010-02-17 17:11:20 +01:00
Sune Foldager
2369132b4b run commit and update hooks after command completion (issue1827)
Previously, the working dir state hadn't been written when these
hooks were invoked, so external commands couldn't see all changes.
2010-02-17 15:43:21 +01:00
Christian Ebert
a7cf14e2da keyword: fix utcdate filter
So far the utcdate filter only omitted the timezone,
now it actually converts to utc.

Thanks to Kevin Grover for pointing out the issue.
2010-02-04 20:58:42 +00:00
Matt Mackall
cd3ef170f7 Merge with stable 2010-01-19 22:45:09 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Christian Ebert
dd907fdefb keyword: go into restricted mode when transplanting
Expanded keyword is read into diff with transplant -b otherwise.
Test this scenario.

Thanks to Adam Berkes for providing an example case.
2009-12-23 12:04:17 +00:00
Christian Ebert
cbc3638bed keyword: do not monkeypatch diff when in restricted mode
kw_diff actually disabled restricted mode when 2 revisions were given,
because it effectively disables the extension in this case.

But the commands working with diff and patch need restricted mode
always enabled, i.e. expansion enabled when writing to the
working directory and - crucial for these commands - no expansion
when reading the filelog.
2009-12-23 12:04:04 +00:00
Christian Ebert
418943dab0 keyword: the CVS keyword is $RCSfile$, not $RCSFile$
http://cvsbook.red-bean.com/cvsbook.html#List%20Of%20Keywords

Fix default keyword map accordingly.
Keep $RCSFile$ for Mercurial backwards compatibility.
2009-11-26 10:51:17 +01:00
Martin Geisler
efe88f2ec3 keyword: sort demo output to ensure deterministic output 2009-11-26 20:50:16 +01:00
Christian Ebert
c4018af637 keyword: uppercase short option for kwfiles --all, like hg status -A
Deprecate kwfiles -a.
2009-10-01 00:00:18 +02:00
Christian Ebert
13ea5fdcd5 keyword: make kwfiles -u show untracked files only (like status)
Remove extra documentation of -u/--unknown, as this is covered in
the option help already.
Like commands.status the code now zips the status flags.

Add more kwfiles tests.
2009-09-30 23:59:03 +02:00
Christian Ebert
69a435e154 keyword: make kwfiles --all show unknown files too
More consistent and similar to hg status.
2009-09-30 23:59:03 +02:00
Christian Ebert
1e5fb59571 keyword: kwfiles --unknown instead of --untracked
Use the same option name as "hg status".
Retrieve option in _status().
Mark --untracked as deprecated.
2009-09-30 22:39:56 +02:00
Martin Geisler
9f1896c083 do not attempt to translate ui.debug output 2009-09-19 01:15:38 +02:00
Christian Ebert
136a5f6615 keyword: use util.datestr for utcdate filter, expose through variable 2009-08-05 17:20:47 +02:00
Christian Ebert
a2e9707e74 keyword: reference templating help, add utcdate filter example 2009-08-05 17:20:47 +02:00
Christian Ebert
55166d6a89 keyword: update copyright 2009-07-29 09:28:45 +02:00
Christian Ebert
54ccb308f1 keyword: refactor kwdemo and make output translatable
Better reflect the actual behaviour of the extension:
- Make map arguments and -f/--rcfile not mutually exclusive but
  extend the current configuration
- Map arguments and -f/--rcfile both override the defaults even
  when -d/--default is specified
- -d/--default only overrides the current configuration

Inform the user about extending/overriding behaviour, but only at
the beginning; the following messages become terser, making the
output translatable without too much code clutter.

Rephrase help (use "short/long" option notation etc.).
2009-07-26 10:45:35 +01:00
Martin Geisler
5c48d09d40 keyword: wrap docstrings at 70 characters 2009-07-26 01:53:06 +02:00
Dirkjan Ochtman
da9d2d8f2b merge with crew-stable 2009-07-23 20:44:26 +02:00
Christian Ebert
a94d439881 keyword: argument to "kwdemo --rcfile" must be string (bugfix) 2009-07-22 19:12:34 +01:00
Christian Ebert
515e88efb5 keyword: reformat kwfiles help for minirst parser 2009-07-22 08:28:30 +01:00
Martin Geisler
3951831e0b commands: use minirst parser when displaying help 2009-07-16 23:25:26 +02:00
Christian Ebert
13a3dfdc8e keyword: eliminate potential reference cycles from kwrepo
- delete kwrepo.commitctx after using the tweaked version
- prefer self.hook over repo.hook to avoid nesting

Also pass arguments to commit as arbitrary list.

Thanks to Simon Heimberg and Matt Mackall for guidance.
2009-07-09 11:59:12 +02:00
Christian Ebert
d0fba52b71 keyword: make repo.commit use a custom commitctx wrapper
This avoids forcing the dirstate of overwritten files to normal
during a commit.

Thanks to Dan Villiom Podlaski Christiansen for the idea of a
"double wrapper", so other extensions can still wrap
repo.commitctx safely.
2009-06-30 11:30:03 +02:00
Martin Geisler
264a5c5ff5 keyword: use all caps for 'note:' in help string
The diff, export, log, and status commands write it as 'NOTE:'.
2009-07-09 22:52:39 +02:00
Matt Mackall
eb6cba34d7 Merge with stable 2009-07-09 19:49:02 -05:00
Christian Ebert
2c270c37a1 keyword: collect kwmaps using a generator expression
Allowed for Python 2.4.
2009-07-07 23:30:53 +02:00
Martin Geisler
04658a9b97 keyword: wrapped docstrings at 78 characters 2009-07-07 23:54:42 +02:00
Christian Ebert
599fc385de keyword: remove unused import 2009-07-04 15:26:14 +02:00
Christian Ebert
2282e18ebd keyword: break overlong line 2009-06-29 23:46:28 +02:00
Christian Ebert
1ac1590504 keyword: improve help for kwfiles
- just use "files" instead of "filenames" (analogous to "hg status -h")
- reference the extension help wrt pattern configuration

Kudos to timeless for helpful suggestions.
2009-06-28 16:23:23 +02:00
Christian Ebert
53c4308c34 keyword: lowercase status flags of untracked files in kwfile output
Document the flags and their meanings in the command help
(thanks to timeless for bringing this to my attention).
2009-06-28 16:11:27 +02:00
Christian Ebert
4a2d871161 keyword: improve help for kwfiles 2009-06-27 13:05:25 +02:00
Christian Ebert
fa2f238cad keyword: make kwdemo more translation friendly 2009-06-25 09:53:47 +02:00
Dirkjan Ochtman
1d29e68744 change wiki/bts URLs to point to new hostname 2009-06-24 15:32:37 +02:00
Cédric Duval
dbcec5595d extensions: improve the consistency of synopses
Trying as much as possible to consistently:
 - use a present tense predicate followed by a direct object
 - verb referring directly to the functionality provided
   (ie. not "add command that does this" but simple "do that")
 - keep simple and to the point, leaving details for the long help
   (width is tight, possibly even more so for translations)

Thanks to timeless, Martin Geisler, Rafael Villar Burke, Dan Villiom
Podlaski Christiansen and others for the helpful suggestions.
2009-06-22 15:48:08 +02:00
Cédric Duval
0caffe860f help: remove per-extension paragraph on how to enable it
The central place to find this information is the "extensions" help topic.
2009-06-20 20:57:13 +02:00
Christian Ebert
623f4a4a00 keyword: concise help title 2009-06-18 01:21:26 +01:00
Patrick Mezard
c1548a6a3e Add patch.eol to ignore EOLs when patching (issue1019)
The intent is to fix many issues involving patching when win32ext is enabled.
With win32ext, the working directory and repository files EOLs are not the same
which means that patches made on a non-win32ext host do not apply cleanly
because of EOLs discrepancies. A theorically correct approach would be
transform either the patched file or the patch content with the
encoding/decoding filters used by win32ext. This solution is tricky to
implement and invasive, instead we prefer to address the win32ext case, by
offering a way to ignore input EOLs when patching and rewriting them when
saving the patched result.
2009-06-15 00:03:26 +02:00
timeless
3ceba44569 keyword: improve English 2009-06-09 09:25:34 -04:00
Matt Mackall
c1213eaf9d commit: drop the now-unused files parameter 2009-06-01 14:11:32 -05:00
Martin Geisler
c624e91552 fixed typos found in translatable strings
This is from a spell-check of hg.pot.
2009-05-31 14:55:51 +02:00
Christian Ebert
8860aab738 keyword: rename matcher() to match() mimicking changes in main 2009-05-26 23:09:38 +02:00
Matt Mackall
89c18ad8ce match: add some default args 2009-05-24 02:56:14 -05:00
Matt Mackall
532c58d931 match: change all users of util.matcher to match.match 2009-05-24 02:56:14 -05:00
Martin Geisler
244d3f2543 Merge with stable 2009-12-23 18:04:57 +01:00
timeless
dc03f64e77 keyword: clarify object of backwards compatibility 2009-11-27 18:26:25 +00:00
Matt Mackall
ebe3b0ebc3 commit: move commit editor to cmdutil, pass as function 2009-05-14 13:20:40 -05:00
Matt Mackall
771b18c870 commit: drop unused p1 and p2 args 2009-05-14 13:20:40 -05:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Matt Mackall
2f9b02c62d replace util.sort with sorted built-in
This is marginally faster for small and moderately-sized lists
2009-04-26 16:50:44 -05:00
Ronny Pfannschmidt
0cd168d6ec switch lock releasing in the extensions from gc to explicit 2009-04-22 02:01:22 +02:00
Christian Ebert
3465b74bb2 keyword: set overwrite message only once, not for each file 2009-04-21 09:56:07 +01:00
Wagner Bruna
b5e103128b keyword, i18n: avoid untranslated strings as message parameters 2009-04-20 21:16:13 -03:00
Martin Geisler
249541da43 expand "repo" to "repository" in help texts 2009-04-07 22:58:05 +02:00
Martin Geisler
9d08018e0f keyword: word-wrap help texts at 70 characters 2009-04-04 23:17:53 +02:00
Matt Mackall
7d51e0b1f6 bundlerepo: reintroduce dirstate 2009-03-17 13:43:11 -05:00
Jim Correia
78e5b53d7d add --git option to commands supporting --patch (log, incoming, history, tip)
No short -g form, since it would conflict with -g from the graphlog extension.
2009-02-14 22:40:39 +01:00
Christian Ebert
a9689af26d keyword: simplify repo.local and bundle check (as in dddd37603ecd) 2008-12-16 09:58:41 +01:00
Christian Ebert
2c4205b924 keyword: do not shadow builtin format (detected by pychecker) 2008-11-25 16:30:40 +01:00
Patrick Mezard
b023997f48 patch: pass an opener to patchfile 2008-11-19 13:27:57 +01:00
Christian Ebert
d61322a8dd keyword: move common code out of commit condition 2008-11-14 22:29:03 +01:00
Dirkjan Ochtman
f173d61010 keyword: be more efficient about ctx usage 2008-11-14 19:10:09 +01:00
Dirkjan Ochtman
9ef9b3e5db cmdutil: use change contexts for cset-printer and cset-templater 2008-11-14 13:59:25 +01:00
Dirkjan Ochtman
2f6d26d640 patch: turn patch.diff() into a generator
This should even be a little faster than passing in an fp argument.
2008-11-03 16:48:23 +01:00
Matt Mackall
e564d351f3 extensions: use new wrapper functions 2008-10-22 17:34:52 -05:00
Christian Ebert
ef7b051c64 keyword: avoid additional conflicts during merge/resolve
Make merge and resolve trigger kwtemplater.restricted to compare
data without keyword expansion.
The keyword stays outside the conflict:

$Keyword$
<<<<<<< local
bar
=======
foo
>>>>>>> other

and will again be expanded on commit.
Demonstrate in test case.
2008-08-22 08:26:18 +02:00
Christian Ebert
5f30d91aa9 keyword: add verify to nokwcommands after refactor in 3fd7bf0cb4ce
Add test as well.
Thanks to Guy Brand for spotting this.
2008-08-07 09:53:57 +02:00
Matt Mackall
a65ef7bc5d util: add sort helper 2008-06-27 18:28:45 -05:00
Matt Mackall
d4ab55a92b status: clean up all users for unknown files 2008-06-27 13:43:29 -05:00
Matt Mackall
73c76dd164 repo.status: eliminate list_ 2008-06-26 14:35:50 -05:00
Matt Mackall
bc715be859 add __len__ and __iter__ methods to repo and revlog 2008-06-26 14:35:50 -05:00
Matt Mackall
dcacfb3161 manifest: remove execf/linkf methods 2008-06-26 14:35:50 -05:00
Matt Mackall
fbb5127472 use repo[changeid] to get a changectx 2008-06-26 14:35:46 -05:00
Matt Mackall
d462e1fc26 simplify flag handling
add _checklink var to dirstate
introduce dirstate.flagfunc
switch users of util.execfunc/linkfunc to flagfunc
change manifestdict.set to take a flags string
change ctx.fileflags to ctx.flags
change gitmode func to a dict
remove util.execfunc/linkfunc
2008-06-26 13:46:34 -05:00
Matt Mackall
5867ff1667 use repo.changectx(None) to get a workingctx 2008-06-26 13:46:29 -05:00
Matt Mackall
9d556277c8 context: avoid using None for working parent 2008-06-25 17:35:20 -05:00
Matt Mackall
5001543d15 use repo.changectx rather than context.changectx 2008-06-25 17:34:28 -05:00
Christian Ebert
dba21309cf keyword: mimic cmdutil.bail_if_changed even more
At the check before overwriting with kwexpand, kwshrink:
- abort when in middle of merge
- give terser abort message
2008-06-12 02:27:06 +02:00
Christian Ebert
a2f0369b37 keyword: disable expansion for annotate
Keyword expansion should not be annotated.
Annotate revision when unexpanded keyword was inserted.

Add test.
2008-06-12 11:01:36 +02:00
Matt Mackall
fb88571d19 match: remove files arg from repo.status and friends 2008-05-12 11:37:08 -05:00
Matt Mackall
081e89551b match: remove files argument from patch.diff 2008-05-12 11:37:08 -05:00
Matt Mackall
e02d6f5a75 walk: remove remaining users of cmdutils.matchpats 2008-05-12 11:37:07 -05:00
Bryan O'Sullivan
324c60f864 Get rid of reimplementations of util.binary 2008-04-09 15:49:20 -07:00
Christian Ebert
0051fba0c0 keyword: check for '\0' in entire data before acting
util.binary might not be safe enough, as it fails eg. on certain
pdf files (issue1066).
2008-04-09 14:12:32 +02:00
Christian Ebert
65d5e4ac26 keyword: make overwrite() arguments mandatory 2008-04-09 14:05:57 +02:00
Christian Ebert
7567765ad1 keyword: compact setting of optional arguments 2008-04-09 14:05:57 +02:00
Christian Ebert
4f367170f4 keyword: privatize remaining monkeypatches by moving them into reposetup
Make it more transparent if and when monkeypatches are needed.
2008-04-09 14:05:57 +02:00
Christian Ebert
3064a91343 keyword: collect filename patterns, wrap dispatch._parse in uisetup
Store [keyword] config in kwtools.
hgcmd defaults to empty string.
2008-04-09 14:05:56 +02:00
Christian Ebert
8d6395cf2d keyword: regroup monkey patch code, underscore prefix private vars 2008-03-31 11:08:52 +02:00
Dirkjan Ochtman
ef391be22f hgweb: refactor hgweb code 2008-03-28 19:40:44 +01:00
Joel Rosdahl
5dae3059a0 Expand import * to allow Pyflakes to find problems 2008-03-06 22:23:26 +01:00
Alexis S. L. Carvalho
c028f52c83 keyword: remove "identify" and "remove" from nokwcommands
These two commands care about the list of modified files returned
by repo.status and we may need to do a full content comparison to
populate that list.
2008-02-21 16:22:31 -03:00
Christian Ebert
a9403cc1e0 keyword: do not inspect node1 for diff if node2 is given 2008-02-15 18:37:00 +01:00
Christian Ebert
7255aa00ca keyword: make main class and hg command accessible
Switch from global vars to top level dictionary.

Goal: make it easier for external tools (like tortoisehg)
      to hook into keyword extension.
2008-02-15 18:36:28 +01:00
Christian Ebert
ee14824c5c keyword: move expand/shrink decisions into kwtemplater
- do not clobber wrapper code
- get rid of clumsy kwtemplater attributes
2008-02-15 18:21:02 +01:00
Christian Ebert
fa355756f8 keyword: monkeypatch patch.diff for non-interactive diffs
Avoid clobbering diffs with expanded keywords eg. for
notify extension.
2008-02-13 23:49:57 +01:00
Christian Ebert
873b99708a keyword: add glog to nokwcommands 2008-02-12 21:44:56 +01:00
Christian Ebert
5ae8043b4f keyword: enable all monkey patches using _kwtemplater at reposetup
- no need for try-except block
- underscore prefix for private methods
- add doc strings
2008-02-10 08:25:09 +01:00
Christian Ebert
23b761501c keyword: no expansion in web diffs
Expansion in hgweb view of changesets and diffs is not needed and
only distracting.

Expansion stays enable in file and archive requests where it
makes sense.
2008-02-10 04:24:59 +01:00
Christian Ebert
48114de10d keyword: make restrict entirely a kwtemplater attribute 2008-02-10 01:53:19 +01:00
Christian Ebert
9543ba8beb keyword: declare globals in a more compact way 2008-02-09 22:50:53 +01:00
Christian Ebert
beb5041c53 keyword: avoid os import by using util.splitpath 2008-02-09 22:37:51 +01:00
Patrick Mezard
e8fa1f56b2 keyword: fix symlink detection under Windows 2008-02-09 20:17:06 +01:00
Patrick Mezard
86d030fcbd keyword: fix mq repository detection under Windows 2008-02-09 19:40:30 +01:00
Christian Ebert
afdf1d8870 keyword: monkeypatch dispatch._parse to avoid redundant run
Inspired by Thomas Arendsen Hein.
2008-02-07 22:25:00 +01:00
Christian Ebert
4f67830b93 keyword: safeguards against erroneous behaviour or aborts
prevent issues due to global [keyword] filename patterns:
- add email to nokwcommands
- protect everything under .hg from expansion
  (tested with qcommit)
- exclude everything starting with .hg* just in case

prevent abort when pulling from bundlerepo:
- do not set up kwrepo for bundlerepo
  expansion inside a bundle is nonsense

bundlerepo issue spotted and test case provided by pmezard.
2008-02-06 23:14:33 +01:00
Christian Ebert
3a7f707771 keyword: fix pychecker warning about shadowed variable
Also no underscore prefix for restricted switch inside reposetup.
2008-02-07 15:56:20 +01:00
Matt Mackall
d3e9e34b5b keyword: fix my string pasting thinko
Spotted by Maxim Dounin
2008-02-05 16:09:21 -06:00
Christian Ebert
9f2689b36a keyword: nokwcommands, restricted string variables at top level
- prettier syntax conforming eg. to commands.norepo
- possibly easier to hook from outside
2008-02-04 21:08:45 +01:00
Christian Ebert
795a5f750c keyword: split line continuation in 2 steps (style) 2008-02-04 18:27:36 +01:00
Christian Ebert
9a6e5dde8d keyword: add empty_ok argument to kwrepo.commit 2008-02-04 18:27:36 +01:00
Christian Ebert
6bb66cc4a1 keyword: allow keyword expansion on clone
If [keyword] filename patterns are specified in a global hgrc
keywords will be expanded in clone.

This behaviour is more consistent but also more dangerous.
Specifying global, and thus more complicted, [keyword] patterns
might slow things down as well.
Mention this in help?
2008-02-04 18:27:36 +01:00
Matt Mackall
41e5c79455 templates: move filters to their own module
This eliminates just about all Mercurial dependencies in templater.py
2008-01-31 14:44:19 -06:00
Christian Ebert
bb3bdb2336 keyword: detect restricted commands thru variable 2008-01-26 13:04:36 +00:00
Christian Ebert
5e101da3a2 keyword: improve use of dicts
- actually use iteritems() when we iter over items of a dictionary
- store commit hooks in dictionary
  (safe, as hook.hook() sorts before execution)
2008-01-22 13:12:43 +01:00
Christian Ebert
7779e712ef keyword: no expansion on qfold (bugfix) 2008-01-23 10:39:19 +01:00
Christian Ebert
5c18a69d2e Prefer i in d over d.has_key(i) 2008-01-20 14:39:25 +01:00
Christian Ebert
a07599ee0c keyword: avoid extra diffs when not comparing against working dir
When diffing against specified revisions expanded keywords
only get in the way.

Update test output.
2008-01-15 14:39:53 +01:00
Christian Ebert
e655be0aaf keyword: support mq; handle (q)record more gracefully
mq:
Ensure that expanded keywords do not make it into patches.
- disable expansion when reading filelog
- shrink expanded keywords when reading from working dir (wread)

(q)record:
Avoid additional hunks due to expanded keywords. However this is
still a compromise, as keyword expansions are not updated in
working directory because record should not overwrite files.

Mention above shortcomings and "hg kwexpand" workaround in help
and update test output.

system argument parsing:
Command detection might be slightly more expensive with
dispatch._parse, but we will need this for improving "hg diff"
output.
2008-01-15 13:58:22 +01:00
Christian Ebert
29e2a0cd0d keyword: fix some doc strings; update copyright 2008-01-11 15:01:29 +01:00
Christian Ebert
fec93c5dc5 keyword: clean up quiet setting in kwdemo and adding of untracked kwfiles 2008-01-09 05:24:33 +01:00
Christian Ebert
4598383878 keyword: suppress keyword expansion for log commands
With previous bugfix "hg log -p" expanded keywords.
Turn off again by making log, tip nokwcommands.
2008-01-09 11:21:40 +01:00
Christian Ebert
c6bef17710 keyword: (bugfix) only set changenode for kwtemplater when committing
kwexpand must always obtain changenode from filectx,
otherwise current changenode is expanded in every file.

Also fixes "hg cat <more than 1 file>".
2008-01-09 05:18:50 +01:00