List of commits:
Subject Hash Author Date (UTC)
Bulk 2ec92b1397e09b0714d1ee423dcd72f4a220b332 Catalin(ux) M. BOIE 2012-04-16 06:43:38
aa 63a5cea75e640e6c11975bf6ab1c7bc49747a6bb Catalin(ux) M. BOIE 2012-03-26 21:09:23
Misc fixes eac04dc796b2c315b65753025e1e311bc25e83d7 Catalin(ux) M. BOIE 2012-03-26 18:14:32
Fixes for schema autoupdate 63d2a1a4f4c0498135a96f1a3d374868dc3d3535 Catalin(ux) M. BOIE 2012-03-23 04:19:09
Test CSRF token for the rights for a repo. e2d32e100f724e80ee623f191784ce429156ac39 Catalin(ux) M. BOIE 2012-03-22 03:54:37
Fixed anon push without create branch rights 3d474b7a569b16d87a426d4c3b971a50b3299894 Catalin(ux) M. BOIE 2012-03-22 03:43:06
Use rg_repos for repositories e5bda9469fddee7f201c22dfd89292830f4c342b Catalin(ux) M. BOIE 2012-03-22 03:42:06
Corrected <label> tags 7e8621e79480b8964e04de8c54f10f1a702ea1fd Catalin(ux) M. BOIE 2012-03-20 04:25:38
Fixed unit testing 31bfe5672e7d3b620d0e7b3c07ff72d84c149001 Catalin(ux) M. BOIE 2012-03-17 17:21:21
Fixed hook_update.sh unit testing 86c4079e81efc5a4a7878e91d8f4318e443961f7 Catalin(ux) M. BOIE 2012-03-16 22:32:35
Bulk updates f696473a7faee50782d3cc01e96cc85e7900b3de Catalin(ux) M. BOIE 2012-03-14 04:38:23
Style changes. 87e30b1df29b7c6efa438be1cf369192a8068655 Catalin(ux) M. BOIE 2012-02-19 22:50:22
Bulk 0923407bff68a58a0b7b034f8a6b4489ece5b237 Catalin(ux) M. BOIE 2012-02-12 22:21:44
Bulk update 30310488bca37cefeba96b52b71c9c3e72c32907 Catalin(ux) M. BOIE 2011-12-15 23:34:03
Profiling tests. afd1df2940fe440cde9b8ede988ff24c051a10d6 Catalin(ux) M. BOIE 2011-11-03 22:10:13
More bulk updates. a2a2e2545eaad61d0c675ea2afb801f207534515 Catalin(ux) M. BOIE 2011-11-03 22:09:34
Another round of bulk updates. 45bb00a88c420d439b4dd19971808722e4a70895 Catalin(ux) M. BOIE 2011-10-24 22:31:14
Bulk update. Mostly css. 04734cd7cfc4fd4ec55dad70a3490f3065027639 Catalin(ux) M. BOIE 2011-10-03 23:18:26
Added rg_exec function and converted all calls from exec to rg_exec. 097157e5886dace2b9f67ca238a1063a3baff4a0 Catalin(ux) M. BOIE 2011-09-28 03:28:49
Another round of bulk updates cb9dbb75518ab3c214167646197ca7eb0de8e4e6 Catalin(ux) M. BOIE 2011-09-26 19:22:12
Commit 2ec92b1397e09b0714d1ee423dcd72f4a220b332 - Bulk
Author: Catalin(ux) M. BOIE
Author date (UTC): 2012-04-16 06:43
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2012-04-16 06:43
Parent(s): 63a5cea75e640e6c11975bf6ab1c7bc49747a6bb
Signer:
Signing key:
Signing status: N
Tree: 3dbc4240ca1344c588372dae8bf30d2d0d3dab4f
File Lines added Lines deleted
Makefile.in 0 1
TODO 17 1
inc/gd.inc.php 30 0
inc/git.inc.php 124 9
inc/mr.inc.php 41 6
inc/repo.inc.php 2 2
inc/rights.inc.php 1 1
inc/user.inc.php 27 11
inc/user/forgot_send.php 5 2
inc/user/repo-page.php 92 37
inc/user/repo/admin.php 3 0
inc/util.inc.php 96 15
rocketgit.spec.in 1 1
root/themes/default/main.css 26 1
root/themes/default/repo/fstat/header.html 1 0
root/themes/default/repo/issues.html 1 0
root/themes/default/repo/log/header.html 1 0
root/themes/default/repo/log/line.html 1 1
root/themes/default/repo/main.html 4 4
root/themes/default/repo/mr/header.html 0 7
root/themes/default/repo/mr/line.html 0 5
root/themes/default/repo/mr/list/footer.html 0 0
root/themes/default/repo/mr/list/header.html 9 0
root/themes/default/repo/mr/list/line.html 7 0
root/themes/default/repo/mr/list/nodata.html 0 0
root/themes/default/repo/mr/page.html 1 0
root/themes/default/repo/mrs.html 0 0
root/themes/default/repo/source.html 12 0
root/themes/default/repo/stats.html 1 0
root/themes/default/repo/tree/header.html 1 0
root/themes/default/repo/tree/line.html 1 1
samples/config.php 5 2
scripts/remote.php 3 6
tests/git2.sh 5 2
tests/git2/a 0 1
tests/repo.php 2 2
tests/tree1/a/f2 0 0
tests/tree1/f1 0 0
tests/user.php 3 3
tests/util.php 11 0
File Makefile.in changed (mode: 100644) (index 30b2a35..5e9380e)
... ... install: all
32 32 @chmod 0700 $(I_VAR_LOG)/$(PRJ)-web @chmod 0700 $(I_VAR_LOG)/$(PRJ)-web
33 33 @mkdir -p $(I_VAR_LIB)/$(PRJ) $(I_VAR_LIB)/$(PRJ)/locks $(I_VAR_LIB)/$(PRJ)/repos @mkdir -p $(I_VAR_LIB)/$(PRJ) $(I_VAR_LIB)/$(PRJ)/locks $(I_VAR_LIB)/$(PRJ)/repos
34 34 @-chown -R rocketgit:rocketgit $(I_VAR_LIB)/$(PRJ) @-chown -R rocketgit:rocketgit $(I_VAR_LIB)/$(PRJ)
35 @chmod 0700 $(I_VAR_LIB)/$(PRJ)
File TODO changed (mode: 100644) (index 94c2774..ad15ccd)
1 1 == BEFORE FIRST RELEASE! == == BEFORE FIRST RELEASE! ==
2 2 [ ] Make available the merge requests. [ ] Make available the merge requests.
3 [ ] Add possibility to reject merge requests, to make them public, to delete etc.
3 [ ] Add possibility to reject merge requests, to apply, to delete etc.
4 [ ] "Tree" is broken when not on "master" branch.
5 [ ] JUNK1/JUNK2: http://rg.embedromix.ro:8000/user/catab/rocketgit/commit/afd1df2..f919c9b
6 [ ] Confirmation e-mail comes from rg1.
4 7 [ ] [ ]
5 8
6 9 == Normal priority == == Normal priority ==
10 [ ] Add a @@DUMP@@ in every template, so a user will know what variables can use.
11 [ ] Improve e-mails to not be considered spam.
12 [ ] Statistics (number, tool etc.) for project access.
13 [ ] For bugtracker use BerliOS as a starting point.
14 [ ] Allow (anonymous) editing files on web and transform them in merge request.
15 [ ] On the first page no search form! It is useless!
16 [ ] Add stats for a repo. Some stuff is already in git.inc.php.
17 [ ] Anti-spam: hide e-mail addresses!
18 [ ] Check if a merge request was integrated (hm; what integrated means?!) and
19 signal this in merge requests list?
20 [ ] Add rg_branch_allow_chars and rg_tags_allow_chars.
21 [ ] repo/tag|branch/<name> page shoul put next to the commit also the tag/branch.
22 [ ] Order tags by mtime desc.
7 23 [ ] If a user pushes an unknown repo, we may automatically create a repo! [ ] If a user pushes an unknown repo, we may automatically create a repo!
8 24 [ ] Fix the "edit repo" page! [ ] Fix the "edit repo" page!
9 25 [ ] rg-repos should be split in rg_repos and rg_var_lib. [ ] rg-repos should be split in rg_repos and rg_var_lib.
File inc/gd.inc.php added (mode: 100644) (index 0000000..b0f6f94)
1 <?php
2
3
4 /*
5 * Create a graphic
6 */
7 function rg_gd_graph($a)
8 {
9 $i = ImageCreateTrueColor($a[w], $a[h]);
10 if (!$i)
11 return FALSE;
12
13 ImageSaveAlpha($i, TRUE);
14
15 if (isset($a['bg'])) {
16 $c = $a['bg'];
17 $bg = ImageColorAllocate($i, $c['r'], $c['g'], $c['b']);
18 ImageFill($i, 0, 0, $bg);
19 }
20
21
22 // How many seconds?
23 $secons = $a['end'] - $a['start'];
24
25 // one line means how many seconds?
26 $colums = $seconds / $a['seconds_per_column'];
27
28 }
29
30 ?>
File inc/git.inc.php changed (mode: 100644) (index 96ce32d..4aba847)
... ... function rg_git_update_ref($ref, $old, $new, $reason)
341 341 /* /*
342 342 * Returns a tree (git ls-tree) * Returns a tree (git ls-tree)
343 343 */ */
344 function rg_git_ls_tree($tree)
344 function rg_git_ls_tree($tree, $path)
345 345 { {
346 346 rg_prof_start("git_ls_tree"); rg_prof_start("git_ls_tree");
347 347
348 rg_log("rg_git_ls_tree: tree=$tree");
348 rg_log("rg_git_ls_tree: tree=$tree path=$path");
349 349
350 350 $ret = array(); $ret = array();
351 351
 
... ... function rg_git_ls_tree($tree)
355 355 $tree = " HEAD"; $tree = " HEAD";
356 356 } }
357 357
358 $cmd = "git ls-tree --long" . $op . $tree;
358 $cmd = "git ls-tree --long" . $op . $tree . " " . escapeshellcmd($path);
359 359 $a = rg_exec($cmd); $a = rg_exec($cmd);
360 360 if ($a['ok'] != 1) { if ($a['ok'] != 1) {
361 361 rg_git_set_error("error on ls-tree (" . $a['errmsg'] . ")"); rg_git_set_error("error on ls-tree (" . $a['errmsg'] . ")");
 
... ... function rg_git_log($max, $from, $to, $also_patch)
498 498 { {
499 499 rg_prof_start("git_log"); rg_prof_start("git_log");
500 500
501 rg_log("git_log: max=$max");
501 rg_log("git_log: from=$from to=$to max=$max");
502 502
503 503 $max_count = ($max == 0) ? "" : " --max-count=$max"; $max_count = ($max == 0) ? "" : " --max-count=$max";
504 504 $patches = $also_patch ? " --patch" : ""; $patches = $also_patch ? " --patch" : "";
505 505
506 if (empty($from) && empty($to))
506 if (empty($from) && empty($to)) {
507 507 $from_to = ""; $from_to = "";
508 else
509 $from_to = " " . $from . ".." . $to;
508 } else {
509 if (empty($from))
510 $from_to = " " . $to;
511 else
512 $from_to = " " . $from . ".." . $to;
513 }
510 514
511 515 $cmd = "git log" $cmd = "git log"
512 516 . " --no-merges" . " --no-merges"
 
... ... function rg_git_update_tag($a)
818 822 . " change an un-annotated tag."); . " change an un-annotated tag.");
819 823 } }
820 824 } }
825
826 // If we do not have a namespace, we let git to update the ref.
827 // Not clear when we do not have a namespace.
828 if (!empty($a['namespace'])) {
829 // Update the main namespace
830 $r = rg_git_update_ref($a['refname'], $a['old_rev'],
831 $a['new_rev'], "reason");
832 if ($r !== TRUE) {
833 rg_git_fatal($a['refname'] . "\nCannot update ref ("
834 . rg_git_error() . ")");
835 }
836
837 // We can clean now the namespace - TODO
838 }
821 839 } }
822 840
823 841 function rg_git_update_branch($a) function rg_git_update_branch($a)
 
