Mailing List Archive

Intranet hack: Perforce depot files
Here is a small MediaWiki hack I did for use in our
company intranet. This is useful for intranets
where:

* Perforce is used for revision control.
* You want to directly reference Perforce files
from the Wiki without having to point to a
specific client.

It allows you to directly reference files (via
P4web) using Wiki syntax like this:

P4://depot/the/file
[[P4://depot/the/file some_name]]

I've attached a diff of Parser.php (1.3.8).

JA



__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail
Re: Intranet hack: Perforce depot files [ In reply to ]
On Dec 1, 2004, at 9:54 AM, John Andrews wrote:
> I've attached a diff of Parser.php (1.3.8).

The list doesn't generally accept attachments, as we've had problems in
the past with worm e-mails sending executables to the list with a false
sender address.

You can post diffs as attachments to enhancement reports on our
bugzilla: http://bugzilla.wikipedia.org/ (this has the advantage that
things that may get integrated can be kept track of more easily)

-- brion vibber (brion @ pobox.com)
Re: Intranet hack: Perforce depot files [ In reply to ]
Several people expressed interest in this hack.
Since my attachment got stripped, I've put the
diff below.

This change probably doesn't make sense as an RFE
because it is useful only on intranets AFAIK...

Parser.php (1.3.8) diff:

1037,1044d1036
< # JBA inserted code here
< # Replace P4:// with stuff to point at P4WEB.
< # Allows links of the form P4://depot/the/file
< # Replace p4machine:8081 w/ your p4web mach:port
< $text = preg_replace(
< "#P4://([^ \]]+)(\s|]|$)#U",
< 'http://p4machine:8081//${1}?ac=64${2}',
< $text);
< # JBA end of code insertion




__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
Re: Re: Intranet hack: Perforce depot files [ In reply to ]
On Dec 2, 2004, at 10:42 AM, John Andrews wrote:
> 1037,1044d1036
> < # JBA inserted code here
> < # Replace P4:// with stuff to point at P4WEB.
> < # Allows links of the form P4://depot/the/file
> < # Replace p4machine:8081 w/ your p4web mach:port
> < $text = preg_replace(
> < "#P4://([^ \]]+)(\s|]|$)#U",
> < 'http://p4machine:8081//${1}?ac=64${2}',
> < $text);
> < # JBA end of code insertion

This is the kind of thing extensions would be great for... :) Having to
hack up Parser.php is a maintenance burden (since it makes upgrades
more difficult). Are we still missing an appropriate hook point for
this kind of thing?

-- brion vibber (brion @ pobox.com)