Compare commits
125 Commits
master
...
release-1.
Author | SHA1 | Date | |
---|---|---|---|
|
8987ca7db6 | ||
|
8066fd8982 | ||
|
a96d8c05a7 | ||
|
4238a5dd50 | ||
|
94da55d15e | ||
|
bbf1a1882a | ||
|
5322cdf609 | ||
|
346b2c6cf8 | ||
|
67d8936083 | ||
|
78f5cef5bd | ||
|
8928b1654c | ||
|
977fa0d1d4 | ||
|
6c6b7d6bb2 | ||
|
f92e88e9b4 | ||
|
6e58899fdf | ||
|
1513598420 | ||
|
9cfc060760 | ||
|
a531e34ec2 | ||
|
2cce23b5b4 | ||
|
e518bc9b68 | ||
|
8e02d05ba9 | ||
|
f131083315 | ||
|
1a52133fd4 | ||
|
627bc4e45f | ||
|
909c76ebfb | ||
|
0899ba8515 | ||
|
b7c0b40491 | ||
|
48257ccfed | ||
|
269949a65f | ||
|
c2de7123e4 | ||
|
e0c6dcd5a4 | ||
|
734ddda363 | ||
|
02cd448f89 | ||
|
5fc3a987de | ||
|
be39d72d3c | ||
|
045eb766f1 | ||
|
22d4bd0e6f | ||
|
5a7bf49cbb | ||
|
a3dd1c45f3 | ||
|
be7725694e | ||
|
366d278182 | ||
|
5f008a14f5 | ||
|
21a8c281ec | ||
|
51dde5766d | ||
|
61d7b4a58d | ||
|
19b35565a2 | ||
|
baa88412b9 | ||
|
6fb9b72e22 | ||
|
b75884c57e | ||
|
603188f6ce | ||
|
15442140cf | ||
|
9f877d4309 | ||
|
8631529268 | ||
|
96bc198b0f | ||
|
146ffb5f4c | ||
|
867c3d3382 | ||
|
75b0f27fe2 | ||
|
4b001d8f03 | ||
|
a7bec96a80 | ||
|
a8706e38ca | ||
|
265fd41717 | ||
|
67c23ffe24 | ||
|
e9a09889e4 | ||
|
e6756a2072 | ||
|
f4050b8a76 | ||
|
bb4fa7ca2f | ||
|
2648603f24 | ||
|
b7a9a1c8fd | ||
|
d45566d692 | ||
|
4411086f29 | ||
|
0b3ce03036 | ||
|
027886737d | ||
|
35f45015ea | ||
|
618f412bed | ||
|
6ab9c754a5 | ||
|
c59332c8f8 | ||
|
32d9d04b4b | ||
|
62d0fb6eee | ||
|
bc82ee24d8 | ||
|
6ab1f4a4f0 | ||
|
3e6527bab3 | ||
|
9b7691c1ae | ||
|
c3cd494386 | ||
|
fba5841bdc | ||
|
da7fc3e7e3 | ||
|
00ebe1633c | ||
|
f63bfcb4f6 | ||
|
177cf836b4 | ||
|
04069871bb | ||
|
31469204e0 | ||
|
9b148c8c4a | ||
|
98f4eac82a | ||
|
29d966cdb3 | ||
|
23d2bd552c | ||
|
41cfbbd0d9 | ||
|
cc89a7e6f8 | ||
|
c486fe98fb | ||
|
f0ac256ff6 | ||
|
e4b3adb2f5 | ||
|
58a5bc46d9 | ||
|
6e5c3a551d | ||
|
52f8261d8c | ||
|
721c385993 | ||
|
9c80de19d7 | ||
|
4ffd11caf5 | ||
|
f2c4faf054 | ||
|
bc54b663e0 | ||
|
6f1bb309d4 | ||
|
cdedaa4604 | ||
|
2130b327df | ||
|
3e238bea0b | ||
|
266c297632 | ||
|
4477b07bc6 | ||
|
74b44186d2 | ||
|
c2bf1bac38 | ||
|
c279313048 | ||
|
0301ba0336 | ||
|
5e6d61b3a7 | ||
|
4e00051a10 | ||
|
38e6e4f8d3 | ||
|
dfa223b39e | ||
|
0a8d771c11 | ||
|
5afd073ff3 | ||
|
46fda14e08 | ||
|
bbf9ef8b3d |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
src/IDF/version.php export-subst
|
53
AUTHORS
53
AUTHORS
@ -1,30 +1,41 @@
|
||||
InDefero was originally created during summer 2008
|
||||
InDefero was originally created during summer 2008
|
||||
by Loïc d'Anterroches with the support of Céondo Ltd.
|
||||
|
||||
Much appreciated contributors:
|
||||
Much appreciated contributors (in alphabetical order):
|
||||
|
||||
Nicolas Lassalle <http://www.beroot.org/> - Subversion support
|
||||
bohwaz <http://bohwaz.net/>
|
||||
Benjamin Jorand <benjamin.jorand@gmail.com> - Mercurial support
|
||||
Baptiste Michaud <bactisme@gmail.com> - Subversion synchronization
|
||||
Julien Issler
|
||||
Adrien Bustany <madcat@mymadcat.com>
|
||||
Andrew Nguyen <andrew-git-indefero@na-consulting.net>
|
||||
Baptiste Durand-Bret <bathizte@ozazar.org>
|
||||
Baptiste Michaud <bactisme@gmail.com> - Subversion sync
|
||||
Benjamin Jorand <benjamin.jorand@gmail.com> - Mercurial support
|
||||
Brenda Wallace <shiny@cpan.org>
|
||||
Brian Armstrong <brianar>
|
||||
Charles Melbye <charlie@yourwiki.net>
|
||||
Ciaran Gultnieks <ciaran@ciarang.com>
|
||||
David Feeney <davidf>
|
||||
Denis Kot <denis.kot@gmail.com> - Russian translation
|
||||
Dmitry Dulepov <dmitryd>
|
||||
Fernando Sayago Gil <mikados.mikados@gmail.com> - Spanish translation
|
||||
Jakub Viták <mainiak@gmail.com> - Czech translation
|
||||
Janez Troha <http://www.dz0ny.info> - Slovenian translation
|
||||
Jean-Philippe Fleury <jpfleury>
|
||||
Jerry <lxb429@gmail.com> - Chinese translation
|
||||
Julien Issler <julien@issler.net>
|
||||
Ludovic Bellière <xrogaan>
|
||||
Manuel Eidenberger <eidenberger@gmail.com>
|
||||
Ciaran Gultnieks
|
||||
Matthew Dawson <mjd>
|
||||
Matías Halles <matias@halles.cl>
|
||||
Mehdi Kabab <http://pioupioum.fr/>
|
||||
Sindre R. Myren
|
||||
Nicolas Lassalle <nicolas@beroot.org> - Subversion support
|
||||
Patrick Georgi <patrick.georgi@coresystems.de>
|
||||
Adrien Bustany
|
||||
Charles Melbye
|
||||
Baptiste Durand-Bret
|
||||
Andrew Nguyen
|
||||
David Feeney
|
||||
Denis Kot <denis.kot@gmail.com>
|
||||
Samuel Suther
|
||||
Ludovic Bellière
|
||||
Brian Armstrong
|
||||
Raphaël Emourgeon
|
||||
Jakub Viták
|
||||
Vladimir Solomatin
|
||||
Raphaël Emourgeon <raphael>
|
||||
Samuel Suther <info@suther.de> - German translation
|
||||
Sindre R. Myren <sindrero@stud.ntnu.no>
|
||||
Thomas Keller <me@thomaskeller.biz> - Monotone support
|
||||
Vladimir Solomatin <slash>
|
||||
William Martin <william.martin@lcpc.fr>
|
||||
Xavier Brochard <xavier@alternatif.org>
|
||||
bohwaz <http://bohwaz.net/>
|
||||
|
||||
And all the nice users who spent time reporting issues and promoting
|
||||
the project. The project could not live without them.
|
||||
|
@ -104,12 +104,13 @@ without first talking to us.
|
||||
|
||||
## I am a translator
|
||||
|
||||
We currently use (transifex)[http://trac.transifex.org] to help our
|
||||
users to translate indefero. You don't have to use it, but it's an
|
||||
easy way to do the job. You can visit the indefero page at transifex
|
||||
here : http://www.transifex.net/projects/p/indefero/c/indefero/
|
||||
We currently use [transifex](http://trac.transifex.org) to help our
|
||||
users translate indefero. You don't have to use it, but it's an easy
|
||||
way to do the job. You can visit the indefero page at transifex here:
|
||||
|
||||
http://www.transifex.net/projects/p/indefero/
|
||||
|
||||
Please understand that your changes will not be commited instantly,
|
||||
but are sent to the maintainers e-mails before. Then, your changes
|
||||
will not be in the main repository until da-loic push the changes. In
|
||||
that way, try to do big changes with less submissions.
|
||||
will not be in the main repository until the maintainer pushs the
|
||||
changes. In that way, try to do big changes with less submissions.
|
||||
|
@ -37,6 +37,7 @@ docroot.
|
||||
$ sudo pear upgrade-all
|
||||
$ sudo pear install --alldeps Mail
|
||||
$ sudo pear install --alldeps Mail_mime
|
||||
$ sudo pear install --alldeps Console_Getopt
|
||||
|
||||
If you already have some of the PEAR packages installed with your
|
||||
distribution, the `Mail` package is often not up-to-date,
|
||||
@ -222,4 +223,4 @@ functions. You need to prevent the overload as it does not make sense
|
||||
anyway (magic in the background is bad!).
|
||||
See the [corresponding ticket][reglink].
|
||||
|
||||
[reglink]: http://projects.ceondo.com/p/indefero/issues/481/
|
||||
[reglink]: http://projects.ceondo.com/p/indefero/issues/481/
|
||||
|
105
Makefile
105
Makefile
@ -22,25 +22,36 @@
|
||||
# sudo apt-get install python-setuptools
|
||||
# sudo easy_install -U transifex-client
|
||||
|
||||
PLUF_PATH=$(shell php -r "require_once('src/IDF/conf/path.php'); echo PLUF_PATH;")
|
||||
|
||||
all help:
|
||||
@echo "Rules for generate tarball :"
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
@printf "Rules for generating distributable files :\n"
|
||||
@for b in `git branch | sed "s/^. //g"`; do \
|
||||
echo -e "\t"$$b"_tarball - Generate a zip archive of the "$$b" branch."; \
|
||||
printf "\t"$$b"-zipfile - Generate a zip archive of the "$$b" branch.\n"; \
|
||||
done
|
||||
@echo -e "\nRules for internationnalization :";
|
||||
@echo -e "\tpot-update - Update the POT file from HTML template and PHP source, then merge it with PO file"
|
||||
@echo -e "\tpot-push - Send the POT file on transifex server"
|
||||
@echo -e "\tpo-update - Merge POT file into PO file. POT is not regenerated."
|
||||
@echo -e "\tpo-push - Send the all PO file on transifex server"
|
||||
@echo -e "\tpo-pull - Get all PO file from transifex server"
|
||||
@printf "\nRules for internationalization :\n";
|
||||
@printf "\tpot-update - Update the POT file from HTML templates and PHP sources, then merge it with PO file.\n"
|
||||
@printf "\tpot-push - Send the POT file to the transifex server.\n"
|
||||
@printf "\tpo-update - Merge the POT file into the PO file. The POT is not regenerated.\n"
|
||||
@printf "\tpo-push - Send the all PO files to the transifex server.\n"
|
||||
@printf "\tpo-pull - Get all PO files from the transifex server.\n"
|
||||
@printf "\tpo-stats - Show translation statistics of all PO files.\n"
|
||||
|
||||
#
|
||||
# Internationnalization rule, POT & PO file manipulation
|
||||
#
|
||||
# Internationalization rule, POT & PO file manipulation
|
||||
#
|
||||
.PHONY: pluf_path
|
||||
pluf_path:
|
||||
ifeq (src/IDF/conf/path.php, $(wildcard src/IDF/conf/path.php))
|
||||
PLUF_PATH=$(shell php -r "require_once('src/IDF/conf/path.php'); echo PLUF_PATH;")
|
||||
else
|
||||
@printf "File 'src/IDF/conf/path.php' don't exist. Please configure it !\n"
|
||||
@exit 1
|
||||
endif
|
||||
|
||||
.PHONY: pot-update po-update
|
||||
pot-update:
|
||||
pot-update: pluf_path
|
||||
# Backup pot file
|
||||
@if [ -e src/IDF/locale/idf.pot ]; then \
|
||||
mv -f src/IDF/locale/idf.pot src/IDF/locale/idf.pot.bak; \
|
||||
@ -49,19 +60,20 @@ pot-update:
|
||||
# Extract string
|
||||
@cd src; php $(PLUF_PATH)/extracttemplates.php IDF/conf/idf.php IDF/gettexttemplates
|
||||
@cd src; for phpfile in `find . -iname "*.php"`; do \
|
||||
echo "Parsing file : "$$phpfile; \
|
||||
xgettext -o idf.pot -p ./IDF/locale/ --from-code=UTF-8 -j --keyword --keyword=__ --keyword=_n:1,2 -L PHP $$phpfile ; \
|
||||
printf "Parsing file : "$$phpfile"\n"; \
|
||||
xgettext -o idf.pot -p ./IDF/locale/ --from-code=UTF-8 -j \
|
||||
--keyword --keyword=__ --keyword=_n:1,2 -L PHP $$phpfile ; \
|
||||
done
|
||||
# Remove tmp folder
|
||||
rm -Rf src/IDF/gettexttemplates
|
||||
# Update PO
|
||||
@make po-update
|
||||
|
||||
po-update:
|
||||
po-update: pluf_path
|
||||
@for pofile in `ls src/IDF/locale/*/idf.po`; do \
|
||||
echo "Updating file : "$$pofile; \
|
||||
printf "Updating file : "$$pofile"\n"; \
|
||||
msgmerge -v -U $$pofile src/IDF/locale/idf.pot; \
|
||||
echo ; \
|
||||
printf "\n"; \
|
||||
done
|
||||
|
||||
#
|
||||
@ -72,22 +84,22 @@ check-tx-config:
|
||||
@if [ ! -e .tx/config ]; then \
|
||||
mkdir -p .tx; \
|
||||
touch .tx/config; \
|
||||
echo "[main]" >> .tx/config; \
|
||||
echo "host = http://www.transifex.net" >> .tx/config; \
|
||||
echo "" >> .tx/config; \
|
||||
echo "[indefero.idfpot]" >> .tx/config; \
|
||||
echo "file_filter = src/IDF/locale/<lang>/idf.po" >> .tx/config; \
|
||||
echo "source_file = src/IDF/locale/idf.pot" >> .tx/config; \
|
||||
echo "source_lang = en" >> .tx/config; \
|
||||
printf "[main]\n" >> .tx/config; \
|
||||
printf "host = http://www.transifex.net\n" >> .tx/config; \
|
||||
printf "\n" >> .tx/config; \
|
||||
printf "[indefero.idfpot]\n" >> .tx/config; \
|
||||
printf "file_filter = src/IDF/locale/<lang>/idf.po\n" >> .tx/config; \
|
||||
printf "source_file = src/IDF/locale/idf.pot\n" >> .tx/config; \
|
||||
printf "source_lang = en\n" >> .tx/config; \
|
||||
fi
|
||||
@if [ ! -e $(HOME)/.transifexrc ]; then \
|
||||
@if [ ! -e $(HOME)/.transifexrc ]; then \
|
||||
touch $(HOME)/.transifexrc; \
|
||||
echo "[http://www.transifex.net]" >> $(HOME)/.transifexrc; \
|
||||
echo "username = " >> $(HOME)/.transifexrc; \
|
||||
echo "token = " >> $(HOME)/.transifexrc; \
|
||||
echo "password = " >> $(HOME)/.transifexrc; \
|
||||
echo "hostname = http://www.transifex.net" >> $(HOME)/.transifexrc; \
|
||||
echo "You must edit the file ~/.transifexrc to setup your transifex account (login & password) !"; \
|
||||
printf "[http://www.transifex.net]\n" >> $(HOME)/.transifexrc; \
|
||||
printf "username = \n" >> $(HOME)/.transifexrc; \
|
||||
printf "token = \n" >> $(HOME)/.transifexrc; \
|
||||
printf "password = \n" >> $(HOME)/.transifexrc; \
|
||||
printf "hostname = http://www.transifex.net\n" >> $(HOME)/.transifexrc; \
|
||||
printf "You must edit the file ~/.transifexrc to setup your transifex account (login & password) !\n"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
@ -98,13 +110,32 @@ po-push: check-tx-config
|
||||
@tx push -t
|
||||
|
||||
po-pull: check-tx-config
|
||||
# Save PO
|
||||
@for pofile in `ls src/IDF/locale/*/idf.po`; do \
|
||||
cp $$pofile $$pofile".save"; \
|
||||
done
|
||||
# Get new one
|
||||
@tx pull -a
|
||||
# Merge Transifex PO into local PO (so fuzzy entry is correctly saved)
|
||||
@for pofile in `ls src/IDF/locale/*/idf.po`; do \
|
||||
msgmerge -U $$pofile".save" $$pofile; \
|
||||
rm -f $$pofile; \
|
||||
mv $$pofile".save" $$pofile; \
|
||||
done
|
||||
|
||||
po-stats:
|
||||
@msgfmt --statistics -v src/IDF/locale/idf.pot
|
||||
@for pofile in `ls src/IDF/locale/*/idf.po`; do \
|
||||
msgfmt --statistics -v $$pofile; \
|
||||
done
|
||||
|
||||
#
|
||||
# Generic rule to build a tarball of indefero for a specified branch
|
||||
# ex: make master_tarball
|
||||
# make dev_tarball
|
||||
# Generic rule to build a zipfile of indefero for a specified branch
|
||||
# ex: make master_zipfile
|
||||
# make develop_zipfile
|
||||
#
|
||||
%_tarball:
|
||||
@git archive --format=zip --prefix="indefero/" $(@:_tarball=) > indefero-$(@:_tarball=)-`git log $(@:_tarball=) -n 1 --pretty=format:%H`.zip
|
||||
%-zipfile:
|
||||
@git archive --format=zip --prefix="indefero/" $(@:-zipfile=) \
|
||||
> indefero-$(@:-zipfile=)-`git log $(@:-zipfile=) -n 1 \
|
||||
--pretty=format:%h`.zip
|
||||
|
||||
|
105
NEWS.mdtext
Normal file
105
NEWS.mdtext
Normal file
@ -0,0 +1,105 @@
|
||||
# InDefero 1.1.2 - Thu May 26 07:42:25 2011 UTC
|
||||
|
||||
## Bugfixes
|
||||
|
||||
- Fix tags extraction from git repository (issue 675)
|
||||
- Fix SSH validation method (issue 671)
|
||||
- Fix malformed URL in the RSS (issue 666)
|
||||
- Fix validateRevision call for Mercurial Scm (issue 657)
|
||||
|
||||
## Translations
|
||||
|
||||
- Missing word in French translation (issue 672)
|
||||
- Update Spanish translation
|
||||
|
||||
# InDefero 1.1.1 - Mon Mar 28 15:52 2011 UTC
|
||||
|
||||
## Bugfixes
|
||||
|
||||
- Fix an incompatibility with Python 3.1 in gitserve.py (issue 554)
|
||||
- Fix PHP error when the commit view shows a commit with changed binary files (issue 643)
|
||||
- A migration problem prevented the preferences page being displayed properly (issues 644 and 653)
|
||||
- Fix PHP error when trying to create Mercurial source archives (issue 648)
|
||||
- Improve the French translation (issue 651)
|
||||
- Registration page missed a link to password recovery that was mentioned in a form error (issue 652)
|
||||
|
||||
# InDefero 1.1 - Sun Mar 20 11:44 2011 UTC
|
||||
|
||||
## New Features
|
||||
|
||||
* _Version control_:
|
||||
- Support for the monotone Version Control system (see [[InstallationScmMonotone]])
|
||||
- Display detailed changeset information in the commit details (git, mtn) (issue 544)
|
||||
- Show branch in the commit details (git, mtn, hg) (issue 450)
|
||||
- Render branch and tag names in a popup and make them filterable (git, hg, mtn) (issue 601)
|
||||
|
||||
* _Issue tracking_:
|
||||
- Forge-wide and per-project watch lists of starred issues (issue 589)
|
||||
- Configure a default issue template for each project (issues 212 and 540)
|
||||
- Pick default issue labels from the configured project settings (issue 556)
|
||||
- Navigate to a preceding / following issue in the issue detail view
|
||||
- Many new text syntaxes to auto-link revisions (see [[AutomaticLinks]], issue 569)
|
||||
|
||||
* _Documentation wiki_:
|
||||
- Automatically create a table of contents on wiki pages (issue 350)
|
||||
- Allow the usage of text labels for Wiki text links (issue 456)
|
||||
|
||||
* _Other_:
|
||||
- Enhanced user profile page (issue 510)
|
||||
- Manage multiple (commit) emails in the account settings (issues 136 and 500)
|
||||
- Filter the timeline and its feed by item type (issue 543)
|
||||
- Add multiple email addresses for project notifications (issue 372)
|
||||
- Direct links to other projects via the new `Project List` dropdown
|
||||
- InDefero gained a favicon (issue 594)
|
||||
|
||||
## Bugfixes
|
||||
|
||||
- Fix `Need SSH_ORIGINAL_COMMAND in environment` error for git sync (issue 198)
|
||||
- Added an option to disable lengthy project size calculation in the forge (issue 403)
|
||||
- Fix a problem when deleting an orphaned git repository (issue 467)
|
||||
- Ignore XML parsing problems when trying to retrieve commit messages for svn (issues 469 and 518)
|
||||
- Sort the project list by the display name of the project (issue 477)
|
||||
- Project creation form now has a short description field as well (issue 479)
|
||||
- Add more file extensions supported by our in-tree prettify version (issues 490 and 567)
|
||||
- Improve the parsing of hg's log output (issues 507 and 508)
|
||||
- Do not clean `<ins>` and `<del>` HTML markup from user input (issue 509)
|
||||
- Improve HTML validation by switching from `strict` to `transitional` DOCTYPE (issue 511)
|
||||
- Properly handle git commits without a changelog title (issue 520)
|
||||
- Improve BSD compatibility in shell scripts (issue 526)
|
||||
- Properly render inner whitespaces in viewed issue attachments (issue 528)
|
||||
- Support for uploading SSH keys without optional comment (issue 531)
|
||||
- Recognize irc: and git: protocols in Markdown renderer (issue 546)
|
||||
- New config option `git_core_quotepath` to handle non-ASCII git file names (issue 553)
|
||||
- Ensured that active views are rendered in the menu as such (issue 555)
|
||||
- Add CSS for nested and mixed ordered and unordered lists (issue 557)
|
||||
- Directories are now sorted before files in source tree views (issue 573)
|
||||
- File attachments now have explicit view and download links in issue views (issue 575)
|
||||
- Display anonymous access URL when user has no SSH key registered (issue 588)
|
||||
- Improve the rendering of tag lists in issue views (issue 591)
|
||||
- Improved error page when a commit or branch was not found (issue 609)
|
||||
- Disable browser autocomplete of password fields in the account settings (issue 616)
|
||||
- Improvements in the automatic linker parser (issue 618)
|
||||
- The `createIssue` API method did not check the API authentication (issue 619)
|
||||
- Reduce the memory footprint and compatibility of the internal diff parser (issues 627 and 633)
|
||||
- Print the git branches and tags in bold which contain the currently displayed revision
|
||||
|
||||
## Documentation
|
||||
|
||||
- Document how to contribute to Indefero in `CONTRIBUTE.mdtext` (issue 486)
|
||||
- Note possible problems with mbstring.func_overload in `INSTALL.mdtext` (issue 481)
|
||||
- Improve links to Markdown documentation (issue 489)
|
||||
- Explain purpose of `idf_strong_key_check` in `idf.php-dist` (issue 516)
|
||||
|
||||
## Translations
|
||||
|
||||
- Spanish translation added
|
||||
- Started with a Simplified Chinese translation (issue 521)
|
||||
- Started with a Russian translation
|
||||
- Updates and fixes to the French translation (issue 574)
|
||||
- Updates and fixes to the German translation
|
||||
- English source language has been improved (issues 441, 478, and 631)
|
||||
|
||||
# InDefero 1.0 - Tue Apr 20 07:00 2010 UTC
|
||||
|
||||
First stable release.
|
||||
|
15
phpunit.xml
Normal file
15
phpunit.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<phpunit backupGlobals="true"
|
||||
backupStaticAttributes="false"
|
||||
bootstrap="test/bootstrap.php"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
strict="false"
|
||||
verbose="true">
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="Everything">
|
||||
<directory>test/IDF/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
</phpunit>
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# This file is part of InDefero, an open source project management application.
|
||||
# Copyright (C) 2008 Céondo Ltd and contributors.
|
||||
@ -23,14 +23,17 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
import commands
|
||||
import traceback
|
||||
import subprocess
|
||||
|
||||
SCRIPTDIR = os.path.abspath(__file__).rsplit(os.path.sep, 1)[0]
|
||||
GITSERVEPHP = '%s/gitserve.php' % SCRIPTDIR
|
||||
process = subprocess.Popen(['php', GITSERVEPHP, sys.argv[1]],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
output = str.encode("\n").join(process.communicate()).strip()
|
||||
status = process.wait()
|
||||
|
||||
n = len("/gitserve.py")
|
||||
GITSERVEPHP = '%s/gitserve.php' % traceback.extract_stack(limit=1)[0][0][0:-n]
|
||||
status, output = commands.getstatusoutput('php %s %s' % (GITSERVEPHP, sys.argv[1]))
|
||||
if status == 0:
|
||||
os.execvp('git', ['git', 'shell', '-c', output.strip()])
|
||||
else:
|
||||
sys.stderr.write("%s\n" % output)
|
||||
sys.stderr.write("%s\n" % output.strip())
|
||||
sys.exit(1)
|
||||
|
207
src/IDF/Diff.php
207
src/IDF/Diff.php
@ -27,17 +27,17 @@
|
||||
*/
|
||||
class IDF_Diff
|
||||
{
|
||||
public $repo = '';
|
||||
public $diff = '';
|
||||
public $path_strip_level = 0;
|
||||
protected $lines = array();
|
||||
|
||||
public $files = array();
|
||||
|
||||
public function __construct($diff, $repo='')
|
||||
public function __construct($diff, $path_strip_level = 0)
|
||||
{
|
||||
$this->repo = $repo;
|
||||
$this->diff = $diff;
|
||||
$this->lines = preg_split("/\015\012|\015|\012/", $diff);
|
||||
$this->path_strip_level = $path_strip_level;
|
||||
// this works because in unified diff format even empty lines are
|
||||
// either prefixed with a '+', '-' or ' '
|
||||
$this->lines = preg_split("/\015\012|\015|\012/", $diff, -1, PREG_SPLIT_NO_EMPTY);
|
||||
}
|
||||
|
||||
public function parse()
|
||||
@ -49,118 +49,95 @@ class IDF_Diff
|
||||
$files = array();
|
||||
$indiff = false; // Used to skip the headers in the git patches
|
||||
$i = 0; // Used to skip the end of a git patch with --\nversion number
|
||||
foreach ($this->lines as $line) {
|
||||
$i++;
|
||||
if (0 === strpos($line, '--') and isset($this->lines[$i])
|
||||
and preg_match('/^\d+\.\d+\.\d+\.\d+$/', $this->lines[$i])) {
|
||||
break;
|
||||
$diffsize = count($this->lines);
|
||||
while ($i < $diffsize) {
|
||||
// look for the potential beginning of a diff
|
||||
if (substr($this->lines[$i], 0, 4) !== '--- ') {
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
if (0 === strpos($line, 'diff --git a')) {
|
||||
$current_file = self::getFile($line);
|
||||
$files[$current_file] = array();
|
||||
$files[$current_file]['chunks'] = array();
|
||||
$files[$current_file]['chunks_def'] = array();
|
||||
$current_chunk = 0;
|
||||
$indiff = true;
|
||||
|
||||
// we're inside a diff candiate
|
||||
$oldfileline = $this->lines[$i++];
|
||||
$newfileline = $this->lines[$i++];
|
||||
if (substr($newfileline, 0, 4) !== '+++ ') {
|
||||
// not a valid diff here, move on
|
||||
continue;
|
||||
} else if (preg_match('#^diff -r [^\s]+ -r [^\s]+ (.+)$#', $line, $matches)) {
|
||||
$current_file = $matches[1];
|
||||
$files[$current_file] = array();
|
||||
$files[$current_file]['chunks'] = array();
|
||||
$files[$current_file]['chunks_def'] = array();
|
||||
$current_chunk = 0;
|
||||
$indiff = true;
|
||||
continue;
|
||||
} else if (!$indiff && 0 === strpos($line, '=========')) {
|
||||
// ignore pseudo stanzas with a hint of a binary file
|
||||
if (preg_match("/^# (.+) is binary/", $this->lines[$i]))
|
||||
continue;
|
||||
// by default always use the new name of a possibly renamed file
|
||||
$current_file = self::getMtnFile($this->lines[$i+1]);
|
||||
// mtn 0.48 and newer set /dev/null as file path for dropped files
|
||||
// so we display the old name here
|
||||
if ($current_file == "/dev/null") {
|
||||
$current_file = self::getMtnFile($this->lines[$i]);
|
||||
}
|
||||
|
||||
// use new file name by default
|
||||
preg_match("/^\+\+\+ ([^\t]+)/", $newfileline, $m);
|
||||
$current_file = $m[1];
|
||||
if ($current_file === '/dev/null') {
|
||||
// except if it's /dev/null, use the old one instead
|
||||
// eg. mtn 0.48 and newer
|
||||
preg_match("/^--- ([^\t]+)/", $oldfileline, $m);
|
||||
$current_file = $m[1];
|
||||
}
|
||||
if ($this->path_strip_level > 0) {
|
||||
$fileparts = explode('/', $current_file, $this->path_strip_level+1);
|
||||
$current_file = array_pop($fileparts);
|
||||
}
|
||||
$current_chunk = 0;
|
||||
$files[$current_file] = array();
|
||||
$files[$current_file]['chunks'] = array();
|
||||
$files[$current_file]['chunks_def'] = array();
|
||||
|
||||
while ($i < $diffsize && substr($this->lines[$i], 0, 3) === '@@ ') {
|
||||
$elems = preg_match('/@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@.*/',
|
||||
$this->lines[$i++], $results);
|
||||
if ($elems != 1) {
|
||||
// hunk is badly formatted
|
||||
break;
|
||||
}
|
||||
if ($current_file == "/dev/null") {
|
||||
throw new Exception(
|
||||
"could not determine path from diff"
|
||||
);
|
||||
}
|
||||
$files[$current_file] = array();
|
||||
$files[$current_file]['chunks'] = array();
|
||||
$files[$current_file]['chunks_def'] = array();
|
||||
$current_chunk = 0;
|
||||
$indiff = true;
|
||||
continue;
|
||||
} else if (0 === strpos($line, 'Index: ')) {
|
||||
$current_file = self::getSvnFile($line);
|
||||
$files[$current_file] = array();
|
||||
$files[$current_file]['chunks'] = array();
|
||||
$files[$current_file]['chunks_def'] = array();
|
||||
$current_chunk = 0;
|
||||
$indiff = true;
|
||||
continue;
|
||||
}
|
||||
if (!$indiff) {
|
||||
continue;
|
||||
}
|
||||
if (0 === strpos($line, '@@ ')) {
|
||||
$files[$current_file]['chunks_def'][] = self::getChunk($line);
|
||||
$delstart = $results[1];
|
||||
$dellines = $results[2] === '' ? 1 : $results[2];
|
||||
$addstart = $results[3];
|
||||
$addlines = $results[4] === '' ? 1 : $results[4];
|
||||
|
||||
$files[$current_file]['chunks_def'][] = array(
|
||||
array($delstart, $dellines), array($addstart, $addlines)
|
||||
);
|
||||
$files[$current_file]['chunks'][] = array();
|
||||
|
||||
while ($i < $diffsize && ($addlines >= 0 || $dellines >= 0)) {
|
||||
$linetype = $this->lines[$i] != '' ? $this->lines[$i][0] : ' ';
|
||||
switch ($linetype) {
|
||||
case ' ':
|
||||
$files[$current_file]['chunks'][$current_chunk][] =
|
||||
array($delstart, $addstart, substr($this->lines[$i++], 1));
|
||||
$dellines--;
|
||||
$addlines--;
|
||||
$delstart++;
|
||||
$addstart++;
|
||||
break;
|
||||
case '+':
|
||||
$files[$current_file]['chunks'][$current_chunk][] =
|
||||
array('', $addstart, substr($this->lines[$i++], 1));
|
||||
$addlines--;
|
||||
$addstart++;
|
||||
break;
|
||||
case '-':
|
||||
$files[$current_file]['chunks'][$current_chunk][] =
|
||||
array($delstart, '', substr($this->lines[$i++], 1));
|
||||
$dellines--;
|
||||
$delstart++;
|
||||
break;
|
||||
case '\\':
|
||||
// ignore newline handling for now, see issue 636
|
||||
$i++;
|
||||
continue;
|
||||
default:
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
$current_chunk++;
|
||||
$lline = $files[$current_file]['chunks_def'][$current_chunk-1][0][0];
|
||||
$rline = $files[$current_file]['chunks_def'][$current_chunk-1][1][0];
|
||||
continue;
|
||||
}
|
||||
if (0 === strpos($line, '---') or 0 === strpos($line, '+++')) {
|
||||
continue;
|
||||
}
|
||||
if (0 === strpos($line, '-')) {
|
||||
$files[$current_file]['chunks'][$current_chunk-1][] = array($lline, '', substr($line, 1));
|
||||
$lline++;
|
||||
continue;
|
||||
}
|
||||
if (0 === strpos($line, '+')) {
|
||||
$files[$current_file]['chunks'][$current_chunk-1][] = array('', $rline, substr($line, 1));
|
||||
$rline++;
|
||||
continue;
|
||||
}
|
||||
if (0 === strpos($line, ' ')) {
|
||||
$files[$current_file]['chunks'][$current_chunk-1][] = array($lline, $rline, substr($line, 1));
|
||||
$rline++;
|
||||
$lline++;
|
||||
continue;
|
||||
}
|
||||
if ($line == '') {
|
||||
$files[$current_file]['chunks'][$current_chunk-1][] = array($lline, $rline, $line);
|
||||
$rline++;
|
||||
$lline++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$this->files = $files;
|
||||
return $files;
|
||||
}
|
||||
|
||||
public static function getFile($line)
|
||||
{
|
||||
$line = substr(trim($line), 10);
|
||||
$n = (int) strlen($line)/2;
|
||||
return trim(substr($line, 3, $n-3));
|
||||
}
|
||||
|
||||
public static function getSvnFile($line)
|
||||
{
|
||||
return substr(trim($line), 7);
|
||||
}
|
||||
|
||||
public static function getMtnFile($line)
|
||||
{
|
||||
preg_match("/^[+-]{3} ([^\t]+)/", $line, $m);
|
||||
return $m[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the html version of a parsed diff.
|
||||
*/
|
||||
@ -197,7 +174,6 @@ class IDF_Diff
|
||||
return Pluf_Template::markSafe($out);
|
||||
}
|
||||
|
||||
|
||||
public static function padLine($line)
|
||||
{
|
||||
$line = str_replace("\t", ' ', $line);
|
||||
@ -210,19 +186,6 @@ class IDF_Diff
|
||||
return str_repeat(' ', $i).substr($line, $i);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array array(array(start, n), array(start, n))
|
||||
*/
|
||||
public static function getChunk($line)
|
||||
{
|
||||
$elts = explode(' ', $line);
|
||||
$res = array();
|
||||
for ($i=1;$i<3;$i++) {
|
||||
$res[] = explode(',', trim(substr($elts[$i], 1)));
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Review patch.
|
||||
*
|
||||
@ -347,7 +310,6 @@ class IDF_Diff
|
||||
return $nnew_chunks;
|
||||
}
|
||||
|
||||
|
||||
public function renderCompared($chunks, $filename)
|
||||
{
|
||||
$fileinfo = IDF_FileUtil::getMimeType($filename);
|
||||
@ -381,6 +343,5 @@ class IDF_Diff
|
||||
$i++;
|
||||
}
|
||||
return Pluf_Template::markSafe($out);
|
||||
|
||||
}
|
||||
}
|
||||
|
96
src/IDF/EmailAddress.php
Normal file
96
src/IDF/EmailAddress.php
Normal file
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# This file is part of InDefero, an open source project management application.
|
||||
# Copyright (C) 2008 Céondo Ltd and contributors.
|
||||
#
|
||||
# InDefero is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# InDefero is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/**
|
||||
* Storage of Email addresses
|
||||
*
|
||||
*/
|
||||
class IDF_EmailAddress extends Pluf_Model
|
||||
{
|
||||
public $_model = __CLASS__;
|
||||
|
||||
function init()
|
||||
{
|
||||
$this->_a['table'] = 'idf_emailaddresses';
|
||||
$this->_a['model'] = __CLASS__;
|
||||
$this->_a['cols'] = array(
|
||||
// It is mandatory to have an "id" column.
|
||||
'id' =>
|
||||
array(
|
||||
'type' => 'Pluf_DB_Field_Sequence',
|
||||
//It is automatically added.
|
||||
'blank' => true,
|
||||
),
|
||||
'user' =>
|
||||
array(
|
||||
'type' => 'Pluf_DB_Field_Foreignkey',
|
||||
'model' => 'Pluf_User',
|
||||
'blank' => false,
|
||||
'verbose' => __('user'),
|
||||
),
|
||||
'address' =>
|
||||
array(
|
||||
'type' => 'Pluf_DB_Field_Email',
|
||||
'blank' => false,
|
||||
'verbose' => __('email'),
|
||||
'unique' => true,
|
||||
),
|
||||
);
|
||||
// WARNING: Not using getSqlTable on the Pluf_User object to
|
||||
// avoid recursion.
|
||||
$t_users = $this->_con->pfx.'users';
|
||||
$this->_a['views'] = array(
|
||||
'join_user' =>
|
||||
array(
|
||||
'join' => 'LEFT JOIN '.$t_users
|
||||
.' ON '.$t_users.'.id='.$this->_con->qn('user'),
|
||||
'select' => $this->getSelect().', '
|
||||
.$t_users.'.login AS login',
|
||||
'props' => array('login' => 'login'),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function get_email_addresses_for_user($user)
|
||||
{
|
||||
$addr = $user->get_idf_emailaddress_list();
|
||||
$addr[] = (object)array("address" => $user->email, "id" => -1, "user" => $user);
|
||||
return $addr;
|
||||
}
|
||||
|
||||
function get_user_for_email_address($email)
|
||||
{
|
||||
$sql = new Pluf_SQL('email=%s', array($email));
|
||||
$users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
|
||||
if ($users->count() > 0) {
|
||||
return $users[0];
|
||||
}
|
||||
$sql = new Pluf_SQL('address=%s', array($email));
|
||||
$matches = Pluf::factory('IDF_EmailAddress')->getList(array('filter'=>$sql->gen()));
|
||||
if ($matches->count() > 0) {
|
||||
return new Pluf_User($matches[0]->user);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ class IDF_Form_Admin_ProjectCreate extends Pluf_Form
|
||||
// we accept only starting with http(s):// to avoid people
|
||||
// trying to access the local filesystem.
|
||||
if (!preg_match('#^(http|https)://#', $url)) {
|
||||
throw new Pluf_Form_Invalid(__('Only a remote repository available throught http or https are allowed. For example "http://somewhere.com/svn/trunk".'));
|
||||
throw new Pluf_Form_Invalid(__('Only a remote repository available through HTTP or HTTPS is allowed. For example "http://somewhere.com/svn/trunk".'));
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ class IDF_Form_Admin_ProjectUpdate extends Pluf_Form
|
||||
$mtn_master_branch)) {
|
||||
throw new Pluf_Form_Invalid(__(
|
||||
'The master branch is empty or contains illegal characters, '.
|
||||
'please use only letters, digits, dashs and dots as separators.'
|
||||
'please use only letters, digits, dashes and dots as separators.'
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ class IDF_Form_Admin_UserCreate extends Pluf_Form
|
||||
array('required' => true,
|
||||
'label' => __('Email'),
|
||||
'initial' => '',
|
||||
'help_text' => __('Double check the email address as the password is directly sent to the user.'),
|
||||
'help_text' => __('Double check the email address as the password is sent directly to the user.'),
|
||||
));
|
||||
|
||||
$this->fields['language'] = new Pluf_Form_Field_Varchar(
|
||||
|
@ -78,7 +78,7 @@ class IDF_Form_Admin_UserUpdate extends Pluf_Form
|
||||
'label' => __('Password'),
|
||||
'initial' => '',
|
||||
'widget' => 'Pluf_Form_Widget_PasswordInput',
|
||||
'help_text' => Pluf_Template::markSafe(__('Leave blank if you do not want to change the password.').'<br />'.__('The password must be hard for other people to find it, but easy for the user to remember.')),
|
||||
'help_text' => Pluf_Template::markSafe(__('Leave blank if you do not want to change the password.').'<br />'.__('The password must be hard for other people to guess, but easy for the user to remember.')),
|
||||
'widget_attrs' => array(
|
||||
'maxlength' => 50,
|
||||
'size' => 15,
|
||||
@ -161,7 +161,7 @@ class IDF_Form_Admin_UserUpdate extends Pluf_Form
|
||||
'label' => __('Staff'),
|
||||
'initial' => $this->user->staff,
|
||||
'widget' => 'Pluf_Form_Widget_CheckboxInput',
|
||||
'help_text' => __('If you give staff rights to a user, you really need to trust him.'),
|
||||
'help_text' => __('If you give staff rights to a user, you really need to trust them.'),
|
||||
));
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ class IDF_Form_Admin_UserUpdate extends Pluf_Form
|
||||
'initial' => $this->user->active,
|
||||
'widget' => 'Pluf_Form_Widget_CheckboxInput',
|
||||
'widget_attrs' => $attrs,
|
||||
'help_text' => __('If the user is not getting the confirmation email or is abusing the system, you can directly enable or disable his account here.'),
|
||||
'help_text' => __('If the user is not getting the confirmation email or is abusing the system, you can directly enable or disable their account here.'),
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ Maintainability = Hinders future changes';
|
||||
{
|
||||
$this->fields['labels_issue_template'] = new Pluf_Form_Field_Varchar(
|
||||
array('required' => false,
|
||||
'label' => __('Define an issue template to hint the reporter to provide certain information'),
|
||||
'label' => __('Define an issue template to hint to the reporter to provide certain information'),
|
||||
'initial' => self::init_template,
|
||||
'widget_attrs' => array('rows' => 7,
|
||||
'cols' => 75),
|
||||
|
@ -86,7 +86,7 @@ class IDF_Form_Password extends Pluf_Form
|
||||
$return_url = Pluf_HTTP_URL_urlForView('IDF_Views::passwordRecoveryInputCode');
|
||||
$tmpl = new Pluf_Template('idf/user/passrecovery-email.txt');
|
||||
$cr = new Pluf_Crypt(md5(Pluf::f('secret_key')));
|
||||
$code = trim($cr->encrypt($user->email.':'.$user->id.':'.time()),
|
||||
$code = trim($cr->encrypt($user->email.':'.$user->id.':'.time().':primary'),
|
||||
'~');
|
||||
$code = substr(md5(Pluf::f('secret_key').$code), 0, 2).$code;
|
||||
$url = Pluf::f('url_base').Pluf_HTTP_URL_urlForView('IDF_Views::passwordRecovery', array($code), array(), false);
|
||||
|
@ -42,7 +42,7 @@ class IDF_Form_Register extends Pluf_Form
|
||||
'max_length' => 15,
|
||||
'min_length' => 3,
|
||||
'initial' => $login,
|
||||
'help_text' => __('The login must be between 3 and 15 characters long and contains only letters and digits.'),
|
||||
'help_text' => __('The login must be between 3 and 15 characters long and contain only letters and digits.'),
|
||||
'widget_attrs' => array(
|
||||
'maxlength' => 15,
|
||||
'size' => 10,
|
||||
@ -52,7 +52,7 @@ class IDF_Form_Register extends Pluf_Form
|
||||
array('required' => true,
|
||||
'label' => __('Your email'),
|
||||
'initial' => '',
|
||||
'help_text' => __('We will never send you any unsolicited emails. We hate spams too!'),
|
||||
'help_text' => __('We will never send you any unsolicited emails. We hate spam too!'),
|
||||
));
|
||||
|
||||
$this->fields['terms'] = new Pluf_Form_Field_Boolean(
|
||||
@ -93,10 +93,8 @@ class IDF_Form_Register extends Pluf_Form
|
||||
function clean_email()
|
||||
{
|
||||
$this->cleaned_data['email'] = mb_strtolower(trim($this->cleaned_data['email']));
|
||||
$guser = new Pluf_User();
|
||||
$sql = new Pluf_SQL('email=%s', $this->cleaned_data['email']);
|
||||
if ($guser->getCount(array('filter' => $sql->gen())) > 0) {
|
||||
throw new Pluf_Form_Invalid(sprintf(__('The email "%s" is already used. If you need, click on the help link to recover your password.'), $this->cleaned_data['email']));
|
||||
if (Pluf::factory('IDF_EmailAddress')->get_user_for_email_address($this->cleaned_data['email']) != null) {
|
||||
throw new Pluf_Form_Invalid(sprintf(__('The email "%s" is already used. If you need to, click on the help link to recover your password.'), $this->cleaned_data['email']));
|
||||
}
|
||||
return $this->cleaned_data['email'];
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ class IDF_Form_RegisterConfirmation extends Pluf_Form
|
||||
'label' => __('Your password'),
|
||||
'initial' => '',
|
||||
'widget' => 'Pluf_Form_Widget_PasswordInput',
|
||||
'help_text' => __('Your password must be hard for other people to find it, but easy for you to remember.'),
|
||||
'help_text' => __('Your password must be hard for other people to guess, but easy for you to remember.'),
|
||||
'widget_attrs' => array(
|
||||
'maxlength' => 50,
|
||||
'size' => 15,
|
||||
|
@ -64,6 +64,8 @@ class IDF_Form_ReviewFileComment extends Pluf_Form
|
||||
if ($this->user->hasPerm('IDF.project-owner', $this->project)
|
||||
or $this->user->hasPerm('IDF.project-member', $this->project)) {
|
||||
$this->show_full = true;
|
||||
} else {
|
||||
$this->show_full = false;
|
||||
}
|
||||
if ($this->show_full) {
|
||||
$this->fields['summary'] = new Pluf_Form_Field_Varchar(
|
||||
|
@ -83,7 +83,7 @@ class IDF_Form_Upload extends Pluf_Form
|
||||
if (strlen($extra)) $extra .= '|';
|
||||
if (!preg_match('/\.('.$extra.'png|jpg|jpeg|gif|bmp|psd|tif|aiff|asf|avi|bz2|css|doc|eps|gz|jar|mdtext|mid|mov|mp3|mpg|ogg|pdf|ppt|ps|qt|ra|ram|rm|rtf|sdd|sdw|sit|sxi|sxw|swf|tgz|txt|wav|xls|xml|war|wmv|zip)$/i', $this->cleaned_data['file'])) {
|
||||
@unlink(Pluf::f('upload_path').'/'.$this->project->shortname.'/files/'.$this->cleaned_data['file']);
|
||||
throw new Pluf_Form_Invalid(__('For security reason, you cannot upload a file with this extension.'));
|
||||
throw new Pluf_Form_Invalid(__('For security reasons, you cannot upload a file with this extension.'));
|
||||
}
|
||||
return $this->cleaned_data['file'];
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ class IDF_Form_UserAccount extends Pluf_Form
|
||||
'widget' => 'Pluf_Form_Widget_PasswordInput',
|
||||
'help_text' => Pluf_Template::markSafe(__('Leave blank if you do not want to change your password.').'<br />'.__('Your password must be hard for other people to find it, but easy for you to remember.')),
|
||||
'widget_attrs' => array(
|
||||
'autocomplete' => 'off',
|
||||
'maxlength' => 50,
|
||||
'size' => 15,
|
||||
),
|
||||
@ -89,6 +90,7 @@ class IDF_Form_UserAccount extends Pluf_Form
|
||||
'initial' => '',
|
||||
'widget' => 'Pluf_Form_Widget_PasswordInput',
|
||||
'widget_attrs' => array(
|
||||
'autocomplete' => 'off',
|
||||
'maxlength' => 50,
|
||||
'size' => 15,
|
||||
),
|
||||
@ -161,8 +163,44 @@ class IDF_Form_UserAccount extends Pluf_Form
|
||||
'widget_attrs' => array('rows' => 3,
|
||||
'cols' => 40),
|
||||
'widget' => 'Pluf_Form_Widget_TextareaInput',
|
||||
'help_text' => __('Paste a SSH or monotone public key. Be careful to not provide your private key here!')
|
||||
'help_text' => __('Paste an SSH or monotone public key. Be careful to not provide your private key here!')
|
||||
));
|
||||
|
||||
$this->fields['secondary_mail'] = new Pluf_Form_Field_Email(
|
||||
array('required' => false,
|
||||
'label' => __('Add a secondary mail address'),
|
||||
'initial' => '',
|
||||
'help_text' => __('You will get a mail to confirm that you own the address you specify.'),
|
||||
));
|
||||
}
|
||||
|
||||
private function send_validation_mail($new_email, $secondary_mail=false)
|
||||
{
|
||||
if ($secondary_mail) {
|
||||
$type = "secondary";
|
||||
} else {
|
||||
$type = "primary";
|
||||
}
|
||||
$cr = new Pluf_Crypt(md5(Pluf::f('secret_key')));
|
||||
$encrypted = trim($cr->encrypt($new_email.':'.$this->user->id.':'.time().':'.$type), '~');
|
||||
$key = substr(md5(Pluf::f('secret_key').$encrypted), 0, 2).$encrypted;
|
||||
$url = Pluf::f('url_base').Pluf_HTTP_URL_urlForView('IDF_Views_User::changeEmailDo', array($key), array(), false);
|
||||
$urlik = Pluf::f('url_base').Pluf_HTTP_URL_urlForView('IDF_Views_User::changeEmailInputKey', array(), array(), false);
|
||||
$context = new Pluf_Template_Context(
|
||||
array('key' => Pluf_Template::markSafe($key),
|
||||
'url' => Pluf_Template::markSafe($url),
|
||||
'urlik' => Pluf_Template::markSafe($urlik),
|
||||
'email' => $new_email,
|
||||
'user'=> $this->user,
|
||||
)
|
||||
);
|
||||
$tmpl = new Pluf_Template('idf/user/changeemail-email.txt');
|
||||
$text_email = $tmpl->render($context);
|
||||
$email = new Pluf_Mail(Pluf::f('from_email'), $new_email,
|
||||
__('Confirm your new email address.'));
|
||||
$email->addTextMessage($text_email);
|
||||
$email->sendMail();
|
||||
$this->user->setMessage(sprintf(__('A validation email has been sent to "%s" to validate the email address change.'), Pluf_esc($new_email)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -188,26 +226,7 @@ class IDF_Form_UserAccount extends Pluf_Form
|
||||
$new_email = $this->cleaned_data['email'];
|
||||
unset($this->cleaned_data['email']);
|
||||
if ($old_email != $new_email) {
|
||||
$cr = new Pluf_Crypt(md5(Pluf::f('secret_key')));
|
||||
$encrypted = trim($cr->encrypt($new_email.':'.$this->user->id.':'.time()), '~');
|
||||
$key = substr(md5(Pluf::f('secret_key').$encrypted), 0, 2).$encrypted;
|
||||
$url = Pluf::f('url_base').Pluf_HTTP_URL_urlForView('IDF_Views_User::changeEmailDo', array($key), array(), false);
|
||||
$urlik = Pluf::f('url_base').Pluf_HTTP_URL_urlForView('IDF_Views_User::changeEmailInputKey', array(), array(), false);
|
||||
$context = new Pluf_Template_Context(
|
||||
array('key' => Pluf_Template::markSafe($key),
|
||||
'url' => Pluf_Template::markSafe($url),
|
||||
'urlik' => Pluf_Template::markSafe($urlik),
|
||||
'email' => $new_email,
|
||||
'user'=> $this->user,
|
||||
)
|
||||
);
|
||||
$tmpl = new Pluf_Template('idf/user/changeemail-email.txt');
|
||||
$text_email = $tmpl->render($context);
|
||||
$email = new Pluf_Mail(Pluf::f('from_email'), $new_email,
|
||||
__('Confirm your new email address.'));
|
||||
$email->addTextMessage($text_email);
|
||||
$email->sendMail();
|
||||
$this->user->setMessage(sprintf(__('A validation email has been sent to "%s" to validate the email address change.'), Pluf_esc($new_email)));
|
||||
$this->send_validation_mail($new_email);
|
||||
}
|
||||
$this->user->setFromFormData($this->cleaned_data);
|
||||
// Add key as needed.
|
||||
@ -219,6 +238,9 @@ class IDF_Form_UserAccount extends Pluf_Form
|
||||
$key->create();
|
||||
}
|
||||
}
|
||||
if ('' !== $this->cleaned_data['secondary_mail']) {
|
||||
$this->send_validation_mail($this->cleaned_data['secondary_mail'], true);
|
||||
}
|
||||
|
||||
if ($commit) {
|
||||
$this->user->update();
|
||||
@ -337,7 +359,7 @@ class IDF_Form_UserAccount extends Pluf_Form
|
||||
}
|
||||
else {
|
||||
throw new Pluf_Form_Invalid(
|
||||
__('Public key looks neither like a SSH '.
|
||||
__('Public key looks like neither an SSH '.
|
||||
'nor monotone public key.'));
|
||||
}
|
||||
|
||||
@ -393,15 +415,22 @@ class IDF_Form_UserAccount extends Pluf_Form
|
||||
function clean_email()
|
||||
{
|
||||
$this->cleaned_data['email'] = mb_strtolower(trim($this->cleaned_data['email']));
|
||||
$guser = new Pluf_User();
|
||||
$sql = new Pluf_SQL('email=%s AND id!=%s',
|
||||
array($this->cleaned_data['email'], $this->user->id));
|
||||
if ($guser->getCount(array('filter' => $sql->gen())) > 0) {
|
||||
$user = Pluf::factory('IDF_EmailAddress')->get_user_for_email_address($this->cleaned_data['email']);
|
||||
if ($user != null and $user->id != $this->user->id) {
|
||||
throw new Pluf_Form_Invalid(sprintf(__('The email "%s" is already used.'), $this->cleaned_data['email']));
|
||||
}
|
||||
return $this->cleaned_data['email'];
|
||||
}
|
||||
|
||||
function clean_secondary_mail()
|
||||
{
|
||||
$this->cleaned_data['secondary_mail'] = mb_strtolower(trim($this->cleaned_data['secondary_mail']));
|
||||
if (Pluf::factory('IDF_EmailAddress')->get_user_for_email_address($this->cleaned_data['secondary_mail']) != null) {
|
||||
throw new Pluf_Form_Invalid(sprintf(__('The email "%s" is already used.'), $this->cleaned_data['secondary_mail']));
|
||||
}
|
||||
return $this->cleaned_data['secondary_mail'];
|
||||
}
|
||||
|
||||
function clean_public_key()
|
||||
{
|
||||
$this->cleaned_data['public_key'] =
|
||||
|
@ -53,7 +53,7 @@ class IDF_Form_UserChangeEmail extends Pluf_Form
|
||||
* Throw a Pluf_Form_Invalid exception if the key is not valid.
|
||||
*
|
||||
* @param string Key
|
||||
* @return array array($new_email, $user_id, time())
|
||||
* @return array array($new_email, $user_id, time(), [primary|secondary])
|
||||
*/
|
||||
public static function validateKey($key)
|
||||
{
|
||||
@ -63,7 +63,7 @@ class IDF_Form_UserChangeEmail extends Pluf_Form
|
||||
throw new Pluf_Form_Invalid(__('The validation key is not valid. Please copy/paste it from your confirmation email.'));
|
||||
}
|
||||
$cr = new Pluf_Crypt(md5(Pluf::f('secret_key')));
|
||||
return explode(':', $cr->decrypt($encrypted), 3);
|
||||
return explode(':', $cr->decrypt($encrypted), 4);
|
||||
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,10 @@ class IDF_Key extends Pluf_Model
|
||||
if (preg_match('#^\[pubkey ([^\]]+)\]\s*(\S+)\s*\[end\]$#', $this->content, $m)) {
|
||||
return array('mtn', $m[1], $m[2]);
|
||||
}
|
||||
else if (preg_match('#^ssh\-[a-z]{3}\s(\S+)(?:\s(\S+))?$#', $this->content, $m)) {
|
||||
else if (preg_match('#^ssh\-[a-z]{3}\s(\S+)(?:\s(\S*))?$#', $this->content, $m)) {
|
||||
if (!isset($m[2])) {
|
||||
$m[2] = "";
|
||||
}
|
||||
return array('ssh', $m[2], $m[1]);
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,7 @@ class IDF_Middleware
|
||||
'markdown' => 'IDF_Template_Markdown',
|
||||
'showuser' => 'IDF_Template_ShowUser',
|
||||
'ashowuser' => 'IDF_Template_AssignShowUser',
|
||||
'appversion' => 'IDF_Template_AppVersion',
|
||||
));
|
||||
$params['modifiers'] = array_merge($params['modifiers'],
|
||||
array(
|
||||
|
43
src/IDF/Migrations/16AddUserMail.php
Normal file
43
src/IDF/Migrations/16AddUserMail.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# This file is part of InDefero, an open source project management application.
|
||||
# Copyright (C) 2008 Céondo Ltd and contributors.
|
||||
#
|
||||
# InDefero is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# InDefero is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/**
|
||||
* Add the new IDF_Gconf model.
|
||||
*
|
||||
*/
|
||||
|
||||
function IDF_Migrations_16AddUserMail_up($params=null)
|
||||
{
|
||||
$db = Pluf::db();
|
||||
$schema = new Pluf_DB_Schema($db);
|
||||
$schema->model = new IDF_EmailAddress();
|
||||
$schema->createTables();
|
||||
}
|
||||
|
||||
function IDF_Migrations_16AddUserMail_down($params=null)
|
||||
{
|
||||
$db = Pluf::db();
|
||||
$schema = new Pluf_DB_Schema($db);
|
||||
$schema->model = new IDF_EmailAddress();
|
||||
$schema->dropTables();
|
||||
}
|
@ -53,6 +53,7 @@ function IDF_Migrations_Backup_run($folder, $name=null)
|
||||
'IDF_Scm_Cache_Git',
|
||||
'IDF_Queue',
|
||||
'IDF_Gconf',
|
||||
'IDF_EmailAddress',
|
||||
);
|
||||
$db = Pluf::db();
|
||||
// Now, for each table, we dump the content in json, this is a
|
||||
@ -98,6 +99,7 @@ function IDF_Migrations_Backup_restore($folder, $name)
|
||||
'IDF_Scm_Cache_Git',
|
||||
'IDF_Queue',
|
||||
'IDF_Gconf',
|
||||
'IDF_EmailAddress',
|
||||
);
|
||||
$db = Pluf::db();
|
||||
$schema = new Pluf_DB_Schema($db);
|
||||
@ -110,4 +112,4 @@ function IDF_Migrations_Backup_restore($folder, $name)
|
||||
Pluf_Test_Fixture::load($data, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ function IDF_Migrations_Install_setup($params=null)
|
||||
'IDF_Scm_Cache_Git',
|
||||
'IDF_Queue',
|
||||
'IDF_Gconf',
|
||||
'IDF_EmailAddress',
|
||||
);
|
||||
$db = Pluf::db();
|
||||
$schema = new Pluf_DB_Schema($db);
|
||||
@ -107,6 +108,7 @@ function IDF_Migrations_Install_teardown($params=null)
|
||||
'IDF_Tag',
|
||||
'IDF_Commit',
|
||||
'IDF_Project',
|
||||
'IDF_EmailAddress',
|
||||
);
|
||||
$db = Pluf::db();
|
||||
$schema = new Pluf_DB_Schema($db);
|
||||
@ -114,4 +116,4 @@ function IDF_Migrations_Install_teardown($params=null)
|
||||
$schema->model = new $model();
|
||||
$schema->dropTables();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -190,7 +190,12 @@ class IDF_Precondition
|
||||
return true; // Again need authentication error
|
||||
}
|
||||
$request->user = $users[0];
|
||||
IDF_Middleware::setRights($request);
|
||||
|
||||
// Don't try to load projects rights access if we are not in one
|
||||
if ($request->query !== "/api/") {
|
||||
IDF_Middleware::setRights($request);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -256,4 +261,4 @@ class IDF_Precondition
|
||||
$encrypted = trim($cr->encrypt($user->id.':'.$project->id), '~');
|
||||
return substr(md5(Pluf::f('secret_key').$encrypted), 0, 2).$encrypted;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -473,5 +473,14 @@ class IDF_Scm
|
||||
{
|
||||
return str_replace('%2F', '/', rawurlencode($path));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of slashes and preceeding path components
|
||||
* that should be stripped from paths in the SCM's diff output
|
||||
*/
|
||||
public function getDiffPathStripLevel()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,60 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
$this->project = $project;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see IDF_Scm::getChanges()
|
||||
*
|
||||
* Git command output is like :
|
||||
* M doc/Guide utilisateur/Manuel_distrib.tex
|
||||
* M doc/Guide utilisateur/Manuel_intro.tex
|
||||
* M doc/Guide utilisateur/Manuel_libpegase_exemples.tex
|
||||
* M doc/Guide utilisateur/Manuel_page1_version.tex
|
||||
* A doc/Guide utilisateur/images/ftp-nautilus.png
|
||||
* M doc/Guide utilisateur/textes/log_boot_PEGASE.txt
|
||||
*
|
||||
* Status letters mean : Added (A), Deleted (D), Modified (M), Renamed (R)
|
||||
*/
|
||||
public function getChanges($commit)
|
||||
{
|
||||
$cmd = sprintf('GIT_DIR=%s '.Pluf::f('git_path', 'git').' show %s --name-status --pretty="format:" --diff-filter="[A|D|M|R]" -M',
|
||||
escapeshellarg($this->repo),
|
||||
escapeshellarg($commit));
|
||||
$out = array();
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
self::exec('IDF_Scm_Git::getChanges', $cmd, $out);
|
||||
|
||||
$return = (object) array(
|
||||
'additions' => array(),
|
||||
'deletions' => array(),
|
||||
'renames' => array(),
|
||||
'patches' => array(),
|
||||
'properties' => array(),
|
||||
);
|
||||
|
||||
foreach ($out as $line) {
|
||||
$line = trim($line);
|
||||
if ($line != '') {
|
||||
$action = $line[0];
|
||||
|
||||
if ($action == 'A') {
|
||||
$filename = trim(substr($line, 1));
|
||||
$return->additions[] = $filename;
|
||||
} else if ($action == 'D') {
|
||||
$filename = trim(substr($line, 1));
|
||||
$return->deletions[] = $filename;
|
||||
} else if ($action == 'M') {
|
||||
$filename = trim(substr($line, 1));
|
||||
$return->patches[] = $filename;
|
||||
} else if ($action == 'R') {
|
||||
$matches = split ("\t", $line);
|
||||
$return->renames[$matches[1]] = $matches[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function getRepositorySize()
|
||||
{
|
||||
if (!file_exists($this->repo)) {
|
||||
@ -113,7 +167,29 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
*/
|
||||
public function inBranches($commit, $path)
|
||||
{
|
||||
return $this->_inObject($commit, 'branch');
|
||||
if (isset($this->cache['inBranches'][$commit])) {
|
||||
return $this->cache['inBranches'][$commit];
|
||||
}
|
||||
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '')
|
||||
.sprintf('GIT_DIR=%s %s branch --contains %s',
|
||||
escapeshellarg($this->repo),
|
||||
Pluf::f('git_path', 'git'),
|
||||
escapeshellarg($commit));
|
||||
self::exec('IDF_Scm_Git::inBranches', $cmd, $out, $return);
|
||||
if (0 != $return) {
|
||||
throw new IDF_Scm_Exception(sprintf($this->error_tpl,
|
||||
$cmd, $return,
|
||||
implode("\n", $out)));
|
||||
}
|
||||
|
||||
$res = array();
|
||||
foreach ($out as $line) {
|
||||
$res[] = substr($line, 2);
|
||||
}
|
||||
|
||||
$this->cache['inBranches'][$commit] = $res;
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -133,7 +209,7 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
return $this->cache['tags'];
|
||||
}
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '')
|
||||
.sprintf('GIT_DIR=%s %s for-each-ref --format="%%(taggerdate:iso)%%(committerdate:iso) %%(objectname) %%(refname)" refs/tags',
|
||||
.sprintf('GIT_DIR=%s %s for-each-ref --format="%%(objectname) %%(refname)" refs/tags',
|
||||
escapeshellarg($this->repo),
|
||||
Pluf::f('git_path', 'git'));
|
||||
self::exec('IDF_Scm_Git::getTags', $cmd, $out, $return);
|
||||
@ -145,15 +221,12 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
rsort($out);
|
||||
$res = array();
|
||||
foreach ($out as $b) {
|
||||
$elts = explode(' ', $b, 5);
|
||||
$tag = substr(trim($elts[4]), 10);
|
||||
if (false !== strpos($tag, '/')) {
|
||||
$res[$elts[3]] = $b;
|
||||
} else {
|
||||
$res[$tag] = '';
|
||||
}
|
||||
$elts = explode(' ', $b, 2);
|
||||
$tag = substr(trim($elts[1]), 10); // Remove refs/tags/ prefix
|
||||
$res[$tag] = '';
|
||||
}
|
||||
$this->cache['tags'] = $res;
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -162,35 +235,36 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
**/
|
||||
public function inTags($commit, $path)
|
||||
{
|
||||
return $this->_inObject($commit, 'tag');
|
||||
}
|
||||
if (isset($this->cache['inTags'][$commit])) {
|
||||
return $this->cache['inTags'][$commit];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns in which branches or tags a commit is.
|
||||
*
|
||||
* @param string Commit
|
||||
* @param string Object's type: 'branch' or 'tag'.
|
||||
* @return array
|
||||
*/
|
||||
private function _inObject($commit, $object)
|
||||
{
|
||||
$object = strtolower($object);
|
||||
if ('branch' === $object) {
|
||||
$objects = $this->getBranches();
|
||||
} else if ('tag' === $object) {
|
||||
$objects = $this->getTags();
|
||||
} else {
|
||||
throw new InvalidArgumentException(sprintf(__('Invalid value for the parameter %1$s: %2$s. Use %3$s.'),
|
||||
'$object',
|
||||
$object,
|
||||
'\'branch\' or \'tag\''));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '')
|
||||
.sprintf('GIT_DIR=%s %s tag --contains %s',
|
||||
escapeshellarg($this->repo),
|
||||
Pluf::f('git_path', 'git'),
|
||||
escapeshellarg($commit));
|
||||
self::exec('IDF_Scm_Git::inTags', $cmd, $out, $return);
|
||||
// `git tag` gained the `--contains` option in 1.6.2, earlier
|
||||
// versions report a bad usage error (129) which we ignore here
|
||||
if (129 == $return) {
|
||||
$this->cache['inTags'][$commit] = array();
|
||||
return array();
|
||||
}
|
||||
unset($object);
|
||||
$result = array();
|
||||
if (array_key_exists($commit, $objects)) {
|
||||
$result[] = $commit;
|
||||
// any other error should of course get noted
|
||||
if (0 != $return) {
|
||||
throw new IDF_Scm_Exception(sprintf($this->error_tpl,
|
||||
$cmd, $return,
|
||||
implode("\n", $out)));
|
||||
}
|
||||
return $result;
|
||||
|
||||
$res = array();
|
||||
foreach ($out as $line) {
|
||||
$res[] = $line;
|
||||
}
|
||||
|
||||
$this->cache['inTags'][$commit] = $res;
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -271,14 +345,12 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
if (!preg_match('/<(.*)>/', $author, $match)) {
|
||||
return null;
|
||||
}
|
||||
foreach (array('email', 'login') as $what) {
|
||||
$sql = new Pluf_SQL($what.'=%s', array($match[1]));
|
||||
$users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
|
||||
if ($users->count() > 0) {
|
||||
return $users[0];
|
||||
}
|
||||
$sql = new Pluf_SQL('login=%s', array($match[1]));
|
||||
$users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
|
||||
if ($users->count() > 0) {
|
||||
return $users[0];
|
||||
}
|
||||
return null;
|
||||
return Pluf::factory('IDF_EmailAddress')->get_user_for_email_address($match[1]);
|
||||
}
|
||||
|
||||
public static function getAnonymousAccessUrl($project, $commit=null)
|
||||
@ -294,8 +366,8 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
$keys = $user->get_idf_key_list();
|
||||
if (count ($keys) == 0)
|
||||
return self::getAnonymousAccessUrl($project);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return sprintf(Pluf::f('git_write_remote_url'), $project->shortname);
|
||||
}
|
||||
|
||||
@ -453,7 +525,7 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
$out[0]->diff = '';
|
||||
}
|
||||
|
||||
$out[0]->branch = implode(', ', $this->inBranches($commit, null));
|
||||
$out[0]->branch = implode(', ', $this->inBranches($out[0]->commit, null));
|
||||
return $out[0];
|
||||
}
|
||||
|
||||
@ -581,6 +653,14 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
return new Pluf_HTTP_Response_CommandPassThru($cmd, 'application/x-zip');
|
||||
}
|
||||
|
||||
/**
|
||||
* @see IDF_Scm::getDiffPathStripLevel()
|
||||
*/
|
||||
public function getDiffPathStripLevel()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* =====================================================
|
||||
* Specific Git Commands
|
||||
|
@ -27,10 +27,13 @@
|
||||
*/
|
||||
class IDF_Scm_Mercurial extends IDF_Scm
|
||||
{
|
||||
protected $hg_log_template;
|
||||
|
||||
public function __construct($repo, $project=null)
|
||||
{
|
||||
$this->repo = $repo;
|
||||
$this->project = $project;
|
||||
$this->hg_log_template = "'".'changeset: {rev}:{node|short}\nauthor: {author}\ndate: {date|isodate}\nfiles: {files}\n{desc}\n'."'";
|
||||
}
|
||||
|
||||
public function getRepositorySize()
|
||||
@ -67,9 +70,7 @@ class IDF_Scm_Mercurial extends IDF_Scm
|
||||
if (!preg_match('/<(.*)>/', $author, $match)) {
|
||||
return null;
|
||||
}
|
||||
$sql = new Pluf_SQL('email=%s', array($match[1]));
|
||||
$users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
|
||||
return ($users->count() > 0) ? $users[0] : null;
|
||||
return Pluf::factory('IDF_EmailAddress')->get_user_for_email_address($match[1]);
|
||||
}
|
||||
|
||||
public function getMainBranch()
|
||||
@ -93,7 +94,7 @@ class IDF_Scm_Mercurial extends IDF_Scm
|
||||
escapeshellarg($this->repo),
|
||||
escapeshellarg($rev));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
self::exec('IDF_Scm_Mercurial::isValidRevision', $cmd, $out, $ret);
|
||||
self::exec('IDF_Scm_Mercurial::validateRevision', $cmd, $out, $ret);
|
||||
|
||||
// FIXME: apparently a given hg revision can also be ambigious -
|
||||
// handle this case here sometime
|
||||
@ -335,13 +336,17 @@ class IDF_Scm_Mercurial extends IDF_Scm
|
||||
*/
|
||||
public function getCommit($commit, $getdiff=false)
|
||||
{
|
||||
if (!$this->isValidRevision($commit)) {
|
||||
if ($this->validateRevision($commit) != IDF_Scm::REVISION_VALID) {
|
||||
return false;
|
||||
}
|
||||
$tmpl = ($getdiff) ?
|
||||
Pluf::f('hg_path', 'hg').' log -p -r %s -R %s' : Pluf::f('hg_path', 'hg').' log -r %s -R %s';
|
||||
$tmpl = ($getdiff)
|
||||
? Pluf::f('hg_path', 'hg').' log -p -r %s -R %s --template %s'
|
||||
: Pluf::f('hg_path', 'hg').' log -r %s -R %s --template %s';
|
||||
$cmd = sprintf($tmpl,
|
||||
escapeshellarg($commit), escapeshellarg($this->repo));
|
||||
escapeshellarg($commit),
|
||||
escapeshellarg($this->repo),
|
||||
$this->hg_log_template);
|
||||
|
||||
$out = array();
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
self::exec('IDF_Scm_Mercurial::getCommit', $cmd, $out);
|
||||
@ -358,7 +363,7 @@ class IDF_Scm_Mercurial extends IDF_Scm
|
||||
$log[] = $line;
|
||||
}
|
||||
}
|
||||
$out = self::parseLog($log, 6);
|
||||
$out = self::parseLog($log, 4);
|
||||
$out[0]->diff = implode("\n", $change);
|
||||
return $out[0];
|
||||
}
|
||||
@ -383,11 +388,11 @@ class IDF_Scm_Mercurial extends IDF_Scm
|
||||
*/
|
||||
public function getChangeLog($commit='tip', $n=10)
|
||||
{
|
||||
$cmd = sprintf(Pluf::f('hg_path', 'hg').' log -R %s -l%s ', escapeshellarg($this->repo), $n, $commit);
|
||||
$cmd = sprintf(Pluf::f('hg_path', 'hg').' log -R %s -l%s --template %s', escapeshellarg($this->repo), $n, $this->hg_log_template, $commit);
|
||||
$out = array();
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
self::exec('IDF_Scm_Mercurial::getChangeLog', $cmd, $out);
|
||||
return self::parseLog($out, 6);
|
||||
return self::parseLog($out, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -423,7 +428,7 @@ class IDF_Scm_Mercurial extends IDF_Scm
|
||||
continue;
|
||||
}
|
||||
$match = array();
|
||||
if (preg_match('/(\S+)\s*:\s*(.*)/', $line, $match)) {
|
||||
if (preg_match('/^(\S+):\s*(.*)/', $line, $match)) {
|
||||
$match[1] = strtolower($match[1]);
|
||||
if ($match[1] == 'user') {
|
||||
$c['author'] = $match[2];
|
||||
@ -458,7 +463,7 @@ class IDF_Scm_Mercurial extends IDF_Scm
|
||||
* @param string Prefix ('git-repo-dump')
|
||||
* @return Pluf_HTTP_Response The HTTP response containing the zip archive
|
||||
*/
|
||||
protected function getArchiveStream($commit, $prefix='')
|
||||
public function getArchiveStream($commit, $prefix='')
|
||||
{
|
||||
$cmd = sprintf(Pluf::f('idf_exec_cmd_prefix', '').
|
||||
Pluf::f('hg_path', 'hg').' archive --type=zip -R %s -r %s -',
|
||||
@ -466,4 +471,12 @@ class IDF_Scm_Mercurial extends IDF_Scm
|
||||
escapeshellarg($commit));
|
||||
return new Pluf_HTTP_Response_CommandPassThru($cmd, 'application/x-zip');
|
||||
}
|
||||
|
||||
/**
|
||||
* @see IDF_Scm::getDiffPathStripLevel()
|
||||
*/
|
||||
public function getDiffPathStripLevel()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -400,14 +400,12 @@ class IDF_Scm_Monotone extends IDF_Scm
|
||||
if (!preg_match('/([^ ]+@[^ ]+)/', $author, $match)) {
|
||||
return null;
|
||||
}
|
||||
foreach (array('email', 'login') as $what) {
|
||||
$sql = new Pluf_SQL($what.'=%s', array($match[1]));
|
||||
$users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
|
||||
if ($users->count() > 0) {
|
||||
return $users[0];
|
||||
}
|
||||
$sql = new Pluf_SQL('login=%s', array($match[1]));
|
||||
$users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
|
||||
if ($users->count() > 0) {
|
||||
return $users[0];
|
||||
}
|
||||
return null;
|
||||
return Pluf::factory('IDF_EmailAddress')->get_user_for_email_address($match[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -266,8 +266,13 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
escapeshellarg($this->repo),
|
||||
escapeshellarg($rev));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$xml = simplexml_load_string(self::shell_exec('IDF_Scm_Svn::getCommitMessage', $cmd));
|
||||
$this->cache['commitmess'][$rev] = (string) $xml->logentry->msg;
|
||||
try {
|
||||
$xml = simplexml_load_string(self::shell_exec('IDF_Scm_Svn::getCommitMessage', $cmd));
|
||||
$this->cache['commitmess'][$rev] = (string) $xml->logentry->msg;
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$this->cache['commitmess'][$rev] = '';
|
||||
}
|
||||
return $this->cache['commitmess'][$rev];
|
||||
}
|
||||
|
||||
|
51
src/IDF/Template.php
Normal file
51
src/IDF/Template.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# This file is part of InDefero, an open source project management application.
|
||||
# Copyright (C) 2011 Céondo Ltd and contributors.
|
||||
#
|
||||
# InDefero is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# InDefero is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/**
|
||||
* PHP sets the backtrack limit quite low, so some (harder to analyze) regexes may fail
|
||||
* unexpectedly on large inputs or weird cornercases (see issue 618). Unfortunately this
|
||||
* fix does not always work and the execution time gets bigger the bigger we set the limit,
|
||||
* so in case PCRE fails to analyze the input string and preg_replace(_callback) returns NULL,
|
||||
* we at least return the input string unaltered.
|
||||
*
|
||||
* @param $pattern The pattern
|
||||
* @param $mixed Callback or replacement string
|
||||
* @param $input The input
|
||||
* @return The output
|
||||
*/
|
||||
function IDF_Template_safePregReplace($pattern, $mixed, $input)
|
||||
{
|
||||
$pcre_backtrack_limit = ini_get('pcre.backtrack_limit');
|
||||
ini_set('pcre.backtrack_limit', 10000000);
|
||||
|
||||
if (is_string($mixed) && !function_exists($mixed))
|
||||
$output = preg_replace($pattern, $mixed, $input);
|
||||
else
|
||||
$output = preg_replace_callback($pattern, $mixed, $input);
|
||||
|
||||
if ($output === null)
|
||||
$output = $input;
|
||||
|
||||
ini_set('pcre.backtrack_limit', $pcre_backtrack_limit);
|
||||
return $output;
|
||||
}
|
61
src/IDF/Template/AppVersion.php
Normal file
61
src/IDF/Template/AppVersion.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# This file is part of InDefero, an open source project management application.
|
||||
# Copyright (C) 2011 Céondo Ltd and contributors.
|
||||
#
|
||||
# InDefero is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# InDefero is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/**
|
||||
* AppVersion tag.
|
||||
*
|
||||
* Renders two meta tags that include the application's version and revision
|
||||
*/
|
||||
class IDF_Template_AppVersion extends Pluf_Template_Tag
|
||||
{
|
||||
function start($file = 'IDF/version.php')
|
||||
{
|
||||
if (!Pluf::fileExists($file)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$info = include_once($file);
|
||||
if (!is_array($info)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (array_key_exists('version', $info)) {
|
||||
echo '<meta name="indefero-version" content="'.$info['version'].'" />'."\n";
|
||||
}
|
||||
|
||||
if (array_key_exists('revision', $info)) {
|
||||
if (strpos($info['revision'], '$') !== false) {
|
||||
$info['revision'] = 'unknown';
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').
|
||||
Pluf::f('git_path', 'git').
|
||||
' log -1 --format=%H';
|
||||
|
||||
if (IDF_Scm::exec('IDF_Template_AppVersion::start', $cmd, $output)) {
|
||||
$info['revision'] = trim(@$output[0]);
|
||||
}
|
||||
}
|
||||
echo '<meta name="indefero-revision" content="'.$info['revision'].'" />'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
# ***** END LICENSE BLOCK ***** */
|
||||
|
||||
Pluf::loadFunction('Pluf_HTTP_URL_urlForView');
|
||||
Pluf::loadFunction('IDF_Template_safePregReplace');
|
||||
|
||||
/**
|
||||
* Make the links to issues and commits.
|
||||
@ -39,26 +40,26 @@ class IDF_Template_IssueComment extends Pluf_Template_Tag
|
||||
$this->scm = IDF_Scm::get($request->project);
|
||||
if ($esc) $text = Pluf_esc($text);
|
||||
if ($autolink) {
|
||||
$text = preg_replace('#([a-z]+://[^\s\(\)]+)#i',
|
||||
'<a href="\1">\1</a>', $text);
|
||||
$text = IDF_Template_safePregReplace('#([a-z]+://[^\s\(\)]+)#i',
|
||||
'<a href="\1">\1</a>', $text);
|
||||
}
|
||||
if ($request->rights['hasIssuesAccess']) {
|
||||
$text = preg_replace_callback('#((?:issue|bug|ticket)(s)?\s+|\s+\#)(\d+)(\#ic\d+)?(?(2)((?:[, \w]+(?:\s+\#)?)?\d+(?:\#ic\d+)?){0,})#im',
|
||||
array($this, 'callbackIssues'), $text);
|
||||
$text = IDF_Template_safePregReplace('#((?:issue|bug|ticket)(s)?\s+|\s+\#)(\d+)(\#ic\d+)?(?(2)((?:[, \w]+(?:\s+\#)?)?\d+(?:\#ic\d+)?){0,})#im',
|
||||
array($this, 'callbackIssues'), $text);
|
||||
}
|
||||
if ($request->rights['hasReviewAccess']) {
|
||||
$text = preg_replace_callback('#(reviews?\s+)(\d+(?:(?:\s+and|\s+or|,)\s+\d+)*)\b#i',
|
||||
array($this, 'callbackReviews'), $text);
|
||||
$text = IDF_Template_safePregReplace('#(reviews?\s+)(\d+(?:(?:\s+and|\s+or|,)\s+\d+)*)\b#i',
|
||||
array($this, 'callbackReviews'), $text);
|
||||
}
|
||||
if ($request->rights['hasSourceAccess']) {
|
||||
$verbs = array('added', 'fixed', 'reverted', 'changed', 'removed');
|
||||
$nouns = array('commit', 'commits', 'revision', 'revisions', 'rev', 'revs');
|
||||
$prefix = implode(' in|', $verbs).' in' . '|'.
|
||||
implode('|', $nouns);
|
||||
$text = preg_replace_callback('#((?:'.$prefix.')(?:\s+r?))([0-9a-f]{1,40}((?:\s+and|\s+or|,)\s+r?[0-9a-f]{1,40})*)\b#i',
|
||||
array($this, 'callbackCommits'), $text);
|
||||
$text = preg_replace_callback('=(src:)([^\s@#,\(\)\\\\]+(?:(\\\\)[\s@#][^\s@#,\(\)\\\\]+){0,})+(?:\@([^\s#,]+))(?:#(\d+))?=im',
|
||||
array($this, 'callbackSource'), $text);
|
||||
$text = IDF_Template_safePregReplace('#((?:'.$prefix.')(?:\s+r?))([0-9a-f]{1,40}((?:\s+and|\s+or|,)\s+r?[0-9a-f]{1,40})*)\b#i',
|
||||
array($this, 'callbackCommits'), $text);
|
||||
$text = IDF_Template_safePregReplace('=(src:)([^\s@#,\(\)\\\\]+(?:(\\\\)[\s@#][^\s@#,\(\)\\\\]+){0,})+(?:\@([^\s#,]+))(?:#(\d+))?=im',
|
||||
array($this, 'callbackSource'), $text);
|
||||
}
|
||||
if ($wordwrap) $text = Pluf_Text::wrapHtml($text, 69, "\n");
|
||||
if ($nl2br) $text = nl2br($text);
|
||||
@ -94,9 +95,9 @@ class IDF_Template_IssueComment extends Pluf_Template_Tag
|
||||
}
|
||||
return $m[0]; // not existing issue.
|
||||
}
|
||||
return preg_replace_callback('#(\#)?(\d+)(\#ic\d+)?#',
|
||||
array($this, 'callbackIssue'),
|
||||
$m[0]);
|
||||
return IDF_Template_safePregReplace('#(\#)?(\d+)(\#ic\d+)?#',
|
||||
array($this, 'callbackIssue'),
|
||||
$m[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -131,7 +132,7 @@ class IDF_Template_IssueComment extends Pluf_Template_Tag
|
||||
return $m[1].call_user_func(array($this, 'callbackCommit'), array($m[2]));
|
||||
}
|
||||
// Multiple commits like 'commits 6e030e6, a25bfc1 and 3c094f8'.
|
||||
return $m[1].preg_replace_callback('#\b[0-9a-f]{1,40}\b#i', array($this, 'callbackCommit'), $m[2]);
|
||||
return $m[1].IDF_Template_safePregReplace('#\b[0-9a-f]{1,40}\b#i', array($this, 'callbackCommit'), $m[2]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -163,7 +164,7 @@ class IDF_Template_IssueComment extends Pluf_Template_Tag
|
||||
{
|
||||
$keyword = rtrim($m[1]);
|
||||
if ('reviews' === $keyword) {
|
||||
return $m[1].preg_replace_callback('#\b(\d+)\b#i', array($this, 'callbackReview'), $m[2]);
|
||||
return $m[1].IDF_Template_safePregReplace('#\b(\d+)\b#i', array($this, 'callbackReview'), $m[2]);
|
||||
} else if ('review' === $keyword) {
|
||||
return $m[1].call_user_func(array($this, 'callbackReview'), array('', $m[2]));
|
||||
}
|
||||
@ -234,7 +235,7 @@ class IDF_Template_IssueComment extends Pluf_Template_Tag
|
||||
public function linkIssue($issue, $title, $anchor='')
|
||||
{
|
||||
$ic = (in_array($issue->status, $this->project->getTagIdsByStatus('closed'))) ? 'issue-c' : 'issue-o';
|
||||
return '<a href="'.Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view',
|
||||
return '<a href="'.Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view',
|
||||
array($this->project->shortname, $issue->id)).$anchor.'" class="'.$ic.'" title="'.Pluf_esc($issue->summary).'">'.Pluf_esc($title).'</a>';
|
||||
}
|
||||
|
||||
@ -248,7 +249,7 @@ class IDF_Template_IssueComment extends Pluf_Template_Tag
|
||||
public function linkReview($review, $title, $anchor='')
|
||||
{
|
||||
$ic = (in_array($review->status, $this->project->getTagIdsByStatus('closed'))) ? 'issue-c' : 'issue-o';
|
||||
return '<a href="'.Pluf_HTTP_URL_urlForView('IDF_Views_Review::view',
|
||||
return '<a href="'.Pluf_HTTP_URL_urlForView('IDF_Views_Review::view',
|
||||
array($this->project->shortname, $review->id)).$anchor.'" class="'.$ic.'" title="'.Pluf_esc($review->summary).'">'.Pluf_esc($title).'</a>';
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
# ***** END LICENSE BLOCK ***** */
|
||||
|
||||
Pluf::loadFunction('Pluf_Text_MarkDown_parse');
|
||||
Pluf::loadFunction('IDF_Template_safePregReplace');
|
||||
|
||||
/**
|
||||
* Make the links to issues and commits.
|
||||
@ -42,18 +43,18 @@ class IDF_Template_Markdown extends Pluf_Template_Tag
|
||||
// Replace [[[path/to/file.mdtext, commit]]] with embedding
|
||||
// the content of the file into the wki page
|
||||
if ($this->request->rights['hasSourceAccess']) {
|
||||
$text = preg_replace_callback('#\[\[\[([^\,]+)(?:, ([^/]+))?\]\]\]#im',
|
||||
array($this, 'callbackEmbeddedDoc'),
|
||||
$text);
|
||||
$text = IDF_Template_safePregReplace('#\[\[\[([^\,]+)(?:, ([^/]+))?\]\]\]#im',
|
||||
array($this, 'callbackEmbeddedDoc'),
|
||||
$text);
|
||||
}
|
||||
// Replace [Page]([[PageName]]) with corresponding link to the page, with link text being Page.
|
||||
$text = preg_replace_callback('#\[([^\]]+)\]\(\[\[([A-Za-z0-9\-]+)\]\]\)#im',
|
||||
array($this, 'callbackWikiPage'),
|
||||
$text);
|
||||
$text = IDF_Template_safePregReplace('#\[([^\]]+)\]\(\[\[([A-Za-z0-9\-]+)\]\]\)#im',
|
||||
array($this, 'callbackWikiPage'),
|
||||
$text);
|
||||
// Replace [[PageName]] with corresponding link to the page.
|
||||
$text = preg_replace_callback('#\[\[([A-Za-z0-9\-]+)\]\]#im',
|
||||
array($this, 'callbackWikiPageNoName'),
|
||||
$text);
|
||||
$text = IDF_Template_safePregReplace('#\[\[([A-Za-z0-9\-]+)\]\]#im',
|
||||
array($this, 'callbackWikiPageNoName'),
|
||||
$text);
|
||||
$filter = new IDF_Template_MarkdownPrefilter();
|
||||
echo $filter->go(Pluf_Text_MarkDown_parse($text));
|
||||
}
|
||||
@ -66,7 +67,7 @@ class IDF_Template_Markdown extends Pluf_Template_Tag
|
||||
|
||||
function callbackWikiPage($m)
|
||||
{
|
||||
$sql = new Pluf_SQL('project=%s AND title=%s',
|
||||
$sql = new Pluf_SQL('project=%s AND title=%s',
|
||||
array($this->project->id, $m[2]));
|
||||
$pages = Pluf::factory('IDF_WikiPage')->getList(array('filter'=>$sql->gen()));
|
||||
if ($pages->count() != 1 and $this->request->rights['hasWikiAccess']
|
||||
@ -78,7 +79,7 @@ class IDF_Template_Markdown extends Pluf_Template_Tag
|
||||
}
|
||||
return '<a href="'.Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view', array($this->project->shortname, $pages[0]->title)).'" title="'.Pluf_esc($pages[0]->summary).'">'.$m[1].'</a>';
|
||||
}
|
||||
|
||||
|
||||
function callbackEmbeddedDoc($m)
|
||||
{
|
||||
$scm = IDF_Scm::get($this->request->project);
|
||||
@ -94,7 +95,7 @@ class IDF_Template_Markdown extends Pluf_Template_Tag
|
||||
return $m[0];
|
||||
}
|
||||
$info = pathinfo($m[1]);
|
||||
$fileinfo = array($res->headers['Content-Type'], $m[1],
|
||||
$fileinfo = array($res->headers['Content-Type'], $m[1],
|
||||
isset($info['extension']) ? $info['extension'] : 'bin');
|
||||
if (!IDF_FileUtil::isText($fileinfo)) {
|
||||
return $m[0];
|
||||
|
@ -32,29 +32,6 @@ class IDF_Tests_TestDiff extends UnitTestCase
|
||||
parent::__construct('Test the diff parser.');
|
||||
}
|
||||
|
||||
public function testGetFile()
|
||||
{
|
||||
$lines = array(
|
||||
'diff --git a/src/IDF/Form/Register.php b/src/IDF/Form/Register.php',
|
||||
'diff --git a/src/IDF/Form/RegisterConfirmation.php b/src/IDF/Form/RegisterConfirmation.php',
|
||||
'diff --git a/src/IDF/Form/RegisterInputKey.php b/src/IDF/Form/RegisterInputKey.php',
|
||||
'diff --git a/src/IDF/Views.php b/src/IDF/Views.php',
|
||||
'diff --git a/src/IDF/conf/views.php b/src/IDF/conf/views.php',
|
||||
);
|
||||
$files = array(
|
||||
'src/IDF/Form/Register.php',
|
||||
'src/IDF/Form/RegisterConfirmation.php',
|
||||
'src/IDF/Form/RegisterInputKey.php',
|
||||
'src/IDF/Views.php',
|
||||
'src/IDF/conf/views.php',
|
||||
);
|
||||
$i = 0;
|
||||
foreach ($lines as $line) {
|
||||
$this->assertEqual($files[$i], IDF_Diff::getFile($line));
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function testBinaryDiff()
|
||||
{
|
||||
$diff_content = file_get_contents(dirname(__FILE__).'/test-diff.diff');
|
||||
@ -90,4 +67,4 @@ class IDF_Tests_TestDiff extends UnitTestCase
|
||||
$diff->files['src/IDF/Scm/Git.php']['chunks'][1][2]);
|
||||
$this->assertEqual(7, count($diff->files['src/IDF/Scm/Git.php']['chunks'][1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,12 +37,16 @@ class IDF_Views
|
||||
* Only the public projects are listed or the private with correct
|
||||
* rights.
|
||||
*/
|
||||
public function index($request, $match)
|
||||
public function index($request, $match, $api=false)
|
||||
{
|
||||
$projects = self::getProjects($request->user);
|
||||
$stats = self::getProjectsStatistics ($projects);
|
||||
|
||||
if ($api == true) return $projects;
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/index.html',
|
||||
array('page_title' => __('Projects'),
|
||||
'projects' => $projects),
|
||||
'projects' => $projects,
|
||||
'stats' => new Pluf_Template_ContextVars($stats)),
|
||||
$request);
|
||||
}
|
||||
|
||||
@ -343,4 +347,40 @@ class IDF_Views
|
||||
return Pluf::factory('IDF_Project')->getList(array('filter' => $sql,
|
||||
'order' => 'name ASC'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns statistics on a list of projects.
|
||||
*
|
||||
* @param ArrayObject IDF_Project
|
||||
* @return Associative array of statistics
|
||||
*/
|
||||
public static function getProjectsStatistics($projects)
|
||||
{
|
||||
// Init the return var
|
||||
$forgestats = array('downloads' => 0,
|
||||
'reviews' => 0,
|
||||
'issues' => 0,
|
||||
'docpages' => 0,
|
||||
'commits' => 0);
|
||||
|
||||
// Count for each projects
|
||||
foreach ($projects as $p) {
|
||||
$pstats = $p->getStats ();
|
||||
$forgestats['downloads'] += $pstats['downloads'];
|
||||
$forgestats['reviews'] += $pstats['reviews'];
|
||||
$forgestats['issues'] += $pstats['issues'];
|
||||
$forgestats['docpages'] += $pstats['docpages'];
|
||||
$forgestats['commits'] += $pstats['commits'];
|
||||
}
|
||||
|
||||
// Count projects
|
||||
$forgestats['projects'] = count($projects);
|
||||
|
||||
// Count members
|
||||
$sql = new Pluf_SQL('first_name != %s', array('---'));
|
||||
$forgestats['members'] = Pluf::factory('Pluf_User')
|
||||
->getCount(array('filter' => $sql->gen()));
|
||||
|
||||
return $forgestats;
|
||||
}
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ class IDF_Views_Api
|
||||
* Create a new issue.
|
||||
*/
|
||||
public $issueCreate_precond = array('IDF_Precondition::apiSetUser',
|
||||
'Pluf_Precondition::loginRequired',
|
||||
'IDF_Precondition::accessIssues');
|
||||
public function issueCreate($request, $match)
|
||||
{
|
||||
@ -63,7 +64,7 @@ class IDF_Views_Api
|
||||
$out = array();
|
||||
if ($request->method == 'GET') {
|
||||
// We give the details of the form
|
||||
$out['doc'] = 'A POST request against this url will allow you to create a new issue.';
|
||||
$out['help'] = 'A POST request against this url will allow you to create a new issue.';
|
||||
if ($request->user->hasPerm('IDF.project-owner', $request->project)
|
||||
or $request->user->hasPerm('IDF.project-member', $request->project)) {
|
||||
$out['status'] = array();
|
||||
@ -75,16 +76,37 @@ class IDF_Views_Api
|
||||
} else {
|
||||
// We need to give back the results of the creation
|
||||
if (is_object($p) and 'IDF_Issue' == get_class($p)) {
|
||||
$out['mess'] = 'success';
|
||||
$out['message'] = 'success';
|
||||
$out['issue'] = $p->id;
|
||||
} else {
|
||||
$out['mess'] = 'error';
|
||||
$out['message'] = 'error';
|
||||
$out['errors'] = $p['form']->errors;
|
||||
}
|
||||
}
|
||||
return new Pluf_HTTP_Response_Json($out);
|
||||
}
|
||||
|
||||
/**
|
||||
* List all the projects
|
||||
*/
|
||||
public $projectIndex_precond = array('IDF_Precondition::apiSetUser');
|
||||
|
||||
public function projectIndex($request, $match)
|
||||
{
|
||||
$view = new IDF_Views();
|
||||
$projects = $view->index($request, $match, true);
|
||||
|
||||
$data = array();
|
||||
foreach ($projects as $p) {
|
||||
$data[] = array("shortname" => $p->shortname, "name" => $p->name, "shortdesc" => $p->shortdesc, "private" => $p->private);
|
||||
}
|
||||
|
||||
$out = array();
|
||||
$out['message'] = 'success';
|
||||
$out['projects'] = $data;
|
||||
return new Pluf_HTTP_Response_Json($out);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of tags to give them to the end users when doing a
|
||||
* GET request against a form. That way it is possible for them to
|
||||
|
@ -71,12 +71,10 @@ class IDF_Views_Download
|
||||
$pag->no_results_text = __('No downloads were found.');
|
||||
$pag->sort_order = array('creation_dtime', 'DESC');
|
||||
$pag->setFromRequest($request);
|
||||
$tags = $prj->getTagCloud('downloads');
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/downloads/index.html',
|
||||
array(
|
||||
'page_title' => $title,
|
||||
'downloads' => $pag,
|
||||
'tags' => $tags,
|
||||
'deprecated' => count($ids),
|
||||
'dlabel' => $dtag,
|
||||
),
|
||||
@ -370,4 +368,4 @@ function IDF_Views_Download_SummaryAndLabels($field, $down, $extra='')
|
||||
function IDF_Views_Download_Size($field, $down)
|
||||
{
|
||||
return Pluf_Utils::prettySize($down->$field);
|
||||
}
|
||||
}
|
||||
|
@ -71,8 +71,7 @@ class IDF_Views_Issue
|
||||
'page_title' => $title,
|
||||
'open' => $open,
|
||||
'closed' => $closed,
|
||||
'issues' => $pag,
|
||||
'cloud' => 'issues');
|
||||
'issues' => $pag);
|
||||
if ($api) return $params;
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/issues/index.html',
|
||||
$params, $request);
|
||||
|
@ -121,6 +121,17 @@ class IDF_Views_Project
|
||||
return $classes;
|
||||
}
|
||||
|
||||
/**
|
||||
* This action serves as URI compatibility layer for v1.0.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public function timelineCompat($request, $match)
|
||||
{
|
||||
$match[2] = 'all';
|
||||
return $this->timeline($request, $match);
|
||||
}
|
||||
|
||||
/**
|
||||
* Timeline of the project.
|
||||
*/
|
||||
@ -178,6 +189,17 @@ class IDF_Views_Project
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This action serves as URI compatibility layer for v1.0.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public function timelineFeedCompat($request, $match)
|
||||
{
|
||||
$match[2] = 'all';
|
||||
return $this->timelineFeed($request, $match);
|
||||
}
|
||||
|
||||
/**
|
||||
* Timeline feed.
|
||||
*
|
||||
@ -192,7 +214,6 @@ class IDF_Views_Project
|
||||
$prj = $request->project;
|
||||
$model_filter = @$match[2];
|
||||
|
||||
$model_filter = @$match[2];
|
||||
$all_model_filters = self::getAvailableModelFilters();
|
||||
if (!array_key_exists($model_filter, $all_model_filters)) {
|
||||
$model_filter = 'all';
|
||||
@ -225,7 +246,7 @@ class IDF_Views_Project
|
||||
$tmpl = new Pluf_Template('idf/index.atom');
|
||||
$feedurl = Pluf::f('url_base').Pluf::f('idf_base').$request->query;
|
||||
$viewurl = Pluf_HTTP_URL_urlForView('IDF_Views_Project::timeline',
|
||||
array($prj->shortname));
|
||||
array($prj->shortname, $model_filter));
|
||||
$context = new Pluf_Template_Context_Request($request,
|
||||
array('body' => $out,
|
||||
'date' => $date,
|
||||
|
@ -56,11 +56,15 @@ class IDF_Views_Source
|
||||
public function invalidRevision($request, $match)
|
||||
{
|
||||
$title = sprintf(__('%s Invalid Revision'), (string) $request->project);
|
||||
$scm = IDF_Scm::get($request->project);
|
||||
$branches = $scm->getBranches();
|
||||
|
||||
$commit = $match[2];
|
||||
$params = array(
|
||||
'page_title' => $title,
|
||||
'title' => $title,
|
||||
'commit' => $commit,
|
||||
'branches' => $branches,
|
||||
);
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/source/invalid_revision.html',
|
||||
$params, $request);
|
||||
@ -299,7 +303,8 @@ class IDF_Views_Source
|
||||
$title = sprintf(__('%s Commit Details'), (string) $request->project);
|
||||
$page_title = sprintf(__('%s Commit Details - %s'), (string) $request->project, $commit);
|
||||
$rcommit = IDF_Commit::getOrAdd($cobject, $request->project);
|
||||
$diff = new IDF_Diff($cobject->diff);
|
||||
$diff = new IDF_Diff($cobject->diff, $scm->getDiffPathStripLevel());
|
||||
$cobject->diff = null;
|
||||
$diff->parse();
|
||||
$scmConf = $request->conf->getVal('scm', 'git');
|
||||
try {
|
||||
|
@ -127,12 +127,14 @@ class IDF_Views_User
|
||||
$form = new IDF_Form_UserAccount(null, $params);
|
||||
}
|
||||
$keys = $request->user->get_idf_key_list();
|
||||
$mailaddrs = Pluf::factory('IDF_EmailAddress')->get_email_addresses_for_user($request->user);
|
||||
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/user/myaccount.html',
|
||||
array('page_title' => __('Your Account'),
|
||||
'api_key' => $api_key,
|
||||
'ext_pass' => $ext_pass,
|
||||
'keys' => $keys,
|
||||
'mailaddrs' => $mailaddrs,
|
||||
'form' => $form),
|
||||
$request);
|
||||
}
|
||||
@ -157,6 +159,26 @@ class IDF_Views_User
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a mail address.
|
||||
*
|
||||
* This is redirecting to the preferences
|
||||
*/
|
||||
public $deleteMail_precond = array('Pluf_Precondition::loginRequired');
|
||||
public function deleteMail($request, $match)
|
||||
{
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_User::myAccount');
|
||||
if ($request->method == 'POST') {
|
||||
$address = Pluf_Shortcuts_GetObjectOr404('IDF_EmailAddress', $match[1]);
|
||||
if ($address->user != $request->user->id) {
|
||||
return new Pluf_HTTP_Response_Forbidden($request);
|
||||
}
|
||||
$address->delete();
|
||||
$request->user->setMessage(__('The address has been deleted.'));
|
||||
}
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enter the key to change an email address.
|
||||
*
|
||||
@ -190,7 +212,7 @@ class IDF_Views_User
|
||||
$key = $match[1];
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_User::changeEmailInputKey');
|
||||
try {
|
||||
list($email, $id, $time) = IDF_Form_UserChangeEmail::validateKey($key);
|
||||
list($email, $id, $time, $type) = IDF_Form_UserChangeEmail::validateKey($key);
|
||||
} catch (Pluf_Form_Invalid $e) {
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
@ -198,8 +220,15 @@ class IDF_Views_User
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
// Now we have a change link coming from the right user.
|
||||
$request->user->email = $email;
|
||||
$request->user->update();
|
||||
if ($type == "primary") {
|
||||
$request->user->email = $email;
|
||||
$request->user->update();
|
||||
} else {
|
||||
$mailaddress = new IDF_EmailAddress();
|
||||
$mailaddress->user = $request->user;
|
||||
$mailaddress->address = $email;
|
||||
$mailaddress->create();
|
||||
}
|
||||
$request->user->setMessage(sprintf(__('Your new email address "%s" has been validated. Thank you!'), Pluf_esc($email)));
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_User::myAccount');
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
|
@ -67,12 +67,10 @@ class IDF_Views_Wiki
|
||||
$pag->no_results_text = __('No documentation pages were found.');
|
||||
$pag->sort_order = array('title', 'ASC');
|
||||
$pag->setFromRequest($request);
|
||||
$tags = $prj->getTagCloud('wiki');
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/wiki/index.html',
|
||||
array(
|
||||
'page_title' => $title,
|
||||
'pages' => $pag,
|
||||
'tags' => $tags,
|
||||
'deprecated' => count($ids),
|
||||
'dlabel' => $dtag,
|
||||
),
|
||||
|
@ -246,7 +246,7 @@ $cfg['template_context_processors'] = array('IDF_Middleware_ContextPreProcessor'
|
||||
$cfg['idf_views'] = dirname(__FILE__).'/urls.php';
|
||||
|
||||
# available languages
|
||||
$cfg['languages'] = array('en', 'fr');
|
||||
$cfg['languages'] = array('en', 'fr', 'de', 'es_ES');
|
||||
|
||||
# SCM base configuration
|
||||
$cfg['allowed_scm'] = array('git' => 'IDF_Scm_Git',
|
||||
|
@ -91,6 +91,23 @@ $ctl[] = array('regex' => '#^/p/([\-\w]+)/feed/timeline/(\w+)/token/(.*)/$#',
|
||||
'method' => 'timelineFeed',
|
||||
'name' => 'idf_project_timeline_feed_auth');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/timeline/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Project',
|
||||
'method' => 'timelineCompat');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/feed/timeline/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Project',
|
||||
'method' => 'timelineFeedCompat',
|
||||
'name' => 'idf_project_timeline_feed');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/feed/timeline/token/(.*)/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Project',
|
||||
'method' => 'timelineFeedCompat',
|
||||
'name' => 'idf_project_timeline_feed_auth');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/issues/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Issue',
|
||||
@ -145,12 +162,12 @@ $ctl[] = array('regex' => '#^/p/([\-\w]+)/issues/watchlist/(\w+)$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Issue',
|
||||
'method' => 'watchList');
|
||||
|
||||
|
||||
$ctl[] = array('regex' => '#^/watchlist/(\w+)$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Issue',
|
||||
'method' => 'forgeWatchList');
|
||||
|
||||
|
||||
// ---------- SCM ----------------------------------------
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/source/help/$#',
|
||||
@ -364,6 +381,11 @@ $ctl[] = array('regex' => '#^/api/p/([\-\w]+)/issues/create/$#',
|
||||
'model' => 'IDF_Views_Api',
|
||||
'method' => 'issueCreate');
|
||||
|
||||
$ctl[] = array('regex' => '#^/api/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Api',
|
||||
'method' => 'projectIndex');
|
||||
|
||||
// ---------- FORGE ADMIN --------------------------------
|
||||
|
||||
$ctl[] = array('regex' => '#^/admin/projects/$#',
|
||||
@ -471,6 +493,11 @@ $ctl[] = array('regex' => '#^/preferences/email/ak/(.*)/$#',
|
||||
'model' => 'IDF_Views_User',
|
||||
'method' => 'changeEmailDo');
|
||||
|
||||
$ctl[] = array('regex' => '#^/preferences/email/(\d+)/delete/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_User',
|
||||
'method' => 'deleteMail');
|
||||
|
||||
$ctl[] = array('regex' => '#^/preferences/key/(\d+)/delete/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_User',
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -44,6 +44,7 @@ $m['IDF_Commit'] = array('relate_to' => array('IDF_Project', 'Pluf_User'));
|
||||
$m['IDF_Scm_Cache_Git'] = array('relate_to' => array('IDF_Project'));
|
||||
|
||||
$m['IDF_UserData'] = array('relate_to' => array('Pluf_User'));
|
||||
$m['IDF_EmailAddress'] = array('relate_to' => array('Pluf_User'));
|
||||
|
||||
Pluf_Signal::connect('Pluf_Template_Compiler::construct_template_tags_modifiers',
|
||||
array('IDF_Middleware', 'updateTemplateTagsModifiers'));
|
||||
|
@ -32,6 +32,7 @@
|
||||
{block extraheader}{/block}
|
||||
<title>{block pagetitle}{$page_title|strip_tags}{/block}{if $project} - {$project.shortdesc}{/if}</title>
|
||||
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
|
||||
{appversion}
|
||||
</head>
|
||||
<body>
|
||||
<div id="{block docid}doc3{/block}">
|
||||
|
@ -32,6 +32,7 @@
|
||||
{block extraheader}{/block}
|
||||
<title>{block pagetitle}{$page_title|strip_tags}{/block}</title>
|
||||
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
|
||||
{appversion}
|
||||
</head>
|
||||
<body>
|
||||
<div id="{block docid}doc3{/block}" class="{block docclass}yui-t3{/block}">
|
||||
|
@ -32,6 +32,7 @@
|
||||
{block extraheader}{/block}
|
||||
<title>{block pagetitle}{$page_title|strip_tags}{/block}{if $project} - {$project.shortdesc}{/if}</title>
|
||||
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
|
||||
{appversion}
|
||||
</head>
|
||||
<body>
|
||||
<div id="{block docid}doc3{/block}" class="{block docclass}yui-t3{/block}">
|
||||
|
@ -9,13 +9,9 @@
|
||||
{/block}
|
||||
{block context}
|
||||
<p><strong>{trans 'Number of files:'}</strong> {$downloads.nb_items}</p>
|
||||
{assign $class = ''}{assign $i = 0}
|
||||
{if !$label or $label.id != $dlabel.id}
|
||||
<p class="smaller">{foreach $tags as $lab}
|
||||
{aurl 'url', 'IDF_Views_Download::listLabel', array($project.shortname, $lab.id)}
|
||||
{if $class != $lab.class}{if $i != 0}<br />{/if}<strong class="label">{$lab.class}:</strong> {/if}
|
||||
<a href="{$url}" class="label">{$lab.name}</a>,{assign $i = $i + 1}{assign $class = $lab.class}{/foreach}</p>
|
||||
{/if}
|
||||
{assign $cloud_url = 'IDF_Views_Download::listLabel'}
|
||||
{assign $cloud = 'downloads'}
|
||||
{include 'idf/tags-cloud.html'}
|
||||
{if $deprecated > 0}
|
||||
{aurl 'url', 'IDF_Views_Download::listLabel', array($project.shortname, $dlabel.id)}
|
||||
<p class="helptext">{blocktrans}See <a href="{$url}">the deprecated files</a>.{/blocktrans}</p>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<li><a href="#q-keyboard">{trans 'What are the keyboard shortcuts?'}</a></li>
|
||||
<li><a href="#q-duplicate">{trans 'How to mark an issue as duplicate?'}</a></li>
|
||||
<li><a href="#q-mugshot">{trans 'How can I display my head next to my comments?'}</a></li>
|
||||
<li><a href="#q-api">{trans 'What is the API and how to use it?'}</a></li>
|
||||
<li><a href="#q-api">{trans 'What is the API and how is it used?'}</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="q-keyboard">{trans 'What are the keyboard shortcuts?'}</h2>
|
||||
@ -48,7 +48,7 @@
|
||||
|
||||
<p>{blocktrans}You need to create an account on <a href="http://en.gravatar.com/">Gravatar</a>, this takes about 5 minutes and is free.{/blocktrans}</p>
|
||||
|
||||
<h2 id="q-api">{trans 'What is the API and how to use it?'}</h2>
|
||||
<h2 id="q-api">{trans 'What is the API and how is it used?'}</h2>
|
||||
|
||||
<p>{blocktrans}The API (Application Programming Interface) is used to interact with InDefero with another program. For example, this can be used to create a desktop program to submit new tickets easily.{/blocktrans}</p>{aurl 'url', 'IDF_Views::faqApi'}
|
||||
<p>{blocktrans}<a href="{$url}">Learn more about the API</a>.{/blocktrans}</p>
|
||||
|
@ -31,6 +31,7 @@
|
||||
{block extraheader}{/block}
|
||||
<title>{block pagetitle}{$page_title|strip_tags}{/block}</title>
|
||||
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
|
||||
{appversion}
|
||||
</head>
|
||||
<body>
|
||||
<div id="{block docid}doc3{/block}" class="{block docclass}yui-t3{/block}">
|
||||
|
@ -1,5 +1,5 @@
|
||||
{extends "idf/base-simple.html"}
|
||||
{block docclass}yui-t1{/block}
|
||||
{block docclass}yui-t2{/block}
|
||||
{block tabhome} class="active"{/block}
|
||||
{block subtabs}<a href="{url 'IDF_Views::index'}" class="active">{trans 'Projects'}</a>{/block}
|
||||
{block body}
|
||||
@ -15,6 +15,17 @@
|
||||
{/if}
|
||||
{/block}
|
||||
{block context}
|
||||
<p><strong>{trans 'Managed Projects:'}</strong> {$projects.count()}</p>
|
||||
<div id="stats" class="issue-submit-info">
|
||||
<h3 class="a-c">{trans 'Forge statistics'}</h3>
|
||||
<table>
|
||||
<tr><td class="right">{trans 'Projects:'}</td><td>{$stats.projects}</td></tr>
|
||||
<tr><td class="right">{trans 'Members:'}</td><td>{$stats.members}</td></tr>
|
||||
<tr><td class="right">{trans 'Issues:'}</td><td>{$stats.issues}</td></tr>
|
||||
<tr><td class="right">{trans 'Commits:'}</td><td>{$stats.commits}</td></tr>
|
||||
<tr><td class="right">{trans 'Documentations:'}</td><td>{$stats.docpages}</td></tr>
|
||||
<tr><td class="right">{trans 'Downloads:'}</td><td>{$stats.downloads}</td></tr>
|
||||
<tr><td class="right">{trans 'Code reviews:'}</td><td>{$stats.reviews}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
{/block}
|
||||
{block foot}<div id="branding">Powered by <a href="http://www.indefero.net" title="InDefero, bug tracking and more">InDefero</a>,<br />a <a href="http://www.ceondo.com">Céondo Ltd</a> initiative.</div>{/block}
|
||||
|
@ -12,9 +12,7 @@
|
||||
{aurl 'closed_url', 'IDF_Views_Issue::listStatus', array($project.shortname, 'closed')}
|
||||
{blocktrans}<p><strong>Open issues:</strong> <a href="{$open_url}">{$open}</a></p>
|
||||
<p><strong>Closed issues:</strong> <a href="{$closed_url}">{$closed}</a></p>{/blocktrans}
|
||||
{assign $class = ''}{assign $i = 0}
|
||||
<p class="smaller">{foreach $project.getTagCloud($cloud) as $label}
|
||||
{aurl 'url', 'IDF_Views_Issue::listLabel', array($project.shortname, $label.id, 'open')}
|
||||
{if $class != $label.class}{if $i != 0}<br />{/if}<strong class="label">{$label.class}:</strong> {/if}
|
||||
<a href="{$url}" class="label">{$label.name}</a>,{assign $class = $label.class}{assign $i = $i + 1}{/foreach}</p>
|
||||
{assign $cloud_url = 'IDF_Views_Issue::listLabel'}
|
||||
{assign $cloud = 'issues'}
|
||||
{include 'idf/tags-cloud.html'}
|
||||
{/block}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{extends "idf/issues/base.html"}
|
||||
{block titleicon}{if $form}<form class="star" method="post" action="{url 'IDF_Views_Issue::star', array($project.shortname, $issue.id)}"><input type="image" src="{if $starred}{media '/idf/img/star.png'}{else}{media '/idf/img/star-grey.png'}{/if}" name="submit" title="{if $starred}{trans 'Remove this issue from your watch list'}{else}{trans 'Add this issue to your watch list'}{/if}" /></form> {/if}{/block}
|
||||
{block body}
|
||||
<div style="float:right;">
|
||||
<div class="issue-prev-next">
|
||||
{if $previous_issue_id}
|
||||
<a href="{url 'IDF_Views_Issue::view', array($project.shortname, $previous_issue_id)}" title="{if $closed}{trans 'Click here to view the previous closed issue'}{else}{trans 'Click here to view the previous open issue'}{/if}">Previous issue</a>
|
||||
{/if}
|
||||
|
@ -1,18 +1,22 @@
|
||||
{extends "idf/base-simple.html"}
|
||||
{block docclass}yui-t1{/block}
|
||||
{block docclass}yui-t2{/block}
|
||||
{block body}
|
||||
<form method="post" action="{url 'IDF_Views::login'}">
|
||||
<input type="hidden" name="_redirect_after" value="{$_redirect_after}" />
|
||||
{if $error}
|
||||
<p class="px-message-error">{$error}</p>
|
||||
{/if}
|
||||
<h3>{trans 'What is your login?'}</h3>
|
||||
<p><label for="id_login">{trans 'My login is'}</label> <input type="text" name="login" id="id_login" value="{$login}" /></p>
|
||||
|
||||
<h3>{trans 'Do you have a password?'}</h3>
|
||||
<p><input name="action" id="action-new-user" value="new-user" type="radio" /> <label for="action-new-user">{trans 'No, I am a new here.'}</label></p>
|
||||
|
||||
<p><input name="action" id="action-login" value="login" type="radio" checked="checked" /> <label for="action-login">{trans 'Yes'}</label>, <label for="id_password">{trans 'my password is'}</label> <input type="password" name="password" id="id_password" /></p>
|
||||
<h3>{trans 'What is your account information?'}</h3>
|
||||
<table class="form" summary="">
|
||||
<tr>
|
||||
<th class="a-r"><strong>{trans 'My login is'}</strong></th>
|
||||
<td class="a-l"><input type="text" name="login" id="id_login" value="{$login}" /></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="a-r"><strong>{trans 'My password is'}</strong></th>
|
||||
<td class="a-l"><input type="password" name="password" id="id_password" /></th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><input type="submit" value="{trans 'Sign in'}" />
|
||||
| <a href="{url 'IDF_Views::passwordRecoveryAsk'}">{trans 'I lost my password!'}</a>
|
||||
@ -22,3 +26,10 @@
|
||||
document.getElementById('id_login').focus()
|
||||
</script>
|
||||
{/block}
|
||||
{block context}
|
||||
<div class="issue-submit-info">
|
||||
<h3>{trans 'Welcome.'}</h3>
|
||||
{aurl 'url', 'IDF_Views::register', array()}
|
||||
<p>{blocktrans}If you don't have an account yet, you can create one <a href="{$url}">here</a>.{/blocktrans}</a></p>
|
||||
<p>{trans 'It takes less than a minute to create your account.'}</p></div>
|
||||
{/block}
|
||||
|
@ -13,9 +13,12 @@
|
||||
{/block}
|
||||
|
||||
{block context}
|
||||
<p><span class="label{if 'all' == $model_filter} active{/if}"><a href="{url 'IDF_Views_Project::timeline', array($project.shortname, 'all')}">{trans 'All Updates'}</a></span></p>
|
||||
<p><strong>{trans 'Filter by type'}</strong><br />
|
||||
{foreach $all_model_filters as $filter_key => $filter_name}
|
||||
{if $filter_key != 'all'}
|
||||
<span class="label{if $filter_key == $model_filter} active{/if}"><a href="{url 'IDF_Views_Project::timeline', array($project.shortname, $filter_key)}">{$filter_name}</a></span><br />
|
||||
{/if}
|
||||
{/foreach}
|
||||
</p>
|
||||
{/block}
|
||||
|
@ -2,7 +2,7 @@
|
||||
{block body}
|
||||
{if $form.errors}
|
||||
<div class="px-message-error">
|
||||
<p>{trans 'Oups, please check the form for errors.'}</p>
|
||||
<p>{trans 'Oops, please check the form for errors.'}</p>
|
||||
{if $form.get_top_errors}
|
||||
{$form.render_top_errors|unsafe}
|
||||
{/if}
|
||||
|
@ -2,7 +2,7 @@
|
||||
{block body}
|
||||
{if $form.errors}
|
||||
<div class="px-message-error">
|
||||
<p>{trans 'Oups, please check the provided login and email address to register.'}</p>
|
||||
<p>{trans 'Oops, please check the provided login and email address to register.'}</p>
|
||||
{if $form.get_top_errors}
|
||||
{$form.render_top_errors|unsafe}
|
||||
{/if}
|
||||
@ -48,7 +48,8 @@
|
||||
{block context}
|
||||
<div class="issue-submit-info">
|
||||
<p>{trans 'Be sure to provide a valid email address, as we are sending a validation link by email.'}</p>
|
||||
|
||||
{aurl 'url', 'IDF_Views::passwordRecoveryAsk'}
|
||||
<p>{blocktrans}If you have just forgotten your login information, then there is no need to create a new account. Just go <a href="{$url}">here</a> to recover your login name and password.{/blocktrans}</p>
|
||||
<p><strong>{trans 'Did you know?'}</strong><br />
|
||||
{aurl 'url', 'IDF_Views::faq'}
|
||||
{blocktrans}With your account, you will able to participate in the life of all the projects hosted here. Participating in a software project must be fun, so if you have troubles, you can <a href="{$url}">let us know about your issues at anytime</a>!{/blocktrans}</p>
|
||||
|
@ -2,7 +2,7 @@
|
||||
{block body}
|
||||
{if $form.errors}
|
||||
<div class="px-message-error">
|
||||
<p>{trans 'Oups, we found an error in the form.'}</p>
|
||||
<p>{trans 'Oops, we found an error in the form.'}</p>
|
||||
{if $form.get_top_errors}
|
||||
{$form.render_top_errors|unsafe}
|
||||
{/if}
|
||||
|
@ -57,7 +57,7 @@
|
||||
<ul>
|
||||
<li>A commit or revision of the current code in the repository from which you started your work.</li>
|
||||
<li>A patch describing your changes with respect to the reference commit.</li>
|
||||
<li><strong>Ensure your patch does not contain any passwords or confidential information!</strong></li>
|
||||
<li><strong>Check your patch does not provide any password or confidential information!</strong></li>
|
||||
</ul>{/blocktrans}
|
||||
</div>
|
||||
{/block}
|
||||
|
@ -9,9 +9,9 @@
|
||||
<tr>
|
||||
<th><strong>{trans 'Author:'}</strong></th><td>{showuser $rcommit.get_author(), $request, $cobject.author}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
{if $cobject.branch}<tr>
|
||||
<th><strong>{trans 'Branch:'}</strong></th><td>{$cobject.branch}</td>
|
||||
</tr>
|
||||
</tr>{/if}
|
||||
<tr>
|
||||
<th><strong>{trans 'Commit:'}</strong></th><td class="mono"><a href="{url 'IDF_Views_Source::treeBase', array($project.shortname, $commit)}" title="{trans 'View corresponding source tree'}">{$cobject.commit}</a></td>
|
||||
</tr>
|
||||
@ -23,7 +23,7 @@
|
||||
</tr>{/if}
|
||||
<tr>
|
||||
<th><strong>{trans 'Message:'}</strong></th><td>{issuetext $cobject.title, $request}{if isset($cobject.full_message)}<br/><br/>{issuetext $cobject.full_message, $request, true, false, true, true, true}{/if}</td>
|
||||
</tr>{if count($changes)}
|
||||
</tr>{if count($cobject.parents) < 2 and count($changes)}
|
||||
<tr>
|
||||
<th><strong>{trans 'Changes:'}</strong></th>
|
||||
<td>
|
||||
@ -38,8 +38,7 @@
|
||||
<tr><td><span class="scm-action added" title="{trans 'added'}">A</span></td><td><a href="{url 'IDF_Views_Source::tree', array($project.shortname, $commit, $filename)}">{$filename}</a>{if !empty($diff.files[$filename])} (<a href="#diff-{$filename|md5}">{trans 'full'}</a>){/if}</td></tr>
|
||||
{/foreach}
|
||||
{foreach $changes.patches as $filename}
|
||||
{assign $ndiff = count($diff.files[$filename]['chunks'])}
|
||||
<tr><td><span class="scm-action patched" title="{trans 'modified'}">M</span></td><td><a href="{url 'IDF_Views_Source::tree', array($project.shortname, $commit, $filename)}">{$filename}</a>{if !empty($diff.files[$filename])} (<a href="#diff-{$filename|md5}">{blocktrans $ndiff}{$ndiff} diff{plural}{$ndiff} diffs{/blocktrans}</a>){/if}</td></tr>
|
||||
<tr><td><span class="scm-action patched" title="{trans 'modified'}">M</span></td><td><a href="{url 'IDF_Views_Source::tree', array($project.shortname, $commit, $filename)}">{$filename}</a>{if !empty($diff.files[$filename])}{assign $ndiff = count($diff.files[$filename]['chunks'])} (<a href="#diff-{$filename|md5}">{blocktrans $ndiff}{$ndiff} diff{plural}{$ndiff} diffs{/blocktrans}</a>){/if}</td></tr>
|
||||
{/foreach}
|
||||
{foreach $changes.properties as $filename => $properties}
|
||||
<tr><td><span class="scm-action property-changed" title="{trans 'properies changed'}">P</span></td><td><a href="{url 'IDF_Views_Source::tree', array($project.shortname, $commit, $filename)}">{$filename}</a>
|
||||
@ -61,11 +60,13 @@
|
||||
</tr>{/if} {* End of the if count($changes) *}
|
||||
</table>
|
||||
|
||||
{if count($diff.files)}
|
||||
{if count($cobject.parents) < 2 and count($diff.files)}
|
||||
<h2>{trans 'File differences'}</h2>
|
||||
|
||||
{$diff.as_html()}
|
||||
{/if}{if count($diff.files) or $large_commit}
|
||||
{/if}
|
||||
|
||||
{if count($cobject.parents) < 2 and (count($diff.files) or $large_commit)}
|
||||
{aurl 'url', 'IDF_Views_Source::downloadDiff', array($project.shortname, $commit)}
|
||||
<p class="right soft"><a href="{$url}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/package-grey.png'}" alt="{trans 'Archive'}" align="bottom"/></a> <a href="{$url}">{trans 'Download the corresponding diff file'}</a></p>
|
||||
{/if}
|
||||
|
@ -11,7 +11,7 @@ code.{/blocktrans}</p>
|
||||
<p><kbd>git clone {$project.getSourceAccessUrl($user)}</kbd></p>
|
||||
|
||||
{aurl 'url', 'IDF_Views_User::myAccount'}
|
||||
<p>{blocktrans}You may need to <a href="{$url}">provide your SSH key</a>. The synchronization of your SSH key can take a couple of minutes. You can learn more about <a href="http://www.google.com/search?q=public+ssh+key+authentication">SSH key authentification</a>.{/blocktrans}</p>
|
||||
<p>{blocktrans}You may need to <a href="{$url}">provide your SSH key</a>. The synchronization of your SSH key can take a couple of minutes. You can learn more about <a href="http://www.google.com/search?q=public+ssh+key+authentication">SSH key authentication</a>.{/blocktrans}</p>
|
||||
|
||||
{if $isOwner or $isMember}
|
||||
<h3>{trans 'First Commit'}</h3>
|
||||
|
@ -2,9 +2,19 @@
|
||||
{block docclass}yui-t2{assign $inError=true}{/block}
|
||||
{block body}
|
||||
|
||||
<p>{blocktrans}The revision <b>{$commit}</b> is not valid or does not exist
|
||||
<p>{blocktrans}The branch or revision <b>{$commit}</b> is not valid or does not exist
|
||||
in this repository.{/blocktrans}</p>
|
||||
|
||||
<p>{blocktrans}The following list shows all available branches:{/blocktrans}</p>
|
||||
<ul>
|
||||
{foreach $branches as $branch => $path}
|
||||
{aurl 'url', 'IDF_Views_Source::treeBase', array($project.shortname, $branch)}
|
||||
<li class="label">
|
||||
<a href="{$url}" class="label">{if $path}{$path}{else}{$branch}{/if}</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
|
||||
{if $isOwner or $isMember}
|
||||
{aurl 'url', 'IDF_Views_Source::help', array($project.shortname)}
|
||||
<p>{blocktrans}If this is a new repository, the reason for this error
|
||||
|
8
src/IDF/templates/idf/tags-cloud.html
Normal file
8
src/IDF/templates/idf/tags-cloud.html
Normal file
@ -0,0 +1,8 @@
|
||||
{assign $class = ''}{assign $i = 0}
|
||||
<div id="tagscloud" class="smaller"><dl>{foreach $project.getTagCloud($cloud) as $label}
|
||||
{aurl 'url', $cloud_url, array($project.shortname, $label.id, 'open')}
|
||||
{if $class != $label.class}<dt class="label">{$label.class}</dt>{assign $i = 0}{/if}
|
||||
<dd><a href="{$url}" class="label">{$label.name},</a></dd>
|
||||
{assign $class = $label.class}
|
||||
{assign $i = $i + 1}
|
||||
{/foreach}</dl></p>
|
@ -2,7 +2,7 @@
|
||||
{block body}
|
||||
{if $form.errors}
|
||||
<div class="px-message-error">
|
||||
<p>{trans 'Oups, we found an error in the form.'}</p>
|
||||
<p>{trans 'Oops, we found an error in the form.'}</p>
|
||||
{if $form.get_top_errors}
|
||||
{$form.render_top_errors|unsafe}
|
||||
{/if}
|
||||
|
@ -2,7 +2,7 @@
|
||||
{block body}
|
||||
{if $form.errors}
|
||||
<div class="px-message-error">
|
||||
<p>{trans 'Oups, please check the form for errors.'}</p>
|
||||
<p>{trans 'Oops, please check the form for errors.'}</p>
|
||||
{if $form.get_top_errors}
|
||||
{$form.render_top_errors|unsafe}
|
||||
{/if}
|
||||
@ -100,6 +100,14 @@
|
||||
<span class="helptext">{$form.f.public_key.help_text}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" class="separator">{trans "Secondary Emails"}</td></tr>
|
||||
<tr>
|
||||
<th>{$form.f.secondary_mail.labelTag}:</th>
|
||||
<td>{if $form.f.secondary_mail.errors}{$form.f.secondary_mail.fieldErrors}{/if}
|
||||
{$form.f.secondary_mail|unsafe}<br />
|
||||
<span class="helptext">{$form.f.secondary_mail.help_text}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="pass-info" id="extra-password">
|
||||
<th>{trans 'Extra password'}:</th>
|
||||
<td><span class="mono">{$ext_pass}</span><br />
|
||||
@ -129,6 +137,15 @@
|
||||
</tr>{/foreach}
|
||||
</table>
|
||||
{/if}
|
||||
{if count($mailaddrs)>1}
|
||||
<table summary=" " class="recent-issues">
|
||||
<tr><th colspan="2">{trans 'Your additional email addresses'}</th></tr>
|
||||
{foreach $mailaddrs as $mail}{if $mail.id != -1}<tr><td>
|
||||
{$mail.address}</td><td> <form class="star" method="post" action="{url 'IDF_Views_User::deleteMail', array($mail.id)}"><input type="image" src="{media '/idf/img/trash.png'}" name="submit" value="{trans 'Delete this address'}" /></form>
|
||||
</td>
|
||||
</tr>{/if}{/foreach}
|
||||
</table>
|
||||
{/if}
|
||||
{/block}
|
||||
{block context}
|
||||
<div class="issue-submit-info">
|
||||
|
@ -2,7 +2,7 @@
|
||||
{block body}
|
||||
{if $form.errors}
|
||||
<div class="px-message-error">
|
||||
<p>{trans 'Oups, please check the provided login or email address to recover your password.'}</p>
|
||||
<p>{trans 'Oops, please check the provided login or email address to recover your password.'}</p>
|
||||
{if $form.get_top_errors}
|
||||
{$form.render_top_errors|unsafe}
|
||||
{/if}
|
||||
|
@ -2,7 +2,7 @@
|
||||
{block body}
|
||||
{if $form.errors}
|
||||
<div class="px-message-error">
|
||||
<p>{trans 'Oups, we found an error in the form.'}</p>
|
||||
<p>{trans 'Oops, we found an error in the form.'}</p>
|
||||
{if $form.get_top_errors}
|
||||
{$form.render_top_errors|unsafe}
|
||||
{/if}
|
||||
@ -30,7 +30,7 @@
|
||||
<div class="issue-submit-info">
|
||||
<h2>{trans 'Instructions'}</h2>
|
||||
<p>{trans 'Use your email software to read your emails and open your verification email. Either click directly on the verification link or copy/paste the verification key in the box and submit the form.'}</p>
|
||||
<p>{trans 'Just after providing the confirmation key, you will be able to reset your password and use again this website fully.'}</p>
|
||||
<p>{trans 'Just after providing the confirmation key, you will be able to reset your password and use this website fully.'}</p>
|
||||
</div>
|
||||
{/block}
|
||||
{block javascript}<script type="text/javascript">
|
||||
|
@ -2,7 +2,7 @@
|
||||
{block body}
|
||||
{if $form.errors}
|
||||
<div class="px-message-error">
|
||||
<p>{trans 'Oups, please check the form for errors.'}</p>
|
||||
<p>{trans 'Oops, please check the form for errors.'}</p>
|
||||
{if $form.get_top_errors}
|
||||
{$form.render_top_errors|unsafe}
|
||||
{/if}
|
||||
|
@ -9,13 +9,9 @@
|
||||
{/block}
|
||||
{block context}
|
||||
<p><strong>{trans 'Number of pages:'}</strong> {$pages.nb_items}</p>
|
||||
{assign $class = ''}{assign $i = 0}
|
||||
{if !$label or $label.id != $dlabel.id}
|
||||
<p class="smaller">{foreach $tags as $lab}
|
||||
{aurl 'url', 'IDF_Views_Wiki::listLabel', array($project.shortname, $lab.id)}
|
||||
{if $class != $lab.class}{if $i != 0}<br />{/if}<strong class="label">{$lab.class}:</strong> {/if}
|
||||
<a href="{$url}" class="label">{$lab.name}</a>,{assign $i = $i + 1}{assign $class = $lab.class}{/foreach}</p>
|
||||
{/if}
|
||||
{assign $cloud_url = 'IDF_Views_Wiki::listLabel'}
|
||||
{assign $cloud = 'wiki'}
|
||||
{include 'idf/tags-cloud.html'}
|
||||
{if $deprecated > 0}
|
||||
{aurl 'url', 'IDF_Views_Wiki::listLabel', array($project.shortname, $dlabel.id)}
|
||||
<p class="helptext">{blocktrans}See <a href="{$url}">the deprecated pages</a>.{/blocktrans}</p>
|
||||
|
5
src/IDF/version.php
Normal file
5
src/IDF/version.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'version' => '1.1.3-dev',
|
||||
'revision' => '$Format:%H$',
|
||||
);
|
30
test/IDF/DiffTest.php
Normal file
30
test/IDF/DiffTest.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
include 'IDF/Diff.php';
|
||||
|
||||
class IDF_DiffTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testParse()
|
||||
{
|
||||
$datadir = DATADIR.'/'.__CLASS__;
|
||||
|
||||
foreach (glob($datadir.'/*.diff') as $difffile)
|
||||
{
|
||||
$diffprefix = 0;
|
||||
if (strpos($difffile, '-git-') != false || strpos($difffile, '-hg-') != false)
|
||||
{
|
||||
$diffprefix = 1;
|
||||
}
|
||||
|
||||
$expectedfile = str_replace('.diff', '.expected', $difffile);
|
||||
$expectedcontent = @file_get_contents($expectedfile);
|
||||
|
||||
$diffcontent = file_get_contents($difffile);
|
||||
$diff = new IDF_Diff($diffcontent, $diffprefix);
|
||||
$this->assertEquals(unserialize($expectedcontent),
|
||||
$diff->parse(),
|
||||
'parsed diff '.$difffile.' does not match');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
7
test/bootstrap.php
Normal file
7
test/bootstrap.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
define('SRCDIR', realpath(dirname(__FILE__) . '/../src'));
|
||||
define('TESTDIR', dirname(__FILE__));
|
||||
define('DATADIR', TESTDIR . '/data');
|
||||
|
||||
set_include_path(get_include_path() . PATH_SEPARATOR . SRCDIR);
|
1032
test/data/IDF_DiffTest/test-01-svn-new-files.diff
Normal file
1032
test/data/IDF_DiffTest/test-01-svn-new-files.diff
Normal file
File diff suppressed because it is too large
Load Diff
1
test/data/IDF_DiffTest/test-01-svn-new-files.expected
Normal file
1
test/data/IDF_DiffTest/test-01-svn-new-files.expected
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,389 @@
|
||||
Index: LinuxBIOSv1/src/include/cpu/i786/cpufixup.h
|
||||
===================================================================
|
||||
--- LinuxBIOSv1/src/include/cpu/i786/cpufixup.h (Revision 0)
|
||||
+++ LinuxBIOSv1/src/include/cpu/i786/cpufixup.h (Revision 665)
|
||||
@@ -0,0 +1,11 @@
|
||||
+#ifndef CPU_I786_CPUFIXUP_H
|
||||
+#define CPU_I786_CPUFIXUP_H
|
||||
+
|
||||
+
|
||||
+void i786_cpufixup(struct mem_range *mem);
|
||||
+
|
||||
+#define L3_CACHE_DISABLE 0x40
|
||||
+
|
||||
+#endif /* CPU_I786_CPUFIXUP_H */
|
||||
+
|
||||
+
|
||||
|
||||
Eigenschaftsänderungen: LinuxBIOSv1\src\include\cpu\i786\cpufixup.h
|
||||
___________________________________________________________________
|
||||
Hinzugefügt: svn:keywords
|
||||
+ Author Date Id Revision
|
||||
Hinzugefügt: svn:eol-style
|
||||
+ native
|
||||
|
||||
Index: LinuxBIOSv1/src/mainboard/tyan/guiness/cmos.layout
|
||||
===================================================================
|
||||
--- LinuxBIOSv1/src/mainboard/tyan/guiness/cmos.layout (Revision 0)
|
||||
+++ LinuxBIOSv1/src/mainboard/tyan/guiness/cmos.layout (Revision 665)
|
||||
@@ -0,0 +1,63 @@
|
||||
+entries
|
||||
+
|
||||
+#start-bit length config config-ID name
|
||||
+#0 8 r 0 seconds
|
||||
+#8 8 r 0 alarm_seconds
|
||||
+#16 8 r 0 minutes
|
||||
+#24 8 r 0 alarm_minutes
|
||||
+#32 8 r 0 hours
|
||||
+#40 8 r 0 alarm_hours
|
||||
+#48 8 r 0 day_of_week
|
||||
+#56 8 r 0 day_of_month
|
||||
+#64 8 r 0 month
|
||||
+#72 8 r 0 year
|
||||
+#80 4 r 0 rate_select
|
||||
+#84 3 r 0 REF_Clock
|
||||
+#87 1 r 0 UIP
|
||||
+#88 1 r 0 auto_switch_DST
|
||||
+#89 1 r 0 24_hour_mode
|
||||
+#90 1 r 0 binary_values_enable
|
||||
+#91 1 r 0 square-wave_out_enable
|
||||
+#92 1 r 0 update_finished_enable
|
||||
+#93 1 r 0 alarm_interrupt_enable
|
||||
+#94 1 r 0 periodic_interrupt_enable
|
||||
+#95 1 r 0 disable_clock_updates
|
||||
+#96 288 r 0 temporary_filler
|
||||
+0 384 r 0 reserved_memory
|
||||
+384 1 e 4 boot_option
|
||||
+385 1 e 4 last_boot
|
||||
+386 3 e 5 baud_rate
|
||||
+392 4 e 6 debug_level
|
||||
+396 1 e 1 power_on_after_fail
|
||||
+#401 1 e 1 ECC_memory
|
||||
+#402 1 e 2 hda_disk
|
||||
+#403 1 e 2 hdb_disk
|
||||
+#404 1 e 2 hdc_disk
|
||||
+#405 1 e 2 hdd_disk
|
||||
+#406 2 e 7 boot_device
|
||||
+
|
||||
+enumerations
|
||||
+
|
||||
+#ID value text
|
||||
+1 0 Disable
|
||||
+1 1 Enable
|
||||
+#2 0 No
|
||||
+#2 1 Yes
|
||||
+4 0 Fallback
|
||||
+4 1 Normal
|
||||
+5 0 115200
|
||||
+5 1 57600
|
||||
+5 2 38400
|
||||
+5 3 19200
|
||||
+5 4 9600
|
||||
+5 5 4800
|
||||
+5 6 2400
|
||||
+5 7 1200
|
||||
+6 6 Notice
|
||||
+6 7 Info
|
||||
+6 8 Debug
|
||||
+6 9 Spew
|
||||
+#7 0 Network
|
||||
+#7 1 HDD
|
||||
+#7 2 Floppy
|
||||
+#7 3 ROM
|
||||
|
||||
Eigenschaftsänderungen: LinuxBIOSv1\src\mainboard\tyan\guiness\cmos.layout
|
||||
___________________________________________________________________
|
||||
Hinzugefügt: svn:keywords
|
||||
+ Author Date Id Revision
|
||||
Hinzugefügt: svn:eol-style
|
||||
+ native
|
||||
|
||||
Index: LinuxBIOSv1/src/config/linuxbios_c.ld
|
||||
===================================================================
|
||||
--- LinuxBIOSv1/src/config/linuxbios_c.ld (Revision 0)
|
||||
+++ LinuxBIOSv1/src/config/linuxbios_c.ld (Revision 665)
|
||||
@@ -0,0 +1,105 @@
|
||||
+/*
|
||||
+ * Memory map:
|
||||
+ *
|
||||
+ * _RAMBASE
|
||||
+ * : data segment
|
||||
+ * : bss segment
|
||||
+ * : heap
|
||||
+ * : stack
|
||||
+ */
|
||||
+/*
|
||||
+ * Bootstrap code for the STPC Consumer
|
||||
+ * Copyright (c) 1999 by Net Insight AB. All Rights Reserved.
|
||||
+ *
|
||||
+ * $Id$
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * Written by Johan Rydberg, based on work by Daniel Kahlin.
|
||||
+ * Rewritten by Eric Biederman
|
||||
+ */
|
||||
+/*
|
||||
+ * We use ELF as output format. So that we can
|
||||
+ * debug the code in some form.
|
||||
+ */
|
||||
+INCLUDE ldoptions
|
||||
+
|
||||
+ENTRY(_start)
|
||||
+
|
||||
+SECTIONS
|
||||
+{
|
||||
+ . = _RAMBASE;
|
||||
+ /*
|
||||
+ * First we place the code and read only data (typically const declared).
|
||||
+ * This get placed in rom.
|
||||
+ */
|
||||
+ .text : {
|
||||
+ _text = .;
|
||||
+ *(.text);
|
||||
+ *(.text.*);
|
||||
+ . = ALIGN(16);
|
||||
+ _etext = .;
|
||||
+ }
|
||||
+ .rodata : {
|
||||
+ _rodata = .;
|
||||
+ . = ALIGN(4);
|
||||
+ streams = . ;
|
||||
+ *(.rodata.streams)
|
||||
+ estreams = .;
|
||||
+ . = ALIGN(4);
|
||||
+ pci_drivers = . ;
|
||||
+ *(.rodata.pci_drivers)
|
||||
+ epci_drivers = . ;
|
||||
+ *(.rodata)
|
||||
+ *(.rodata.*)
|
||||
+ _erodata = .;
|
||||
+ }
|
||||
+ /*
|
||||
+ * After the code we place initialized data (typically initialized
|
||||
+ * global variables). This gets copied into ram by startup code.
|
||||
+ * __data_start and __data_end shows where in ram this should be placed,
|
||||
+ * whereas __data_loadstart and __data_loadend shows where in rom to
|
||||
+ * copy from.
|
||||
+ */
|
||||
+ .data : {
|
||||
+ _data = .;
|
||||
+ *(.data)
|
||||
+ _edata = .;
|
||||
+ }
|
||||
+ /*
|
||||
+ * bss does not contain data, it is just a space that should be zero
|
||||
+ * initialized on startup. (typically uninitialized global variables)
|
||||
+ * crt0.S fills between _bss and _ebss with zeroes.
|
||||
+ */
|
||||
+ _bss = .;
|
||||
+ .bss . : {
|
||||
+ *(.bss)
|
||||
+ *(.sbss)
|
||||
+ *(COMMON)
|
||||
+ }
|
||||
+ _ebss = .;
|
||||
+ _end = .;
|
||||
+ _stack = .;
|
||||
+ .stack . : {
|
||||
+ /* Reserve a stack for each possible cpu, +1 extra */
|
||||
+ . = ((MAX_CPUS * STACK_SIZE) + STACK_SIZE) ;
|
||||
+ }
|
||||
+ _estack = .;
|
||||
+ _heap = .;
|
||||
+ .heap . : {
|
||||
+ /* Reserve 256K for the heap */
|
||||
+ . = HEAP_SIZE ;
|
||||
+ . = ALIGN(4);
|
||||
+ }
|
||||
+ _eheap = .;
|
||||
+ /* The ram segment
|
||||
+ * This is all address of the memory resident copy of linuxBIOS.
|
||||
+ */
|
||||
+ _ram_seg = _text;
|
||||
+ _eram_seg = _eheap;
|
||||
+ /DISCARD/ : {
|
||||
+ *(.comment)
|
||||
+ *(.note)
|
||||
+ }
|
||||
+}
|
||||
|
||||
Eigenschaftsänderungen: LinuxBIOSv1\src\config\linuxbios_c.ld
|
||||
___________________________________________________________________
|
||||
Hinzugefügt: svn:keywords
|
||||
+ Author Date Id Revision
|
||||
Hinzugefügt: svn:eol-style
|
||||
+ native
|
||||
|
||||
Index: LinuxBIOSv1/src/arch/i386/include/arch/rom_segs.h
|
||||
===================================================================
|
||||
--- LinuxBIOSv1/src/arch/i386/include/arch/rom_segs.h (Revision 0)
|
||||
+++ LinuxBIOSv1/src/arch/i386/include/arch/rom_segs.h (Revision 665)
|
||||
@@ -0,0 +1,10 @@
|
||||
+#ifndef ROM_SEGS_H
|
||||
+#define ROM_SEGS_H
|
||||
+
|
||||
+#define ROM_CODE_SEG 0x08
|
||||
+#define ROM_DATA_SEG 0x10
|
||||
+
|
||||
+#define CACHE_RAM_CODE_SEG 0x18
|
||||
+#define CACHE_RAM_DATA_SEG 0x20
|
||||
+
|
||||
+#endif /* ROM_SEGS_H */
|
||||
|
||||
Eigenschaftsänderungen: LinuxBIOSv1\src\arch\i386\include\arch\rom_segs.h
|
||||
___________________________________________________________________
|
||||
Hinzugefügt: svn:keywords
|
||||
+ Author Date Id Revision
|
||||
Hinzugefügt: svn:eol-style
|
||||
+ native
|
||||
|
||||
Index: LinuxBIOSv1/src/arch/i386/lib/c_start.S
|
||||
===================================================================
|
||||
--- LinuxBIOSv1/src/arch/i386/lib/c_start.S (Revision 0)
|
||||
+++ LinuxBIOSv1/src/arch/i386/lib/c_start.S (Revision 665)
|
||||
@@ -0,0 +1,135 @@
|
||||
+#include <arch/asm.h>
|
||||
+#include <arch/intel.h>
|
||||
+#ifdef SMP
|
||||
+#include <cpu/p6/apic.h>
|
||||
+#endif
|
||||
+ .section ".text"
|
||||
+ .code32
|
||||
+ .globl _start
|
||||
+_start:
|
||||
+ cli
|
||||
+ lgdt %cs:gdtaddr
|
||||
+ ljmp $0x10, $1f
|
||||
+1: movl $0x18, %ax
|
||||
+ movl %eax, %ds
|
||||
+ movl %eax, %es
|
||||
+ movl %eax, %ss
|
||||
+ movl %eax, %fs
|
||||
+ movl %eax, %gs
|
||||
+
|
||||
+ intel_chip_post_macro(0x13) /* post 12 */
|
||||
+
|
||||
+ /** clear stack */
|
||||
+ leal EXT(_stack), %edi
|
||||
+ movl $EXT(_estack), %ecx
|
||||
+ subl %edi, %ecx
|
||||
+ xorl %eax, %eax
|
||||
+ rep
|
||||
+ stosb
|
||||
+
|
||||
+ /** clear bss */
|
||||
+ leal EXT(_bss), %edi
|
||||
+ movl $EXT(_ebss), %ecx
|
||||
+ subl %edi, %ecx
|
||||
+ jz .Lnobss
|
||||
+ xorl %eax, %eax
|
||||
+ rep
|
||||
+ stosb
|
||||
+.Lnobss:
|
||||
+
|
||||
+ /* set new stack */
|
||||
+ movl $_estack, %esp
|
||||
+#ifdef SMP
|
||||
+ /* Get the cpu id */
|
||||
+ movl $APIC_DEFAULT_BASE, %edi
|
||||
+ movl APIC_ID(%edi), %eax
|
||||
+ shrl $24, %eax
|
||||
+
|
||||
+ /* Get the cpu index (MAX_CPUS on error) */
|
||||
+ movl $-4, %ebx
|
||||
+1: addl $4, %ebx
|
||||
+ cmpl $(MAX_CPUS << 2), %ebx
|
||||
+ je 2
|
||||
+ cmpl %eax, EXT(initial_apicid)(%ebx)
|
||||
+ jne 1b
|
||||
+2: shrl $2, %ebx
|
||||
+
|
||||
+ /* Now compute the appropriate stack */
|
||||
+ movl %ebx, %eax
|
||||
+ movl $STACK_SIZE, %ebx
|
||||
+ mull %ebx
|
||||
+ subl %eax, %esp
|
||||
+
|
||||
+ /* push the boot_complete flag */
|
||||
+ pushl %ebp
|
||||
+
|
||||
+ /* Save the stack location */
|
||||
+ movl %esp, %ebp
|
||||
+
|
||||
+ /*
|
||||
+ * Now we are finished. Memory is up, data is copied and
|
||||
+ * bss is cleared. Now we call the main routine and
|
||||
+ * let it do the rest.
|
||||
+ */
|
||||
+ intel_chip_post_macro(0xfe) /* post fe */
|
||||
+
|
||||
+ /* Resort the stack location */
|
||||
+ movl %ebp, %esp
|
||||
+
|
||||
+ /* The boot_complete flag has already been pushed */
|
||||
+ call EXT(hardwaremain)
|
||||
+ /*NOTREACHED*/
|
||||
+.Lhlt:
|
||||
+ intel_chip_post_macro(0xee) /* post fe */
|
||||
+ hlt
|
||||
+ jmp .Lhlt
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
+ .globl gdt, gdt_end, gdt_limit
|
||||
+
|
||||
+gdt_limit = gdt_end - gdt - 1 /* compute the table limit */
|
||||
+gdtaddr:
|
||||
+ .word gdt_limit
|
||||
+ .long gdt /* we know the offset */
|
||||
+
|
||||
+gdt:
|
||||
+// selgdt 0
|
||||
+ .word 0x0000, 0x0000 /* dummy */
|
||||
+ .byte 0x00, 0x00, 0x00, 0x00
|
||||
+
|
||||
+// selgdt 8
|
||||
+ .word 0x0000, 0x0000 /* dummy */
|
||||
+ .byte 0x00, 0x00, 0x00, 0x00
|
||||
+
|
||||
+// selgdt 0x10
|
||||
+/* flat code segment */
|
||||
+ .word 0xffff, 0x0000
|
||||
+ .byte 0x00, 0x9b, 0xcf, 0x00
|
||||
+
|
||||
+//selgdt 0x18
|
||||
+/* flat data segment */
|
||||
+ .word 0xffff, 0x0000
|
||||
+ .byte 0x00, 0x93, 0xcf, 0x00
|
||||
+
|
||||
+//selgdt 0x20
|
||||
+ .word 0x0000, 0x0000 /* dummy */
|
||||
+ .byte 0x00, 0x00, 0x00, 0x00
|
||||
+
|
||||
+#if defined(CONFIG_VGABIOS) && (CONFIG_VGABIOS == 1)
|
||||
+ // from monty:
|
||||
+ /* 0x00009a00,0000ffffULL, 20h: 16-bit 64k code at 0x00000000 */
|
||||
+ /* 0x00009200,0000ffffULL 28h: 16-bit 64k data at 0x00000000 */
|
||||
+// selgdt 0x28
|
||||
+/*16-bit 64k code at 0x00000000 */
|
||||
+ .word 0xffff, 0x0000
|
||||
+ .byte 0, 0x9a, 0, 0
|
||||
+
|
||||
+// selgdt 0x30
|
||||
+/*16-bit 64k data at 0x00000000 */
|
||||
+ .word 0xffff, 0x0000
|
||||
+ .byte 0, 0x92, 0, 0
|
||||
+#endif // defined(CONFIG_VGABIOS) && (CONFIG_VGABIOS == 1)
|
||||
+gdt_end:
|
||||
+
|
||||
+.code32
|
||||
|
||||
Eigenschaftsänderungen: LinuxBIOSv1\src\arch\i386\lib\c_start.S
|
||||
___________________________________________________________________
|
||||
Hinzugefügt: svn:keywords
|
||||
+ Author Date Id Revision
|
||||
Hinzugefügt: svn:eol-style
|
||||
+ native
|
||||
|
File diff suppressed because one or more lines are too long
13
test/data/IDF_DiffTest/test-03-mtn-new-file-single-line.diff
Normal file
13
test/data/IDF_DiffTest/test-03-mtn-new-file-single-line.diff
Normal file
@ -0,0 +1,13 @@
|
||||
#
|
||||
# old_revision []
|
||||
#
|
||||
# add_dir ""
|
||||
#
|
||||
# add_file "a"
|
||||
# content [03cfd743661f07975fa2f1220c5194cbaff48451]
|
||||
#
|
||||
============================================================
|
||||
--- /dev/null
|
||||
+++ a 03cfd743661f07975fa2f1220c5194cbaff48451
|
||||
@@ -0,0 +1 @@
|
||||
+abc
|
@ -0,0 +1 @@
|
||||
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:1:{i:0;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:3:"abc";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"0";i:1;s:1:"0";}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}}
|
14
test/data/IDF_DiffTest/test-04-mtn-new-file-multi-lines.diff
Normal file
14
test/data/IDF_DiffTest/test-04-mtn-new-file-multi-lines.diff
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# old_revision []
|
||||
#
|
||||
# add_dir ""
|
||||
#
|
||||
# add_file "a"
|
||||
# content [9decd90bc2eedb78c74d5059a6bb6244dd2d0562]
|
||||
#
|
||||
============================================================
|
||||
--- /dev/null
|
||||
+++ a 9decd90bc2eedb78c74d5059a6bb6244dd2d0562
|
||||
@@ -0,0 +1,2 @@
|
||||
+abc
|
||||
+abc
|
@ -0,0 +1 @@
|
||||
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:3:"abc";}i:1;a:3:{i:0;s:0:"";i:1;i:2;i:2;s:3:"abc";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"0";i:1;s:1:"0";}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"2";}}}}}
|
@ -0,0 +1,13 @@
|
||||
#
|
||||
# old_revision [1f31865f7c91525e96aa7615e660303ca04c708f]
|
||||
#
|
||||
# patch "a"
|
||||
# from [9decd90bc2eedb78c74d5059a6bb6244dd2d0562]
|
||||
# to [03cfd743661f07975fa2f1220c5194cbaff48451]
|
||||
#
|
||||
============================================================
|
||||
--- a 9decd90bc2eedb78c74d5059a6bb6244dd2d0562
|
||||
+++ a 03cfd743661f07975fa2f1220c5194cbaff48451
|
||||
@@ -1,2 +1 @@ abc
|
||||
abc
|
||||
-abc
|
@ -0,0 +1 @@
|
||||
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:3:"abc";}i:1;a:3:{i:0;i:2;i:1;s:0:"";i:2;s:3:"abc";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;s:1:"2";}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}}
|
13
test/data/IDF_DiffTest/test-06-mtn-single-line.diff
Normal file
13
test/data/IDF_DiffTest/test-06-mtn-single-line.diff
Normal file
@ -0,0 +1,13 @@
|
||||
#
|
||||
# old_revision [019c2c7a876819db59add22c98c7939e32d81161]
|
||||
#
|
||||
# patch "a"
|
||||
# from [03cfd743661f07975fa2f1220c5194cbaff48451]
|
||||
# to [023cc93272e5cbc11f128ffc90fbbe42f6f08d8c]
|
||||
#
|
||||
============================================================
|
||||
--- a 03cfd743661f07975fa2f1220c5194cbaff48451
|
||||
+++ a 023cc93272e5cbc11f128ffc90fbbe42f6f08d8c
|
||||
@@ -1 +1 @@
|
||||
-abc
|
||||
+ls
|
1
test/data/IDF_DiffTest/test-06-mtn-single-line.expected
Normal file
1
test/data/IDF_DiffTest/test-06-mtn-single-line.expected
Normal file
@ -0,0 +1 @@
|
||||
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:0:"";i:2;s:3:"abc";}i:1;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:2:"ls";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;i:1;}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}}
|
@ -0,0 +1,13 @@
|
||||
#
|
||||
# old_revision [7950c8a4e13342d1dca94c05efc49b291ab327f5]
|
||||
#
|
||||
# patch "a"
|
||||
# from [023cc93272e5cbc11f128ffc90fbbe42f6f08d8c]
|
||||
# to [b3d40c241ccfd6ff1a06047a9f6d609227d2893f]
|
||||
#
|
||||
============================================================
|
||||
--- a 023cc93272e5cbc11f128ffc90fbbe42f6f08d8c
|
||||
+++ a b3d40c241ccfd6ff1a06047a9f6d609227d2893f
|
||||
@@ -1 +1,2 @@ ls
|
||||
ls
|
||||
+ls
|
@ -0,0 +1 @@
|
||||
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:2:"ls";}i:1;a:3:{i:0;s:0:"";i:1;i:2;i:2;s:2:"ls";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;i:1;}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"2";}}}}}
|
@ -0,0 +1,18 @@
|
||||
#
|
||||
# old_revision [9b51b47c6fdd4918f970b81a8672503b8bb30402]
|
||||
#
|
||||
# patch "a"
|
||||
# from [b3d40c241ccfd6ff1a06047a9f6d609227d2893f]
|
||||
# to [4ba8cb789fc34bd4557b5bbf7cb9f4b68b3a9f5e]
|
||||
#
|
||||
# set "a"
|
||||
# attr "foo"
|
||||
# value "bar"
|
||||
#
|
||||
============================================================
|
||||
--- a b3d40c241ccfd6ff1a06047a9f6d609227d2893f
|
||||
+++ a 4ba8cb789fc34bd4557b5bbf7cb9f4b68b3a9f5e
|
||||
@@ -1,2 +1,3 @@ ls
|
||||
ls
|
||||
ls
|
||||
+l
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user