... ... function rg_git_update_branch($a)
886 904 // anonymous push - create a merge request // anonymous push - create a merge request
887 905 // TODO: git may fail to update the reference after this hook; // TODO: git may fail to update the reference after this hook;
888 906 // the mr code should check if the update was done. // the mr code should check if the update was done.
907 $mr = "refs/mr/"
908 . preg_replace('/refs\/heads\//', '', $a['refname'])
909 . "_" . preg_replace('/rg_/', '', $a['namespace']);
910 $r = rg_git_update_ref($mr, "", $a['new_rev'], "mr");
911 if ($r !== TRUE) {
912 rg_log("Cannot update-ref: " . rg_git_error());
913 rg_git_fatal($a['refname'] . ": Cannot set refs/mr/."
914 . " Try again later.");
915 }
889 916 $r = rg_mr_queue_add($a['repo_id'], $a['namespace'], $r = rg_mr_queue_add($a['repo_id'], $a['namespace'],
890 917 $a['old_rev'], $a['new_rev'], $a['refname'], $a['ip']); $a['old_rev'], $a['new_rev'], $a['refname'], $a['ip']);
891 918 if ($r !== TRUE) if ($r !== TRUE)
 
... ... function rg_git_update_branch($a)
917 944 function rg_git_refs($repo_path) function rg_git_refs($repo_path)
918 945 { {
919 946 $ret = array(); $ret = array();
920 $ret['tags'] = rg_dir_load($repo_path . "/refs/tags");
921 $ret['branches'] = rg_dir_load($repo_path . "/refs/heads");
947 $ret['tag'] = rg_dir_load_deep($repo_path . "/refs/tags");
948 $ret['branch'] = rg_dir_load_deep($repo_path . "/refs/heads");
949
950 return $ret;
951 }
952
953 /*
954 * Returns an array with links to branches and tags
955 */
956 function rg_git_branches_and_tags($repo_dir, $base_url, $current_ref)
957 {
958 rg_log("git_branches_and_tags: repo_dir=$repo_dir base_url=$base_url"
959 . " current_ref=$current_ref");
960
961 $ret = array();
962
963 $current = ltrim($current_ref, "/");
964 if (empty($current))
965 $current = "branch/master";
966 rg_log("DEBUG: current=[$current]");
967
968 $refs = rg_git_refs($repo_dir);
969 foreach ($refs as $o => $list) {
970 if (empty($list)) {
971 $_ret['HTML:' . $o] = "";
972 continue;
973 }
974
975 $_t = "<div class=\"$o\">\n";
976 $_t .= "<ul>\n";
977 $_l = array();
978 foreach ($list as $name) {
979 $name = htmlspecialchars($name);
980 $ename = preg_replace('/\//', ',', $name);
981 rg_log("DEBUG: compare with [" . $o . "/" . $ename . "]");
982 if (strcmp($current, $o . "/" . $ename) == 0) {
983 $add_s = "<b>";
984 $add_e = "</b>";
985 } else {
986 $add_s = "";
987 $add_e = "";
988 }
989 $_l[] = "<li>"
990 . "<a href=\"" . $base_url . "/source/log/$o/$ename" . "\">"
991 . $add_s . $name . $add_e
992 . "</a>"
993 . "</li>";
994 }
995 $_t .= implode("\n", $_l);
996 $_t .= "</ul>\n";
997 $_t .= "</div>\n";
998 $ret['HTML:' . $o] = $_t;
999 }
1000
1001 return $ret;
1002 }
1003
1004 /*
1005 * Identify branch/tag
1006 * @paras: Example: tag|v1.1 or branch|stuff,branch3
1007 */
1008 function rg_git_parse_ref(&$paras)
1009 {
1010 rg_log("git_parse_ref: " . rg_array2string($paras));
1011
1012 $ret = array("ref_type" => "",
1013 "ref_url" => "",
1014 "ref_val" => "",
1015 "ref_path" => "");
1016
1017 if (count($paras) < 2)
1018 return $ret;
1019
1020 if (strcmp($paras[0], "tag") == 0) {
1021 $ret['ref_type'] = "tag";
1022 $ret['ref_path'] = "refs/tags/";
1023 } else if (strcmp($paras[0], "branch") == 0) {
1024 $ret['ref_type'] = "branch";
1025 $ret['ref_path'] = "refs/heads/";
1026 } else {
1027 return $ret;
1028 }
1029
1030 array_shift($paras);
1031 $val = array_shift($paras);
1032 $ret['ref_url'] = "/" . $ret['ref_type'] . "/" . $val;
1033
1034 $val = preg_replace('/,/', '/', $val);
1035 $ret['ref_val'] = $val;
1036 $ret['ref_path'] .= $val;
922 1037
923 1038 return $ret; return $ret;
924 1039 } }
File inc/mr.inc.php changed (mode: 100644) (index 50ea8bf..918c8d6)
... ... require_once($INC . "/sql.inc.php");
6 6
7 7 $rg_mr_env_q = getenv("ROCKETGIT_MR_QUEUE"); $rg_mr_env_q = getenv("ROCKETGIT_MR_QUEUE");
8 8 if (empty($rg_mr_env_q)) if (empty($rg_mr_env_q))
9 $rg_mr_queue = $rg_repos . "/q_merge_requests";
9 $rg_mr_queue = $rg_state_dir . "/q_merge_requests";
10 10 else else
11 11 $rg_mr_queue = $rg_mr_env_q; $rg_mr_queue = $rg_mr_env_q;
12 12
 
