-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgit_repository_viewer.module
645 lines (602 loc) · 22.7 KB
/
git_repository_viewer.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
<?php
// $Id$
/**
* @file
* git_repository_viewer provides a simple git repository browser.
*
* TODO:
* Get rid of calls to sha1_hex() and sha1_bin().
*/
/**
* Implementation of hook_menu().
*/
function git_repository_viewer_menu() {
// This generic callback is used for all repository browsing regardless of whether the browsed item
$menu['git-repository-viewer/%versioncontrol_repository'] = array(
'title callback' => 'git_repository_viewer_view_repository_title_callback',
'title arguments' => array(1),
'page callback' => 'git_repository_viewer_view_repository',
'page arguments' => array(1),
'access arguments' => array('browse all versioncontrol repositories'),
);
$menu['git-repository-viewer/commit/%versioncontrol_repository'] = array(
'title' => 'Git Diff',
'page callback' => 'git_repository_viewer_view_commit',
'page arguments' => array(2),
'access arguments' => array('browse all versioncontrol repositories'),
);
$menu['admin/settings/git-repository-viewer'] = array(
'title' => 'Administer Git Repository Viewer',
'page callback' => 'drupal_get_form',
'page arguments' => array('git_repository_viewer_settings_form'),
'access arguments' => array('administer repoisitory viewer'),
'file' => 'git_repository_viewer_admin.inc',
);
$menu['git-repository-viewer/data-service'] = array(
'title' => 'Git Diff',
'page callback' => 'git_repository_viewer_data_service',
'page arguments' => array(2),
'access arguments' => array('access repository data service'),
'type' => MENU_CALLBACK,
);
return $menu;
}
/**
* Implementation of hook_block().
*/
function git_repository_viewer_block($op = 'list', $delta = 0, $edit = array()) {
switch ($op) {
case 'list':
$blocks = array();
$blocks['commit_list'] = array(
'info' => t('Git Repository Viewer Commit List'),
'cache' => BLOCK_NO_CACHE,
);
return $blocks;
case 'view':
if ($delta == 'commit_list' && arg(0) == 'git-repository-viewer' && user_access('browse all versioncontrol repositories')) {
$items = git_repository_viewer_commit_list_block();
return array(
'title' => t('Commits'),
'content' => theme('item_list', $items),
);
}
break;
}
}
/**
*
*/
function git_repository_viewer_commit_list_block() {
// TODO: consider whether we can make this with views? (currently we can't without a lot of work)
// TODO: figure out if this is really working the way it is meant to.
// TODO: Comment this, it's definitely not obvious what it is trying to do.
$info = git_repository_viewer_get_repository_page_details();
$current_op_id = dbtng_query('SELECT vc_op_id FROM {versioncontrol_operations} WHERE revision=:commit', array(':commit' => $info['commit']))->fetchField();
$query = db_select('versioncontrol_operations', 'vo')
->fields('vo', array('message', 'revision'));
$query->join('versioncontrol_operation_labels', 'vol', 'vo.vc_op_id = vol.vc_op_id');
$query->join('versioncontrol_labels', 'vl', 'vol.label_id = vl.label_id');
$query->condition('vl.name', $info['branch'])
->condition('vo.repo_id', $info['repository']->repo_id);
$before = $query;
$before_results = $before->orderBy('vo.vc_op_id', 'DESC')
->condition('vo.vc_op_id', $current_op_id, '>=')
->range(0, 10)
->execute()
->fetchAll();
$after = $query;
$after_results = $before->orderBy('vo.vc_op_id', 'DESC')
->condition('vo.vc_op_id', $current_op_id, '<')
->range(0, 10 - count($before_results))
->execute()
->fetchAll();
$results = array_merge($before_results, $after_results);
$items = array();
$git_backend = new VersioncontrolGitBackend;
foreach ($results as $commit) {
$commit_link = git_repository_viewer_get_link($git_backend->formatRevisionIdentifier($commit->revision, 'short') . ': ' . check_plain($commit->message), array('commit' => $commit->revision));
$items[] = $commit_link;
}
return $items;
}
/**
* Implementation of hook_theme().
*/
function git_repository_viewer_theme() {
$template_path = drupal_get_path('module', 'git_repository_viewer') . '/templates';
return array(
'git_repository_browser' => array(
'template' => 'git-repo-browser',
'path' => $template_path,
'arguments' => array(
'navigation' => '',
'content' => NULL,
),
),
'git_repository_viewer_navigation' => array(
'template' => 'git-repo-viewer-navigation',
'path' => $template_path,
'arguments' => array(
'previous_commit_link' => NULL,
'next_commit_link' => NULL,
'parent_folder_link' => NULL,
'history' => NULL,
'branches_form' => '',
'input_format_token_form' => '',
),
),
'git_repository_viewer_view_directory' => array(
'arguments' => array(
'tree' => NULL,
'name' => '',
),
),
'git_repository_viewer_view_file' => array(
'arguments' => array(
'object' => NULL,
'name' => '',
'start_line' => 1,
),
),
'git_repository_viewer_view_image' => array(
'template' => 'git-repo-viewer-view-image',
'path' => $template_path,
'arguments' => array(
'image_data' => '',
'type' => '',
),
),
);
}
/**
* Implementation of hook_perm().
*/
function git_repository_viewer_perm() {
return array(
'browse all versioncontrol repositories',
'administer repoisitory viewer',
);
}
/**
* Implementation of hook_filter().
*/
function git_repository_viewer_filter($op, $delta = 0, $format = -1, $text = '') {
switch ($op) {
case 'list':
return array(
t('Version Control References'),
);
case 'description':
switch ($delta) {
case 0:
return t('Allows users to insert tokens that load content from Versioncontrol Repositories.');
default:
return;
}
case 'process':
switch ($delta) {
case 0:
return git_repository_viewer_filter_process($text);
default:
return $text;
}
default:
return $text;
}
}
// TODO this is really the preg callback.
function git_repository_viewer_filter_process($text) {
/*
// TODO: tweak the regex, we may need to use a lookahead so that this doesn't match things it shouldn't.
// We also need more validation.
// Filter for [vcs-[vcs_repo_id]-[path-in-repo]]
if (preg_match('/\[vcs-([0-9]+)-(.*)\]/Ui', $text)) {
$text = preg_replace_callback('/\[vcs-([0-9]+)-(.*)\]/i', 'git_repository_viewer_filter_process_callback', $text);
}
*/
// Filter for [vcs-[vcs_repo_id]-[path-in-repo]-[commit]]
if (preg_match('/\[vcs-([0-9]+)-(.*)-([a-z0-9]+)\]/i', $text)) {
$text = preg_replace_callback('/\[vcs-([0-9]+)-(.*)-([a-z0-9]+)\]/', 'git_repository_viewer_filter_process_callback', $text, -1, $count);
}
// Filter for [vcs-[vcs_repo_id]-[path-in-repo]-[commit]-[line-number]:[line-number]]
if (preg_match('/\[vcs-([0-9]+)-(.*)-([a-z0-9]+)-([0-9]+):([0-9]+)\]/i', $text)) {
$text = preg_replace_callback('/\[vcs-([0-9]+)-(.*)-([a-z0-9]+)-([0-9]+):([0-9]+)\]/i', 'git_repository_viewer_filter_process_callback', $text, -1, $count);
}
return $text;
}
/**
* Callback for preg_replace that actually gets contents.
*/
function git_repository_viewer_filter_process_callback($elements) {
// If we have more than three elements, we have what we need.
if (count($elements) >= 3) {
$repo_data['repository'] = versioncontrol_repository_load($elements[1]);
$repo_data['path'] = $elements[2];
$repo_data['branch'] = 'master';
$repo_data['commit'] = '';
// TODO: decide if we need to hand in branches at all.
if (count($elements) > 3) {
$repo_data['commit'] = $elements[3];
}
else {
$repo_data['commit'] = array_shift($repo_data['repository']->loadBranches())->name;
}
// TODO: consider whether we should find the most recent commit from the DB instead.
$handler = git_repository_viewer_handler_factory($repo_data['repository']);
$data = $handler->getRepoData($repo_data['repository']->root, $repo_data['branch']);
$data = git_repository_viewer_get_object_from_path($repo_data);
if ($data->type == 'directory') {
return '';
}
else {
$content = $data->contents;
}
$start_line = 1;
if (count($elements) == 6) {
if (($start_line = $elements[4]) < ($end_line = $elements[5])) {
$text_elements = explode("\n", $content);
$i = $start_line - 1;
$content = array();
while ($i <= $end_line) {
$content[] = $text_elements[$i];
$i++;
}
$content = implode("\n", $content);
}
}
$content = theme('git_repository_viewer_view_file', $content, $data->name, $start_line);
return $content;
}
}
/**
* Title callback for git_repository_viewer.
*/
function git_repository_viewer_view_repository_title_callback($versioncontol_repository) {
return t('Repository contents for @reposiotry_name', array('@reposiotry_name' => $versioncontol_repository->name));
}
/**
* TODO: figure out exactly what this function needs to do....
*
* This function maintains details about the repository item currently being viewed
*
* Ideally, this function should be used for to take a git repository and get a bunch of information
*/
function git_repository_viewer_get_repository_page_details($versioncontol_repository = FALSE) {
static $repository_data = FALSE;
if ($repository_data == FALSE && $versioncontol_repository != FALSE) {
// Get the handler from with which to load repo data.
$handler = git_repository_viewer_handler_factory($versioncontol_repository);
// Get information about what path within the repository we are viewing.
$path = isset($_GET['path']) ? $_GET['path'] : '';
$branch = isset($_GET['branch']) ? $_GET['branch'] : FALSE;
$commit = isset($_GET['commit']) ? $_GET['commit'] : FALSE;
// If we don't have a textual representation of the branch needed, find a default.
if (!$branch) {
$branch = array_shift($versioncontol_repository->loadBranches())->name;
}
// TODO: consider whether we should find the most recent commit from the DB instead.
$data = $handler->getRepoData($versioncontol_repository->root, $branch, $commit);
foreach($data as $name => $value) {
$$name = $value;
}
$repository_data = array(
'repository' => $versioncontol_repository,
'path' => $path,
'branch' => $branch,
'commit' => $commit,
'previous_commits' => $parents,
);
}
return $repository_data;
}
/**
* Page callback for git_repository_viewer.
*/
function git_repository_viewer_view_repository(VersioncontrolRepository $versioncontol_repository) {
// Get the repository data for this particular repository.
$repo_data = git_repository_viewer_get_repository_page_details($versioncontol_repository);
if (!$content = git_repository_viewer_view_object_from_path($repo_data)) {
drupal_not_found();
}
$navigation = git_repository_viewer_get_browser_navigation($repo_data);
return theme('git_repository_browser', $navigation, $content);
}
/**
*
*/
function git_repository_viewer_view_object_from_path($repo_data) {
// Get the object we are trying to view.
if (!$data = git_repository_viewer_get_object_from_path($repo_data)) {
return FALSE;
}
$name = $data->name ? $data->name : $repo_data['repository']->name;
// Determine whether we are trying to view a folder or a file.
if ($data->type == 'directory') {
return $content = theme('git_repository_viewer_view_directory', $data->contents, $name);
}
elseif ($data->type == 'file') {
return $content = theme('git_repository_viewer_view_file', $data->contents, $name);
}
// If we have neither a directory or a file, return page not found.
else {
return FALSE;
}
}
/**
*
* TODO: make themeable
*/
function git_repository_viewer_get_link_to_node($node, $other_data = array()) {
$info = git_repository_viewer_get_repository_page_details();
if (!isset($other_data['path']) || $other_data['path'] == '') {
$other_data['path'] = ($info['path'] == '' ? '' : $info['path'] . '/');
}
if (isset($info['branch'])) {
$other_data['branch'] = $info['branch'];
}
if (isset($info['commit'])) {
$other_data['commit'] = $info['commit'];
}
$other_data['path'] = $other_data['path'] . $node['name'];
$name = $node['name'];
return git_repository_viewer_get_link($name, $other_data);
}
function git_repository_viewer_get_link($name, $other_data = array()) {
$info = git_repository_viewer_get_repository_page_details();
if (isset($other_data['path']) && $other_data['path'] != '') {
$path = ($info['path'] == '' ? '' : $info['path'] . '/');
}
$name = $name != '' ? $name : $node->name;
$link = l($name, 'git-repository-viewer/' . $info['repository']->repo_id, $options = array('query' => $other_data));
return $link;
}
/**
*
*/
function git_repository_viewer_get_object_from_path($repo_data) {
$object = git_repository_viewer_handler_factory($repo_data['repository'])->getObject($repo_data['repository']->root, $repo_data['path'], $repo_data['branch'], $repo_data['commit']);
return $object;
}
/**
*
*/
function git_repository_viewer_branch_form($form_state, $repo_data) {
$options = array();
foreach ($repo_data['repository']->loadBranches() as $branch) {
$options[$branch->name] = $branch->name;
}
$form['branches'] = array(
'#title' => t('Branches'),
'#type' => 'select',
'#options' => $options,
'#default_value' => $repo_data['branch'],
);
return $form;
}
/**
*
*/
function git_repository_viewer_input_token_form($form_state, $repo_data) {
$form = array();
$filter_token = '[vcs-' . $repo_data['repository']->repo_id . '-' . $repo_data['path'] . '-' . $repo_data['commit'];
$filter_token .= ']';
$form['filter_token'] = array(
'#type' => 'textfield',
'#title' => t('Input format token'),
'#description' => t('Copy this token to display this file using node text using the input formatter. Click on the starting and ending lines first to display part of this file.'),
'#default_value' => $filter_token,
'#size' => 160,
);
return $form;
}
/**
* Default theme implementation for git_repository_viewer_view_directory.
*/
function theme_git_repository_viewer_view_directory($contents, $name) {
// Create the header columns for our table.
drupal_add_css(drupal_get_path('module', 'git_repository_viewer') . '/css/folder.css');
$header = array(
t('Name'),
t('Date'),
t('Author'),
t('Commit'),
t('Message'),
);
// WE NEED TO FIND OUR PATHS FROM THE ROOT REPOSITORY HERE...
// TODO: figure out what this actually meant and if it's already done?
$data = git_repository_viewer_get_repository_page_details();
$paths = array();
$base_path = $data['path'] == '' ? '' : '/' . $data['path'];
foreach ($contents as $name => $value) {
$paths[] = $base_path . '/' . $name;
}
// TODO: Right now relying on data coming into the db in a specific order. We need
// to make sure this is the case (on d.o right now this WILL NOT WORK).
$op_id = dbtng_query('SELECT vc_op_id FROM {versioncontrol_operations} WHERE revision=:commit', array(':commit' => $data['commit']))->fetchField();
$query = db_select('versioncontrol_item_revisions', 'vir')
->condition('vir.path', $paths, 'IN')
->condition('vir.repo_id', $data['repository']->repo_id);
$query->join('versioncontrol_operations', 'vo', 'vir.vc_op_id = vo.vc_op_id');
$query->join('versioncontrol_operation_labels', 'vol', 'vo.vc_op_id = vol.vc_op_id');
$query->join('versioncontrol_labels', 'vl', 'vol.label_id = vl.label_id');
$results = $query
->fields('vir', array('path', 'revision'))
->fields('vo', array('date', 'committer', 'committer_uid', 'message'))
->condition('vl.name', $data['branch'])
->condition('vo.vc_op_id', $op_id, '<=')
->distinct('path')
->addTag('git_repository_viewer_directory_list_metadata')
->execute()
->fetchAllAssoc('path');
$git_backend = new VersioncontrolGitBackend;
$rows = array();
foreach ($contents as $name => $item) {
$item_data = new stdClass;
$item_path = $base_path . '/' . $name;
if (isset($results[$item_path])) {
$item_data = $results[$item_path];
}
if (isset($item_data->revision)) {
$commit_link = git_repository_viewer_get_link($git_backend->formatRevisionIdentifier($item_data->revision, 'short'), array('commit' => $item_data->revision));
}
if (isset($item_data->message) && $item_data->message) {
$message_link = l($item_data->message, 'git-repository-viewer/commit/' . $data['repository']->repo_id, array('query' => array('commit' => $item_data->revision)));
}
else {
$message_link = '';
}
if (isset($item_data->committer_uid) && $item_data->committer_uid != 0) {
$author = l(user_load($item_data->committer_uid)->name, 'user/' . $item_data->committer_uid);
}
elseif (isset($item_data->committer)) {
$author = $item_data->committer;
}
else {
$author = '';
}
$rows[] = array(
'data' => array(
'name' => array(
'data' => git_repository_viewer_get_link_to_node($item),
'class' => $item['directory'] ? 'folder' : 'file',
),
'date' => isset($item_data->date) ? t('@time ago', array('@time' => format_interval(time() - $item_data->date))) : '',
'author' => $author,
'commit' => isset($commit_link) ? $commit_link : '',
'message' => $message_link,
),
);
}
return theme('table', $header, $rows);
}
/**
* Default theme implementation for git_repository_viewer_view_file.
*
* @param (fileContents) $file_contents
* The actual contents of the file being viewed.
* @param (string) $name
* The name of the file.
*/
function theme_git_repository_viewer_view_file($file_contents, $name, $start_line = 1) {
$type = git_repository_viewer_get_blob_type($name);
$image_extensions = array(
'jpg',
'jpeg',
'gif',
'png',
'ico',
);
if (in_array($type, $image_extensions)) {
$output = theme('git_repository_viewer_view_image', base64_encode($file_contents), $type);
}
else {
// TODO: turn this into a theme function?
$output = git_repository_viewer_format_text($file_contents, $type, $start_line);
}
return $output;
}
function git_repository_viewer_format_text($text, $type, $start_line = 1) {
if (strtolower($type) == 'md' || strtolower($type) == 'mdown' && module_exists('markdown')) {
$output = _markdown_process($text, '');
}
elseif (module_exists('geshifilter')) {
module_load_include('inc', 'geshifilter', 'geshifilter.pages');
$available_languages = _geshifilter_get_available_languages();
// Prevent a php undefined inex notice resulting from asking geshi to handle a type it doesn't understand.
isset($available_languages[$type]['language_path']) ? $type = $type : $type = 'text';
$output = geshifilter_process($text, $type, TRUE, $start_line);
}
else {
$output = "<code type='$type'>";
$output .= check_plain($text);
$output .= '</code>';
}
return $output;
}
function git_repository_viewer_get_blob_type($name) {
$ext = end(explode('.', $name));
$type = $ext;
$drupal_extensions = array(
'module',
'install',
'test',
'inc',
'engine',
);
if (in_array($ext, $drupal_extensions)) {
$type = 'php';
}
return $type;
}
/**
* View the contents of an individual commit.
*/
function git_repository_viewer_view_commit(VersioncontrolRepository $versioncontrol_repository) {
// Sanity check to make sure that this commit id is only numbers and letters
// and does not attempt to execute aribtrary code on our 'git-show system call'
if (preg_match('/^[a-zA-Z0-9]+$/', $_GET['commit']) && ctype_xdigit($_GET['commit'])) {
$data = git_repository_viewer_get_repository_page_details($versioncontrol_repository);
if ($commit_diff = git_repository_viewer_handler_factory($versioncontrol_repository)->getCommit($data['repository']->root, $data['branch'], $data['commit'])) {
$output = git_repository_viewer_format_text($commit_diff, 'diff');
return $output;
}
else {
drupal_set_message(t('The commit you were looking for was not found'), 'error');
}
}
else {
drupal_set_message(t('Invalid commit id.'), 'error');
}
drupal_not_found();
}
/**
* Build the links necessary for the browser navigation.
*/
function git_repository_viewer_get_browser_navigation(array $repo_data) {
drupal_add_css(drupal_get_path('module', 'git_repository_viewer') . '/css/navigation.css');
drupal_add_js(drupal_get_path('module', 'git_repository_viewer') . '/js/git_repo_viewer.js');
$branches_form = drupal_get_form('git_repository_viewer_branch_form', $repo_data);
$repo_data['path'] != '' ? $input_format_token_form = drupal_get_form('git_repository_viewer_input_token_form', $repo_data) : $input_format_token_form = '';
// Look up previous commit.
if (isset($repo_data['previous_commits'][0]) && $repo_data['previous_commits'][0] != '') {
$link_data = array('commit' => $repo_data['previous_commits'][0]);
if (isset($repo_data['path'])) {
$link_data['path'] = $repo_data['path'];
}
$previous_commit_link = git_repository_viewer_get_link(t('previous commit'), $link_data);
}
else {
$previous_commit_link = '';
}
// TODO: We should be able to get the next commit from our MySQL data.
//$next_commit_link = git_repository_viewer_get_link(t('next commit'), array('commit' => sha1_hex($repo_data['previous_commits'])));
$next_commit_link = '';
// Get the parent folder.
$parent_folder_path = explode('/', $repo_data['path']);
array_pop($parent_folder_path);
$parent_folder_path = implode('/', $parent_folder_path);
$parent_folder_link = git_repository_viewer_get_link(t('parent folder'), array('path' => $parent_folder_path));
// Build the history link.
$history = module_exists('commitlog') ? l(t('history'), 'commitlog/repository/' . $repo_data['repository']->repo_id) : NULL;
return theme('git_repository_viewer_navigation', $previous_commit_link, $next_commit_link, $parent_folder_link, $history, $branches_form, $input_format_token_form);
}
/**
* A factory method for repository viewer handlers.
*
* TODO: Make this configurable so that a remote handler can be used.
*/
function git_repository_viewer_handler_factory(VersioncontrolRepository $versioncontrol_repository) {
static $handlers = array();
if (isset($versioncontrol_repository->repo_id) && is_numeric($versioncontrol_repository->repo_id) && !isset($handlers[$versioncontrol_repository->repo_id])) {
// TODO: Determine the handler to use here.
$handlers[$versioncontrol_repository->repo_id] = new GitRepoViewerLocalGlip;
}
return $handlers[$versioncontrol_repository->repo_id];
}
/**
* Page callback
*/
function git_repository_viewer_data_service() {
return NULL;
}