Commit Graph

166 Commits

Author SHA1 Message Date
Christian Ebert
7faf4b3245 keyword: use workingctx to detect modified and added files after rollback 2010-10-01 02:13:31 +02:00
Christian Ebert
8c9ae08c43 keyword: rename variable "cfiles" to "changed" for clarity 2010-10-01 02:13:31 +02:00
Christian Ebert
405806c3f9 keyword: support rollback by restoring expansion to previous values
Prevent spurious differences in the working directory
after a rollback.

Add tests for several rollback situations.
2010-09-26 19:18:41 +02:00
Christian Ebert
9915bf5605 keyword: do not expand at all during diff
Always shrink and never expand keywords during a diff operation.
Avoid user distraction e.g. because of spurious differences
appearing in the commit editor.
2010-09-26 19:18:41 +02:00
Christian Ebert
24b171fdd3 keyword: restore restricted read mode value after overwriting
Even though just enforcing expansion after overwriting files in
the working directory caused no problems that we know of, this avoids
a potential source of problems (e.g. in collaboration other extensions)
at no costs.
2010-09-26 19:18:41 +02:00
Christian Ebert
3fb88c8dbb Use more note admonitions in help texts 2010-09-23 16:31:38 +02:00
Martin Geisler
6335a7f166 merge with stable 2010-09-10 20:19:16 +02:00
Christian Ebert
55548a8056 keyword: explain file-wise expansion in help 2010-09-10 16:58:13 +02:00
Martin Geisler
e9c2a20771 diff: recurse into subrepositories with --subrepos/-S flag 2010-09-03 12:58:51 +02:00
Matt Mackall
42d9b2046b Merge with stable 2010-07-25 21:20:05 -05:00
Christian Ebert
e697dd5558 keyword: move collecting of [keyword] patterns to reposetup (issue2303)
When cloning, prevent [keyword] filename patterns configured locally
in the source directory to persist during the update in the destination.

a) move [keyword] retrieval (back) to reposetup
b) remove the corresponding global kwtools attributes

Add test cases.
2010-07-25 20:01:33 -05:00
Christian Ebert
15f0c93000 keyword: add extra datefilters in a single update call 2010-07-15 10:24:31 +02:00
Christian Ebert
e5d231e804 keyword: postpone manifest calculation in kwtemplater.overwrite
We can check for file existence in the working directory (needed
in case of recording) by simply using the given context and
calculate the manifest only when there are in fact candidates
for expansion/shrinking.
2010-06-15 17:15:31 +02:00
FUJIWARA Katsunori
ce06b102df help: show value requirement and multiple occurrence of options
this helps users to know what kind of option is:

  - no value is required(flag option)
  - value is required
  - value is required, and multiple occurrences are allowed

each kinds are shown as below:

 -f --force              force push
 -e --ssh CMD            specify ssh command to use
 -b --branch BRANCH [+]  a specific branch you would like to push

if one or more 3rd type options are shown, explanation for '[+]' mark
is also shown as footnote.
2010-06-06 17:25:00 +09:00
Christian Ebert
6241cdaae9 keyword: pass context to kwtemplater.overwrite
Now that we have retrieved the context in every calling function
except commit, pass it as argument to kwtemplater.overwrite to
avoid looking it up twice.

Reorder arguments to kwtemplater.overwrite to reflect their
importance.

Turn node argument into a simple boolean and rename it to iswctx.
2010-06-09 12:45:48 +01:00
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