... ... function rg_mr_queue_add($repo_id, $namespace, $old_rev, $new_rev, $refname, $ip
63 63 /* /*
64 64 * Add a merge request file to database * Add a merge request file to database
65 65 */ */
66 function rg_mr_create($db, $repo_id, $namespace, $old_rev, $new_rev, $refname, $ip)
66 function rg_mr_create($db, $repo_id, $namespace, $old_rev, $new_rev, $refname,
67 $ip)
67 68 { {
68 69 rg_log("rg_mr_create: repo_id=$repo_id namespace=$namespace" rg_log("rg_mr_create: repo_id=$repo_id namespace=$namespace"
69 70 . " old_rev=$old_rev new_rev=$new_rev, refname=$refname" . " old_rev=$old_rev new_rev=$new_rev, refname=$refname"
 
... ... function rg_mr_create($db, $repo_id, $namespace, $old_rev, $new_rev, $refname, $
76 77 . ", '$refname', '$old_rev', '$new_rev', 0, '$ip')"; . ", '$refname', '$old_rev', '$new_rev', 0, '$ip')";
77 78 $res = rg_sql_query($db, $sql); $res = rg_sql_query($db, $sql);
78 79 if ($res === FALSE) { if ($res === FALSE) {
79 rg_mr_set_error("cannot insert merge request (" . rg_sql_error() . ")");
80 rg_mr_set_error("cannot insert merge request"
81 . " (" . rg_sql_error() . ")");
80 82 return FALSE; return FALSE;
81 83 } }
82 84
 
... ... function rg_mr_queue_process($db)
155 157 return $ret; return $ret;
156 158 } }
157 159
160 /*
161 * Helper to condiment mr data
162 */
163 function rg_mr_condiment(&$row)
164 {
165 $row['date_utc'] = gmdate("Y-m-d H:i", $row['itime']);
166 $row['old_rev_short'] = substr($row['old_rev'], 0, 7);
167 $row['new_rev_short'] = substr($row['new_rev'], 0, 7);
168 }
169
158 170 /* /*
159 171 * Loads merge requests * Loads merge requests
160 172 */ */
 
... ... function rg_mr_load($db, $repo_id, $limit)
175 187
176 188 $ret = array(); $ret = array();
177 189 while (($row = rg_sql_fetch_array($res))) { while (($row = rg_sql_fetch_array($res))) {
178 // compute some fields
179 $row['date_utc'] = gmdate("Y-m-d H:i", $row['itime']);
180
190 rg_mr_condiment($row);
181 191 $ret[] = $row; $ret[] = $row;
182 192 } }
183 193 rg_sql_free_result($res); rg_sql_free_result($res);
 
... ... function rg_mr_load($db, $repo_id, $limit)
185 195 return $ret; return $ret;
186 196 } }
187 197
198 /*
199 * Loads a merge request
200 */
201 function rg_mr_load_one($db, $repo_id, $namespace)
202 {
203 rg_log("rg_mr_load_one: repo_id=$repo_id namespace=$namespace");
204
205 $sql = "SELECT * FROM merge_requests"
206 . " WHERE repo_id = $repo_id"
207 . " AND namespace = '$namespace'";
208 $res = rg_sql_query($db, $sql);
209 if ($res === FALSE) {
210 rg_mr_set_error("cannot load a merge request"
211 . " (" . rg_sql_error() . ")");
212 return FALSE;
213 }
214
215 $row = rg_sql_fetch_array($res);
216 rg_mr_condiment($row);
217
218 rg_sql_free_result($res);
219
220 return $row;
221 }
222
188 223 ?> ?>
File inc/repo.inc.php changed (mode: 100644) (index 4376cae..80bcd9e)
... ... function rg_repo_over_limit($ri)
593 593 function rg_repo_stats_push2file($a) function rg_repo_stats_push2file($a)
594 594 { {
595 595 global $php_errormsg; global $php_errormsg;
596 global $rg_repos;
596 global $rg_state_dir;
597 597
598 $q = $rg_repos . "/qstats";
598 $q = $rg_state_dir . "/qstats";
599 599 if (!is_dir($q)) { if (!is_dir($q)) {
600 600 $r = @mkdir($q, 0700); $r = @mkdir($q, 0700);
601 601 if ($r !== TRUE) { if ($r !== TRUE) {
File inc/rights.inc.php changed (mode: 100644) (index 3946e64..e0ff1c4)
... ... function rg_rights_mask($val, $mask)
286 286 $ret = ""; $ret = "";
287 287 $len = strlen($val); $len = strlen($val);
288 288 for ($i = 0; $i < $len; $i++) for ($i = 0; $i < $len; $i++)
289 if (strstr($mask, $val[$i]))
289 if (strstr($mask, $val[$i]) && !strstr($ret, $val[$i]))
290 290 $ret .= $val[$i]; $ret .= $val[$i];
291 291
292 292 return $ret; return $ret;
File inc/user.inc.php changed (mode: 100644) (index a4ae5ca..7107b57)
... ... function rg_user_forgot_pass_mail_prepare($db, $email)
624 624 { {
625 625 rg_log("user_forgot_pass_mail_prepare: email=$email"); rg_log("user_forgot_pass_mail_prepare: email=$email");
626 626
627 $ret = array();
628 $ret['ok'] = 0;
629 $ret['exists'] = 0;
630
627 631 $expire = time() + 24 * 3600; $expire = time() + 24 * 3600;
628 632 $token = rg_id(40); $token = rg_id(40);
629 633
630 634 $r = rg_user_info($db, 0, "", $email); $r = rg_user_info($db, 0, "", $email);
631 if ($r['ok'] == 0)
632 return FALSE;
633 if ($r['exists'] == 0)
634 return FALSE;
635 if ($r['ok'] == 0) {
636 rg_log("\tInternal error.");
637 return $ret;
638 }
639 if ($r['exists'] == 0) {
640 rg_log("\tUser does not exists.");
641 $ret['ok'] = 1;
642 return $ret;
643 }
635 644 $uid = $r['uid']; $uid = $r['uid'];
636 645
637 646 // store token in database // store token in database
 
... ... function rg_user_forgot_pass_mail_prepare($db, $email)
640 649 $res = rg_sql_query($db, $sql); $res = rg_sql_query($db, $sql);
641 650 if ($res === FALSE) { if ($res === FALSE) {
642 651 rg_user_set_error("cannot query (" . rg_sql_error() . ")"); rg_user_set_error("cannot query (" . rg_sql_error() . ")");
643 return FALSE;
652 return $ret;
644 653 } }
645 654 rg_sql_free_result($res); rg_sql_free_result($res);
646 655
647 return $token;
656 $ret['ok'] = 1;
657 $ret['exists'] = 1;
658 $ret['token'] = $token;
659 return $ret;
648 660 } }
649 661
650 662 /* /*
 
... ... function rg_user_forgot_pass_mail($db, $email)
656 668
657 669 rg_log("user_forgot_pass_mail: email=$email"); rg_log("user_forgot_pass_mail: email=$email");
658 670
659 $forgot_token = rg_user_forgot_pass_mail_prepare($db, $email);
660 if ($forgot_token === FALSE)
661 return FALSE;
671 $ret = array();
672 $ret['ok'] = 0;
673
674 $r = rg_user_forgot_pass_mail_prepare($db, $email);
675 if ($r['exists'] != 1)
676 return $r;
662 677
663 678 $headers = "From: $rg_admin_name <$rg_admin_email>"; $headers = "From: $rg_admin_name <$rg_admin_email>";
664 679
 
... ... function rg_user_forgot_pass_mail($db, $email)
672 687 $headers, $headers,
673 688 "-f $rg_admin_email")) { "-f $rg_admin_email")) {
674 689 rg_user_set_error("Cannot send mail ($php_errormsg)!"); rg_user_set_error("Cannot send mail ($php_errormsg)!");
675 return FALSE;
690 return $ret;
676 691 } }
677 692
678 return TRUE;
693 $ret['ok'] = 1;
694 return $ret;
679 695 } }
680 696
681 697 /* /*
File inc/user/forgot_send.php changed (mode: 100644) (index 6b50ef2..2015b37)
... ... $show_form = 1;
10 10
11 11 if ($doit == 1) { if ($doit == 1) {
12 12 $r = rg_user_forgot_pass_mail($db, $email); $r = rg_user_forgot_pass_mail($db, $email);
13 if ($r === FALSE) {
14 $errmsg[] = "Cannot send mail!";
13 rg_log("DEBUG: user_forgot_pass_mail: " . rg_array2string($r) . ".");
14 if ($r['ok'] == 0) {
15 $errmsg[] = "Internal error! Try again later.";
16 } else if ($r['exists'] == 0) {
17 $errmsg[] = "E-mail does not exists.";
15 18 } else { } else {
16 19 $_forgot .= "E-mail was sent!"; $_forgot .= "E-mail was sent!";
17 20 $show_form = 0; $show_form = 0;
File inc/user/repo-page.php changed (mode: 100644) (index 9ea8923..5e11581)
... ... $_more = array(
42 42 ); );
43 43
44 44 $repo_dir = rg_repo_name2base($rr) . $rr['repo'] . ".git"; $repo_dir = rg_repo_name2base($rr) . $rr['repo'] . ".git";
45 rg_log("repo_dir=$repo_dir");
45 46 putenv("GIT_DIR=$repo_dir"); putenv("GIT_DIR=$repo_dir");
46 47
48 // default is "source" tab
49 if (empty($subop))
50 $subop = "source";
51
47 52 if (strcmp($subop, "admin") == 0) { if (strcmp($subop, "admin") == 0) {
48 53 if ($can_admin != 1) if ($can_admin != 1)
49 54 rg_security_violation("User is not admin!"); rg_security_violation("User is not admin!");
50 55
51 56 include($INC . "/user/repo/admin.php"); include($INC . "/user/repo/admin.php");
52 57 $_repo_page_body .= $_admin; $_repo_page_body .= $_admin;
53 } else if (strcmp($subop, "tree") == 0) {
54 if (empty($paras[0]))
55 $obj = "";
56 else
57 $obj = rg_git_reference($paras[0]);
58
59 $_tree = rg_git_ls_tree($obj);
60 $_repo_page_body .= rg_template_table("repo/tree", $_tree, $_more);
61 } else if (strcmp($subop, "blob") == 0) {
62 $obj = rg_git_reference($paras[0]);
63 $c = rg_git_content($obj);
64 $blob = array(
65 "obj" => $obj,
66 "HTML:content" => rg_template_list($c)
67 );
68 $_repo_page_body .= rg_template("repo/blob.html", array_merge($blob, $_more));
58 } else if (strcmp($subop, "source") == 0) {
59 $subop = array_shift($paras);
60
61 $type_ref = rg_git_parse_ref($paras);
62 $ref = $type_ref['ref_path'];
63 $_more = array_merge($_more, $type_ref);
64
65 $bt = rg_git_branches_and_tags($repo_dir, $_more['url_repo'],
66 $type_ref['ref_url']);
67 rg_log("DEBUG: _more: " . print_r($_more, TRUE));
68 $_more = array_merge($_more, $bt);
69
70 $_repo_page_body .= rg_template("repo/source.html", $_more);
71
72 rg_log("DEBUG: subop=[$subop]");
73 if (strcmp($subop, "tree") == 0) {
74 if (empty($paras)) {
75 $type = "tree";
76 } else {
77 $type = array_shift($paras);
78 }
79 rg_log("DEBUG: type=[$type]");
80
81 if (strcmp($type, "tree") == 0) {
82 $_tree = rg_git_ls_tree($ref, implode("/", $paras));
83 $_repo_page_body .= rg_template_table("repo/tree", $_tree, $_more);
84 } else if (strcmp($type, "blob") == 0) {
85 // TODO: transform path in tree
86 /*
87 $c = rg_git_content($obj);
88 $blob = array(
89 "obj" => $obj,
90 "HTML:content" => rg_template_list($c)
91 );
92 $_repo_page_body .= rg_template("repo/blob.html",
93 array_merge($blob, $_more));
94 */
95 }
96 } else { // log is default
97 $log = rg_git_log(10, "", $ref, FALSE);
98 if ($log === FALSE) {
99 rg_log("Error generating log (" . rg_git_error() . ")!");
100 $_repo_page_body .= "Error generating log!";
101 // TODO: rg_internal_error?
102 } else {
103 //rg_log("DEBUG: log: " . print_r($log, TRUE));
104 $_repo_page_body .= rg_git_log_template($log,
105 "repo/log", $_more);
106 }
107 }
108
109 } else if (strcmp($subop, "issues") == 0) {
110 $_repo_page_body .= rg_template("repo/issues.html", $_more);
69 111 } else if (strcmp($subop, "stats") == 0) { } else if (strcmp($subop, "stats") == 0) {
70 $_repo_page_body .= "Sorry, not yet implemented!";
112 $_repo_page_body .= rg_template("repo/stats.html", $_more);
113 } else if (strcmp($subop, "mrs") == 0) {
114 $_repo_page_body .= rg_template("repo/mrs.html", $_more);
115
116 $r = rg_mr_load($db, $ri['repo_id'], 20);
117 if ($r === FALSE) {
118 $_repo_page_body .= "Error getting merge request list ("
119 . rg_mr_error() . ").";
120 } else {
121 $_repo_page_body .= rg_template_table("repo/mr/list", $r, $_more);
122 }
71 123 } else if (strcmp($subop, "mr") == 0) { } else if (strcmp($subop, "mr") == 0) {
72 $r = rg_mr_load($db, $ri['repo_id'], 10);
124 $mr = preg_replace('/[^0-9a-zA-Z_]/', '', $paras[0]);
125 $r = rg_mr_load_one($db, $ri['repo_id'], $mr);
73 126 if ($r === FALSE) { if ($r === FALSE) {
74 $_repo_page_body .= "Error getting merge request list (" . rg_mr_error() . ").";
127 $_repo_page_body .= "Error getting merge request (" . rg_mr_error() . ").";
75 128 } else { } else {
76 $_repo_page_body .= rg_template_table("repo/mr", $r, $_more);
129 $_repo_page_body .= rg_template("repo/mr/page.html", $r, $_more);
77 130 } }
78 } else { // log
79 if (empty($paras[0])) {
80 rg_log("Show full log");
81 $log = rg_git_log(10, "", "", FALSE);
82 rg_log("DEBUG: log: " . print_r($log, TRUE));
83 $_repo_page_body .= rg_git_log_template($log, "repo/log", $_more);
131 } else if (strcmp($subop, "commit") == 0) {
132 $commit = rg_git_reference($paras[0]);
133 rg_log("Show diff for commit [$commit]");
134
135 if (strstr($commit, "..")) {
136 $t = explode("..", $commit);
137 $first = $t[0];
138 $second = $t[1];
84 139 } else { } else {
85 $commit = rg_git_reference($paras[0]);
86 rg_log("Show diff for commit [$commit]");
140 $first = $commit . "~1";
141 $second = $commit;
142 }
87 143
88 $log = rg_git_log(1, $commit . "~1", $commit, TRUE);
89 rg_log("log: " . print_r($log, TRUE));
90 144
91 // stats
92 $_repo_page_body .= rg_git_files_stats($log[0]['files'], "repo/fstat");
145 $log = rg_git_log(1, $first, $second, TRUE);
146 rg_log("log: " . print_r($log, TRUE));
93 147
94 // diff
95 //rg_log("patch: " . print_r($log[0]['patches'], TRUE));
96 $_repo_page_body .= rg_git_diff($log[0]['patches'], "repo/diff.html");
97 }
148 // stats
149 $_repo_page_body .= rg_git_files_stats($log[0]['files'], "repo/fstat");
150
151 // diff
152 //rg_log("patch: " . print_r($log[0]['patches'], TRUE));
153 $_repo_page_body .= rg_git_diff($log[0]['patches'], "repo/diff.html");
98 154 } }
99 155
100 156 $ri2 = $ri; $ri2 = $ri;
 
... ... $_repo_page_head = rg_template("repo/main.html", array_merge($ri2, $_more));
106 162 $_repo_page = $_repo_page_head . $_repo_page_body; $_repo_page = $_repo_page_head . $_repo_page_body;
107 163
108 164 ?> ?>
109
File inc/user/repo/admin.php changed (mode: 100644) (index e7b5793..15ea6ca)
... ... case 'delete':
25 25 $_admin_body .= $_delete; $_admin_body .= $_delete;
26 26 break; break;
27 27
28 case '':
29 break;
30
28 31 default: default:
29 32 rg_log("BAD, invalid op=$_op!"); rg_log("BAD, invalid op=$_op!");
30 33 } }
File inc/util.inc.php changed (mode: 100644) (index 3c8bb9d..8ebdb31)
... ... function rg_menu($a, $rg_ui)
304 304 */ */
305 305 function rg_prepare_conditionals(&$data, &$what, &$values) function rg_prepare_conditionals(&$data, &$what, &$values)
306 306 { {
307 $what[] = "/@@if\(0\){{(.*)}}{{(.*)}}/U";
308 $values[] = "\\2";
307 $what['false'] = "/@@if\(0\){{(.*)}}{{(.*)}}/U";
308 $values['false'] = "\\2";
309 309
310 $what[] = "/@@if\(.*\){{(.*)}}{{(.*)}}/U";
311 $values[] = "\\1";
310 $what['true'] = "/@@if\(.*\){{(.*)}}{{(.*)}}/U";
311 $values['true'] = "\\1";
312 312 } }
313 313
314 314 function rg_prepare_replace(&$data, &$what, &$values) function rg_prepare_replace(&$data, &$what, &$values)
315 315 { {
316 if (count($data) == 0)
317 return;
318
319 foreach ($data as $k => $v) {
320 if (strncmp($k, "HTML:", 5) == 0) {
321 $k = substr($k, 5);
322 } else {
323 $v = htmlspecialchars($v);
316 if (!empty($data)) {
317 foreach ($data as $k => $v) {
318 if (strncmp($k, "HTML:", 5) == 0) {
319 $k = substr($k, 5);
320 } else {
321 $v = htmlspecialchars($v);
322 }
323 $what[$k] = "/@@" . $k . "@@/U";
324 $values[$k] = $v;
324 325 } }
325 $what[] = "/@@" . $k . "@@/U";
326 $values[] = $v;
327 326 } }
327
328 $what['DUMP'] = "/@@DUMP@@/U";
329 $values['DUMP'] = print_r($data, TRUE);
330
331 //rg_log("DEBUG: what: " . print_r($what, TRUE));
332 //rg_log("DEBUG: values: " . print_r($values, TRUE));
328 333 } }
329 334
330 335 /* /*
 
... ... function rg_redirect($url)
474 479 */ */
475 480 function rg_array2string($a) function rg_array2string($a)
476 481 { {
482 if (empty($a))
483 return "";
484
477 485 $ret = ""; $ret = "";
478 486 $add = ""; $add = "";
479 487 foreach ($a as $k => $v) { foreach ($a as $k => $v) {
 
... ... function rg_array2string($a)
489 497 */ */
490 498 function rg_dir_load($dir) function rg_dir_load($dir)
491 499 { {
500 global $php_errormsg;
501
492 502 $ret = array(); $ret = array();
493 $d = scandir($dir);
503 $d = @scandir($dir);
504 if ($d === FALSE) {
505 rg_log("Cannot scan dir $dir ($php_errormsg).");
506 return $ret;
507 }
508
494 509 foreach ($d as $file) { foreach ($d as $file) {
495 510 if ((strcmp($file, ".") == 0) || (strcmp($file, "..") == 0)) if ((strcmp($file, ".") == 0) || (strcmp($file, "..") == 0))
496 511 continue; continue;
 
... ... function rg_dir_load($dir)
501 516 return $ret; return $ret;
502 517 } }
503 518
519 /*
520 * Recursive dir load (used for references)
521 */
522 function rg_dir_load_deep($dir)
523 {
524 $ret = array();
525
526 if (is_file($dir))
527 return array($dir);
528
529 $d = rg_dir_load($dir);
530 foreach ($d as $obj) {
531 if (is_dir($dir . "/" . $obj)) {
532 $c = rg_dir_load_deep($dir . "/" . $obj);
533 foreach ($c as $obj2)
534 $ret[] = $obj . "/" . $obj2;
535 } else {
536 $ret[] = $obj;
537 }
538 }
539
540 return $ret;
541 }
542
543 /*
544 * Copy a fs tree to another place
545 */
546 function rg_copy_tree($src, $dst, $mask)
547 {
548 global $php_errormsg;
549
550 if (!is_dir($dst)) {
551 $r = @mkdir($dst, $mask);
552 if ($r !== TRUE) {
553 rg_log("ERROR: Cannot mkdir [$dst] ($php_errormsg).");
554 return FALSE;
555 }
556 }
557
558 $d = rg_dir_load($src);
559 foreach ($d as $obj) {
560 if (is_dir($src . "/" . $obj)) {
561 if (!is_dir($dst . "/" . $obj)) {
562 $r = @mkdir($dst . "/" . $obj, $mask);
563 if ($r !== TRUE) {
564 rg_log("ERROR: Cannot mkdir [$dst/$obj]"
565 . " ($php_errormsg).");
566 return FALSE;
567 }
568 }
569
570 $r = rg_copy_tree($src . "/" . $obj, $dst . "/" . $obj, $mask);
571 if ($r !== TRUE)
572 return FALSE;
573 } else {
574 $r = @copy($src . "/" . $obj, $dst . "/" . $obj);
575 if ($r !== TRUE) {
576 rg_log("ERROR: Cannot copy file ($php_errormsg).");
577 return FALSE;
578 }
579 }
580 }
581
582 return TRUE;
583 }
584
504 585 ?> ?>
File rocketgit.spec.in changed (mode: 100644) (index de959fd..bbef3a7)
... ... Source: http://kernel.embedromix.ro/us/rocketgit/%{name}-%{version}.tar.gz
8 8 URL: http://kernel.embedromix.ro/us/ URL: http://kernel.embedromix.ro/us/
9 9 BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
10 10 BuildArch: noarch BuildArch: noarch
11 Requires: httpd, php, php-cli, php-pgsql, xinetd
11 Requires: httpd, php, php-cli, php-pgsql, php-gd, xinetd
12 12 Requires: shadow-utils, git, postgresql-server, policycoreutils-python Requires: shadow-utils, git, postgresql-server, policycoreutils-python
13 13
14 14
File root/themes/default/main.css changed (mode: 100644) (index 42a41be..c584eca)
... ... th, td {
23 23 text-align: left; text-align: left;
24 24 padding: 3px; padding: 3px;
25 25 border: 1px solid #aaaaaa; border: 1px solid #aaaaaa;
26 x-white-space: pre-wrap; <!-- Seems that force td cells to be bigger than necessary! -->
27 26 word-wrap: break-word; word-wrap: break-word;
28 27 } }
29 28
 
... ... th, td {
68 67 .junk { .junk {
69 68 } }
70 69
70 .branch { padding: 5px; }
71 .branch ul { list-style-type: none; }
72 .branch li { display: inline; }
73 .branch ul li a {
74 padding: 1px 2px;
75 text-decoration: none;
76 color: black;
77 background-color: #a0ffa0;
78 border: 1px solid black;
79 border-radius: 4px 4px 4px 4px;
80 font-size: 9pt;
81 }
82
83 .tag { padding: 5px; }
84 .tag ul { list-style-type: none; }
85 .tag li { display: inline; }
86 .tag ul li a {
87 padding: 1px 2px;
88 text-decoration: none;
89 color: black;
90 background-color: #FFFFa0;
91 border: 1px solid black;
92 border-radius: 4px 4px 4px 4px;
93 font-size: 9pt;
94 }
95
71 96 #header { #header {
72 97 border: 1px solid #eeeeee; border: 1px solid #eeeeee;
73 98 background-color: #eeeeee; background-color: #eeeeee;
File root/themes/default/repo/fstat/header.html changed (mode: 100644) (index 73eefdd..12a85bd)
1 <br />
1 2 <table> <table>
2 3 <tr> <tr>
3 4 <th>File</th> <th>File</th>
File root/themes/default/repo/issues.html added (mode: 100644) (index 0000000..9cd7f6d)
1 Not yet implemented. Sorry.
File root/themes/default/repo/log/header.html changed (mode: 100644) (index 86791b5..d3b201b)
1 <br />
1 2 <table width="100%"> <table width="100%">
2 3 <tr> <tr>
3 4 <th>Subject</th> <th>Subject</th>
File root/themes/default/repo/log/line.html changed (mode: 100644) (index bcf21d5..229426b)
1 1 <tr> <tr>
2 2 <td>@@subject@@</td> <td>@@subject@@</td>
3 <td><a href="@@url_repo@@/log/@@sha1_short@@">@@sha1_short@@</a></td>
3 <td><a href="@@url_repo@@/source/log/commit/@@sha1_short@@">@@sha1_short@@</a></td>
4 4 <td>@@author name@@ (@@author email@@)</td> <td>@@author name@@ (@@author email@@)</td>
5 5 <td>@@author date UTC@@</td> <td>@@author date UTC@@</td>
6 6 <td>@@files_changed@@</td> <td>@@files_changed@@</td>
File root/themes/default/repo/main.html changed (mode: 100644) (index 2d38b33..67f6973)
... ... Maximum commit size: @@max_commit_size@@<br />
13 13
14 14 <div class="menu"> <div class="menu">
15 15 <ul> <ul>
16 <li><a href="@@url_repo@@/log">Log</a></li>
17 <li><a href="@@url_repo@@/tree">Tree</a></li>
18 <li><a href="@@url_repo@@/stats">Stats</a></li>
19 <li><a href="@@url_repo@@/mr">Merge requests</a></li>
16 <li><a href="@@url_repo@@/source">Source</a></li>
17 <li><a href="@@url_repo@@/mrs">Merge requests</a></li>
18 <li><a href="@@url_repo@@/issues">Issues</a></li>
20 19 @@if(@@can_admin@@){{<li><a href="@@url_repo@@/admin">Admin</a></li>}}{{}} @@if(@@can_admin@@){{<li><a href="@@url_repo@@/admin">Admin</a></li>}}{{}}
21 20 </ul> </ul>
22 21 </div> </div>
22
File root/themes/default/repo/mr/header.html deleted (index e590abd..0000000)
1 <table>
2 <tr>
3 <th>Date / time</th>
4 <th>Ref</th>
5 <th>IP</th>
6 </tr>
7
File root/themes/default/repo/mr/line.html deleted (index 353af1b..0000000)
1 <tr>
2 <td>@@date_utc@@</td>
3 <td>@@refname@@</td>
4 <td>@@ip@@</td>
5 </tr>
File root/themes/default/repo/mr/list/footer.html renamed from root/themes/default/repo/mr/footer.html (similarity 100%)
File root/themes/default/repo/mr/list/header.html added (mode: 100644) (index 0000000..89bce5a)
1 <table>
2 <tr>
3 <th>ID</th>
4 <th>Date / time</th>
5 <th>Ref</th>
6 @@if(@@can_admin@@){{<th>IP</th>}}{{}}
7 <th>Go to</th>
8 </tr>
9
File root/themes/default/repo/mr/list/line.html added (mode: 100644) (index 0000000..cdf51bb)
1 <tr>
2 <td>@@namespace@@</td>
3 <td>@@date_utc@@</td>
4 <td>@@refname@@</td>
5 @@if(@@can_admin@@){{<td>@@ip@@</td>}}{{}}
6 <td><a href="@@url_repo@@/mr/@@namespace@@">Details</a></td>
7 </tr>
File root/themes/default/repo/mr/list/nodata.html renamed from root/themes/default/repo/mr/nodata.html (similarity 100%)
File root/themes/default/repo/mr/page.html added (mode: 100644) (index 0000000..646f863)
1 Merge request @@namespace@@
File root/themes/default/repo/mrs.html added (mode: 100644) (index 0000000..e69de29)
File root/themes/default/repo/source.html added (mode: 100644) (index 0000000..51e8a12)
1 <!-- Tags -->
2 @@tag@@
3
4 <!-- Branches -->
5 @@branch@@
6
7 <div class="menu">
8 <ul>
9 <li><a href="@@url_repo@@/source/log@@ref_url@@">Log</a></li>
10 <li><a href="@@url_repo@@/source/tree@@ref_url@@">Tree</a></li>
11 </ul>
12 </div>
File root/themes/default/repo/stats.html added (mode: 100644) (index 0000000..9cd7f6d)
1 Not yet implemented. Sorry.
File root/themes/default/repo/tree/header.html changed (mode: 100644) (index 80d0cdf..c97773a)
1 <br />
1 2 <table> <table>
2 3 <tr> <tr>
3 4 <th>Mode</th> <th>Mode</th>
File root/themes/default/repo/tree/line.html changed (mode: 100644) (index 1fc33e1..72caf71)
3 3 <td>@@type@@</td> <td>@@type@@</td>
4 4 <td>@@size@@</td> <td>@@size@@</td>
5 5 <td>@@ref@@</td> <td>@@ref@@</td>
6 <td><a href="@@url_repo@@/@@type@@/@@ref@@">@@file@@</a></td>
6 <td><a href="@@url_repo@@/source/tree@@ref_url@@/@@type@@/@@file@@">@@file@@</a></td>
7 7 </tr> </tr>
File samples/config.php changed (mode: 100644) (index 1b8f9a7..197135b)
... ... $rg_max_ssh_keys = 10;
49 49 $rg_log_dir = "/var/log/rocketgit"; $rg_log_dir = "/var/log/rocketgit";
50 50 $rg_web_log_dir = "/var/log/rocketgit-web"; $rg_web_log_dir = "/var/log/rocketgit-web";
51 51
52 // state dir
53 $rg_state_dir = "/var/lib/rocketgit";
54
52 55 // lock dir // lock dir
53 $rg_lock_dir = "/var/lib/rocketgit/locks";
56 $rg_lock_dir = $rg_state_dir . "/locks";
54 57
55 58 // Repositories dir // Repositories dir
56 $rg_repos = "/var/lib/rocketgit/repos";
59 $rg_repos = $rg_state_dir . "/repos";
57 60
58 61 // Default theme // Default theme
59 62 $rg_theme = "default"; $rg_theme = "default";
File scripts/remote.php changed (mode: 100644) (index 86bfea7..ae8c667)
... ... if ($push == 1) {
191 191 if ($ret === FALSE) if ($ret === FALSE)
192 192 fatal("Internal error (namespace dir)"); fatal("Internal error (namespace dir)");
193 193 // copy refs // copy refs
194 $dir = rg_dir_load($repo_path . "/refs/heads");
195 foreach ($dir as $file) {
196 rg_log("Copy ref '$file'...");
197 if (@copy($repo_path . "/refs/heads/" . $file, $dst . "/" . $file) === FALSE)
198 fatal("Internal error (cannot copy refs)");
199 }
194 $r = rg_copy_tree($repo_path . "/refs/heads", $dst . "/", 0755);
195 if ($r !== TRUE)
196 fatal("Internal error (cannot copy refs)");
200 197 } }
201 198
202 199 $run = "git-shell -c \"" . $cmd . " " . escapeshellarg($repo_path) . "\""; $run = "git-shell -c \"" . $cmd . " " . escapeshellarg($repo_path) . "\"";
File tests/git2.sh changed (mode: 100755) (index 367c88e..8df50bd)
2 2
3 3 mkdir git2 mkdir git2
4 4 cd git2 cd git2
5 git-init
5 git init
6 6 echo "a" > a echo "a" > a
7 7 git add a git add a
8 8 git commit -a -m "aa" git commit -a -m "aa"
9 9 git checkout -b group1/branch1 git checkout -b group1/branch1
10 git checkout -b group2/subgroup1/branch2
10 git checkout -b group2/subgroup1/branch2
11 git tag -a -m "aaaa" v1.0
12 git tag unannot1
13
File tests/git2/a deleted (index 7898192..0000000)
1 a
File tests/repo.php changed (mode: 100644) (index b779f70..85cb97c)
... ... if ($r !== FALSE) {
175 175
176 176
177 177 // test stats // test stats
178 $rg_repos = "repos";
178 $rg_state_dir = "repos";
179 179 $a = array( $a = array(
180 180 "itime" => time(), "itime" => time(),
181 181 "ip" => "IPIPIPIPIPIP1", "ip" => "IPIPIPIPIPIP1",
 
... ... if ($f === FALSE) {
188 188 echo "push2file returned FALSE!\n"; echo "push2file returned FALSE!\n";
189 189 exit(1); exit(1);
190 190 } }
191 $r = unserialize(file_get_contents($rg_repos . "/qstats/$f"));
191 $r = unserialize(file_get_contents($rg_state_dir . "/qstats/$f"));
192 192 if ($r === FALSE) { if ($r === FALSE) {
193 193 echo "Cannot get file or unserialize!\n"; echo "Cannot get file or unserialize!\n";
194 194 exit(1); exit(1);
File tests/tree1/a/f2 added (mode: 100644) (index 0000000..e69de29)
File tests/tree1/f1 added (mode: 100644) (index 0000000..e69de29)
File tests/user.php changed (mode: 100644) (index e6501bb..5312402)
... ... if ($r !== TRUE) {
39 39 $uid = rg_sql_last_id($db); $uid = rg_sql_last_id($db);
40 40
41 41 $v = rg_user_forgot_pass_mail($db, "rg@localhost"); $v = rg_user_forgot_pass_mail($db, "rg@localhost");
42 if ($v === FALSE) {
42 if (empty($v['token'])) {
43 43 echo "Error: " . rg_user_error() . "!\n"; echo "Error: " . rg_user_error() . "!\n";
44 44 exit(1); exit(1);
45 45 } }
 
... ... if ($r !== TRUE) {
102 102 } }
103 103
104 104 // get token for e-mail forgot pass feature // get token for e-mail forgot pass feature
105 $token = rg_user_forgot_pass_mail_prepare($db, "rg@localhost");
106 if ($token === FALSE) {
105 $r = rg_user_forgot_pass_mail_prepare($db, "rg@localhost");
106 if (empty($r['token'])) {
107 107 echo "Could not get token (" . rg_user_error() . ")!\n"; echo "Could not get token (" . rg_user_error() . ")!\n";
108 108 exit(1); exit(1);
109 109 } }
File tests/util.php changed (mode: 100644) (index 2be2b27..0c617f2)
... ... if (strcmp($r, $e) != 0) {
82 82 exit(1); exit(1);
83 83 } }
84 84
85 // test rg_copy_tree
86 $r = rg_copy_tree("tree1", "tree1.copy", 0755);
87 if ($r !== TRUE) {
88 echo "rg_copy_tree malfunction!\n";
89 exit(1);
90 }
91 if (!file_exists("tree1.copy/a/f2")) {
92 echo "rg_copy_tree malfunction (f2)!\n";
93 exit(1);
94 }
95
85 96 echo "util: OK!\n"; echo "util: OK!\n";
86 97 ?> ?>
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/catalinux/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/rocketgit

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main