You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

repo.go 72 kB

11 years ago
11 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
10 years ago
11 years ago
9 years ago
10 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
9 years ago
11 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
11 years ago
9 years ago
9 years ago
9 years ago
9 years ago
11 years ago
9 years ago
11 years ago
9 years ago
9 years ago
9 years ago
9 years ago
11 years ago
9 years ago
11 years ago
11 years ago
9 years ago
9 years ago
9 years ago
9 years ago
11 years ago
9 years ago
10 years ago
10 years ago
9 years ago
9 years ago
9 years ago
9 years ago
11 years ago
11 years ago
11 years ago
9 years ago
9 years ago
9 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
10 years ago
9 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
9 years ago
9 years ago
11 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
9 years ago
9 years ago
11 years ago
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package models
  5. import (
  6. "bytes"
  7. "errors"
  8. "fmt"
  9. "html/template"
  10. "io"
  11. "io/ioutil"
  12. "mime/multipart"
  13. "os"
  14. "os/exec"
  15. "path"
  16. "path/filepath"
  17. "regexp"
  18. "sort"
  19. "strings"
  20. "time"
  21. "github.com/Unknwon/cae/zip"
  22. "github.com/Unknwon/com"
  23. "github.com/go-xorm/xorm"
  24. "github.com/mcuadros/go-version"
  25. "gopkg.in/ini.v1"
  26. git "github.com/gogits/git-module"
  27. api "github.com/gogits/go-gogs-client"
  28. gouuid "github.com/satori/go.uuid"
  29. "github.com/gogits/gogs/modules/bindata"
  30. "github.com/gogits/gogs/modules/log"
  31. "github.com/gogits/gogs/modules/markdown"
  32. "github.com/gogits/gogs/modules/process"
  33. "github.com/gogits/gogs/modules/setting"
  34. "github.com/gogits/gogs/modules/sync"
  35. )
  36. const (
  37. _TPL_UPDATE_HOOK = "#!/usr/bin/env %s\n%s update $1 $2 $3 --config='%s'\n"
  38. )
  39. var repoWorkingPool = sync.NewSingleInstancePool()
  40. var (
  41. ErrRepoFileNotExist = errors.New("Repository file does not exist")
  42. ErrRepoFileNotLoaded = errors.New("Repository file not loaded")
  43. ErrMirrorNotExist = errors.New("Mirror does not exist")
  44. ErrInvalidReference = errors.New("Invalid reference specified")
  45. ErrNameEmpty = errors.New("Name is empty")
  46. )
  47. var (
  48. Gitignores, Licenses, Readmes []string
  49. // Maximum items per page in forks, watchers and stars of a repo
  50. ItemsPerPage = 40
  51. )
  52. func LoadRepoConfig() {
  53. // Load .gitignore and license files and readme templates.
  54. types := []string{"gitignore", "license", "readme"}
  55. typeFiles := make([][]string, 3)
  56. for i, t := range types {
  57. files, err := bindata.AssetDir("conf/" + t)
  58. if err != nil {
  59. log.Fatal(4, "Fail to get %s files: %v", t, err)
  60. }
  61. customPath := path.Join(setting.CustomPath, "conf", t)
  62. if com.IsDir(customPath) {
  63. customFiles, err := com.StatDir(customPath)
  64. if err != nil {
  65. log.Fatal(4, "Fail to get custom %s files: %v", t, err)
  66. }
  67. for _, f := range customFiles {
  68. if !com.IsSliceContainsStr(files, f) {
  69. files = append(files, f)
  70. }
  71. }
  72. }
  73. typeFiles[i] = files
  74. }
  75. Gitignores = typeFiles[0]
  76. Licenses = typeFiles[1]
  77. Readmes = typeFiles[2]
  78. sort.Strings(Gitignores)
  79. sort.Strings(Licenses)
  80. sort.Strings(Readmes)
  81. }
  82. func NewRepoContext() {
  83. zip.Verbose = false
  84. // Check Git installation.
  85. if _, err := exec.LookPath("git"); err != nil {
  86. log.Fatal(4, "Fail to test 'git' command: %v (forgotten install?)", err)
  87. }
  88. // Check Git version.
  89. gitVer, err := git.BinVersion()
  90. if err != nil {
  91. log.Fatal(4, "Fail to get Git version: %v", err)
  92. }
  93. log.Info("Git Version: %s", gitVer)
  94. if version.Compare("1.7.1", gitVer, ">") {
  95. log.Fatal(4, "Gogs requires Git version greater or equal to 1.7.1")
  96. }
  97. // Git requires setting user.name and user.email in order to commit changes.
  98. for configKey, defaultValue := range map[string]string{"user.name": "Gogs", "user.email": "gogs@fake.local"} {
  99. if stdout, stderr, err := process.Exec("NewRepoContext(get setting)", "git", "config", "--get", configKey); err != nil || strings.TrimSpace(stdout) == "" {
  100. // ExitError indicates this config is not set
  101. if _, ok := err.(*exec.ExitError); ok || strings.TrimSpace(stdout) == "" {
  102. if _, stderr, gerr := process.Exec("NewRepoContext(set "+configKey+")", "git", "config", "--global", configKey, defaultValue); gerr != nil {
  103. log.Fatal(4, "Fail to set git %s(%s): %s", configKey, gerr, stderr)
  104. }
  105. log.Info("Git config %s set to %s", configKey, defaultValue)
  106. } else {
  107. log.Fatal(4, "Fail to get git %s(%s): %s", configKey, err, stderr)
  108. }
  109. }
  110. }
  111. // Set git some configurations.
  112. if _, stderr, err := process.Exec("NewRepoContext(git config --global core.quotepath false)",
  113. "git", "config", "--global", "core.quotepath", "false"); err != nil {
  114. log.Fatal(4, "Fail to execute 'git config --global core.quotepath false': %s", stderr)
  115. }
  116. RemoveAllWithNotice("Clean up repository temporary data", filepath.Join(setting.AppDataPath, "tmp"))
  117. }
  118. // Repository represents a git repository.
  119. type Repository struct {
  120. ID int64 `xorm:"pk autoincr"`
  121. OwnerID int64 `xorm:"UNIQUE(s)"`
  122. Owner *User `xorm:"-"`
  123. LowerName string `xorm:"UNIQUE(s) INDEX NOT NULL"`
  124. Name string `xorm:"INDEX NOT NULL"`
  125. Description string
  126. Website string
  127. DefaultBranch string
  128. NumWatches int
  129. NumStars int
  130. NumForks int
  131. NumIssues int
  132. NumClosedIssues int
  133. NumOpenIssues int `xorm:"-"`
  134. NumPulls int
  135. NumClosedPulls int
  136. NumOpenPulls int `xorm:"-"`
  137. NumMilestones int `xorm:"NOT NULL DEFAULT 0"`
  138. NumClosedMilestones int `xorm:"NOT NULL DEFAULT 0"`
  139. NumOpenMilestones int `xorm:"-"`
  140. NumTags int `xorm:"-"`
  141. IsPrivate bool
  142. IsBare bool
  143. IsMirror bool
  144. *Mirror `xorm:"-"`
  145. // Advanced settings
  146. EnableWiki bool `xorm:"NOT NULL DEFAULT true"`
  147. EnableExternalWiki bool
  148. ExternalWikiURL string
  149. EnableIssues bool `xorm:"NOT NULL DEFAULT true"`
  150. EnableExternalTracker bool
  151. ExternalTrackerFormat string
  152. ExternalTrackerStyle string
  153. ExternalMetas map[string]string `xorm:"-"`
  154. EnablePulls bool `xorm:"NOT NULL DEFAULT true"`
  155. IsFork bool `xorm:"NOT NULL DEFAULT false"`
  156. ForkID int64
  157. BaseRepo *Repository `xorm:"-"`
  158. Created time.Time `xorm:"-"`
  159. CreatedUnix int64
  160. Updated time.Time `xorm:"-"`
  161. UpdatedUnix int64
  162. }
  163. func (repo *Repository) BeforeInsert() {
  164. repo.CreatedUnix = time.Now().Unix()
  165. repo.UpdatedUnix = repo.CreatedUnix
  166. }
  167. func (repo *Repository) BeforeUpdate() {
  168. repo.UpdatedUnix = time.Now().Unix()
  169. }
  170. func (repo *Repository) AfterSet(colName string, _ xorm.Cell) {
  171. switch colName {
  172. case "default_branch":
  173. // FIXME: use models migration to solve all at once.
  174. if len(repo.DefaultBranch) == 0 {
  175. repo.DefaultBranch = "master"
  176. }
  177. case "num_closed_issues":
  178. repo.NumOpenIssues = repo.NumIssues - repo.NumClosedIssues
  179. case "num_closed_pulls":
  180. repo.NumOpenPulls = repo.NumPulls - repo.NumClosedPulls
  181. case "num_closed_milestones":
  182. repo.NumOpenMilestones = repo.NumMilestones - repo.NumClosedMilestones
  183. case "external_tracker_style":
  184. if len(repo.ExternalTrackerStyle) == 0 {
  185. repo.ExternalTrackerStyle = markdown.ISSUE_NAME_STYLE_NUMERIC
  186. }
  187. case "created_unix":
  188. repo.Created = time.Unix(repo.CreatedUnix, 0).Local()
  189. case "updated_unix":
  190. repo.Updated = time.Unix(repo.UpdatedUnix, 0)
  191. }
  192. }
  193. // MustOwner always returns a valid *User object to avoid
  194. // conceptually impossible error handling.
  195. // It creates a fake object that contains error deftail
  196. // when error occurs.
  197. func (repo *Repository) MustOwner() *User {
  198. return repo.mustOwner(x)
  199. }
  200. func (repo *Repository) FullName() string {
  201. return repo.MustOwner().Name + "/" + repo.Name
  202. }
  203. func (repo *Repository) HTMLURL() string {
  204. return setting.AppUrl + repo.FullName()
  205. }
  206. // Arguments that are allowed to be nil: permission
  207. func (repo *Repository) APIFormat(permission *api.Permission) *api.Repository {
  208. cloneLink := repo.CloneLink()
  209. return &api.Repository{
  210. ID: repo.ID,
  211. Owner: repo.Owner.APIFormat(),
  212. Name: repo.Name,
  213. FullName: repo.FullName(),
  214. Description: repo.Description,
  215. Private: repo.IsPrivate,
  216. Fork: repo.IsFork,
  217. HTMLURL: repo.HTMLURL(),
  218. SSHURL: cloneLink.SSH,
  219. CloneURL: cloneLink.HTTPS,
  220. Website: repo.Website,
  221. Stars: repo.NumStars,
  222. Forks: repo.NumForks,
  223. Watchers: repo.NumWatches,
  224. OpenIssues: repo.NumOpenIssues,
  225. DefaultBranch: repo.DefaultBranch,
  226. Created: repo.Created,
  227. Updated: repo.Updated,
  228. Permissions: permission,
  229. }
  230. }
  231. func (repo *Repository) getOwner(e Engine) (err error) {
  232. if repo.Owner != nil {
  233. return nil
  234. }
  235. repo.Owner, err = getUserByID(e, repo.OwnerID)
  236. return err
  237. }
  238. func (repo *Repository) GetOwner() error {
  239. return repo.getOwner(x)
  240. }
  241. func (repo *Repository) mustOwner(e Engine) *User {
  242. if err := repo.getOwner(e); err != nil {
  243. return &User{
  244. Name: "error",
  245. FullName: err.Error(),
  246. }
  247. }
  248. return repo.Owner
  249. }
  250. // ComposeMetas composes a map of metas for rendering external issue tracker URL.
  251. func (repo *Repository) ComposeMetas() map[string]string {
  252. if !repo.EnableExternalTracker {
  253. return nil
  254. } else if repo.ExternalMetas == nil {
  255. repo.ExternalMetas = map[string]string{
  256. "format": repo.ExternalTrackerFormat,
  257. "user": repo.MustOwner().Name,
  258. "repo": repo.Name,
  259. }
  260. switch repo.ExternalTrackerStyle {
  261. case markdown.ISSUE_NAME_STYLE_ALPHANUMERIC:
  262. repo.ExternalMetas["style"] = markdown.ISSUE_NAME_STYLE_ALPHANUMERIC
  263. default:
  264. repo.ExternalMetas["style"] = markdown.ISSUE_NAME_STYLE_NUMERIC
  265. }
  266. }
  267. return repo.ExternalMetas
  268. }
  269. // DeleteWiki removes the actual and local copy of repository wiki.
  270. func (repo *Repository) DeleteWiki() {
  271. wikiPaths := []string{repo.WikiPath(), repo.LocalWikiPath()}
  272. for _, wikiPath := range wikiPaths {
  273. RemoveAllWithNotice("Delete repository wiki", wikiPath)
  274. }
  275. }
  276. func (repo *Repository) getAssignees(e Engine) (_ []*User, err error) {
  277. if err = repo.getOwner(e); err != nil {
  278. return nil, err
  279. }
  280. accesses := make([]*Access, 0, 10)
  281. if err = e.Where("repo_id = ? AND mode >= ?", repo.ID, ACCESS_MODE_WRITE).Find(&accesses); err != nil {
  282. return nil, err
  283. }
  284. // Leave a seat for owner itself to append later, but if owner is an organization
  285. // and just waste 1 unit is cheaper than re-allocate memory once.
  286. users := make([]*User, 0, len(accesses)+1)
  287. if len(accesses) > 0 {
  288. userIDs := make([]int64, len(accesses))
  289. for i := 0; i < len(accesses); i++ {
  290. userIDs[i] = accesses[i].UserID
  291. }
  292. if err = e.In("id", userIDs).Find(&users); err != nil {
  293. return nil, err
  294. }
  295. }
  296. if !repo.Owner.IsOrganization() {
  297. users = append(users, repo.Owner)
  298. }
  299. return users, nil
  300. }
  301. // GetAssignees returns all users that have write access and can be assigned to issues
  302. // of the repository,
  303. func (repo *Repository) GetAssignees() (_ []*User, err error) {
  304. return repo.getAssignees(x)
  305. }
  306. // GetAssigneeByID returns the user that has write access of repository by given ID.
  307. func (repo *Repository) GetAssigneeByID(userID int64) (*User, error) {
  308. return GetAssigneeByID(repo, userID)
  309. }
  310. // GetMilestoneByID returns the milestone belongs to repository by given ID.
  311. func (repo *Repository) GetMilestoneByID(milestoneID int64) (*Milestone, error) {
  312. return GetMilestoneByRepoID(repo.ID, milestoneID)
  313. }
  314. // IssueStats returns number of open and closed repository issues by given filter mode.
  315. func (repo *Repository) IssueStats(uid int64, filterMode int, isPull bool) (int64, int64) {
  316. return GetRepoIssueStats(repo.ID, uid, filterMode, isPull)
  317. }
  318. func (repo *Repository) GetMirror() (err error) {
  319. repo.Mirror, err = GetMirror(repo.ID)
  320. return err
  321. }
  322. func (repo *Repository) GetBaseRepo() (err error) {
  323. if !repo.IsFork {
  324. return nil
  325. }
  326. repo.BaseRepo, err = GetRepositoryByID(repo.ForkID)
  327. return err
  328. }
  329. func (repo *Repository) repoPath(e Engine) string {
  330. return RepoPath(repo.mustOwner(e).Name, repo.Name)
  331. }
  332. func (repo *Repository) RepoPath() string {
  333. return repo.repoPath(x)
  334. }
  335. func (repo *Repository) GitConfigPath() string {
  336. return filepath.Join(repo.RepoPath(), "config")
  337. }
  338. func (repo *Repository) RelLink() string {
  339. return "/" + repo.FullName()
  340. }
  341. func (repo *Repository) Link() string {
  342. return setting.AppSubUrl + "/" + repo.FullName()
  343. }
  344. func (repo *Repository) ComposeCompareURL(oldCommitID, newCommitID string) string {
  345. return fmt.Sprintf("%s/%s/compare/%s...%s", repo.MustOwner().Name, repo.Name, oldCommitID, newCommitID)
  346. }
  347. func (repo *Repository) HasAccess(u *User) bool {
  348. has, _ := HasAccess(u, repo, ACCESS_MODE_READ)
  349. return has
  350. }
  351. func (repo *Repository) IsOwnedBy(userID int64) bool {
  352. return repo.OwnerID == userID
  353. }
  354. // CanBeForked returns true if repository meets the requirements of being forked.
  355. func (repo *Repository) CanBeForked() bool {
  356. return !repo.IsBare
  357. }
  358. // CanEnablePulls returns true if repository meets the requirements of accepting pulls.
  359. func (repo *Repository) CanEnablePulls() bool {
  360. return !repo.IsMirror
  361. }
  362. // AllowPulls returns true if repository meets the requirements of accepting pulls and has them enabled.
  363. func (repo *Repository) AllowsPulls() bool {
  364. return repo.CanEnablePulls() && repo.EnablePulls
  365. }
  366. // FIXME: should have a mutex to prevent producing same index for two issues that are created
  367. // closely enough.
  368. func (repo *Repository) NextIssueIndex() int64 {
  369. return int64(repo.NumIssues+repo.NumPulls) + 1
  370. }
  371. var (
  372. DescPattern = regexp.MustCompile(`https?://\S+`)
  373. )
  374. // DescriptionHtml does special handles to description and return HTML string.
  375. func (repo *Repository) DescriptionHtml() template.HTML {
  376. sanitize := func(s string) string {
  377. return fmt.Sprintf(`<a href="%[1]s" target="_blank">%[1]s</a>`, s)
  378. }
  379. return template.HTML(DescPattern.ReplaceAllStringFunc(markdown.Sanitizer.Sanitize(repo.Description), sanitize))
  380. }
  381. func (repo *Repository) LocalCopyPath() string {
  382. return path.Join(setting.AppDataPath, "tmp/local-rpeo", com.ToStr(repo.ID))
  383. }
  384. // UpdateLocalCopy pulls latest changes of given branch from repoPath to localPath.
  385. // It creates a new clone if local copy does not exist.
  386. // This function checks out target branch by default, it is safe to assume subsequent
  387. // operations are operating against target branch when caller has confidence for no race condition.
  388. func UpdateLocalCopyBranch(repoPath, localPath, branch string) error {
  389. if !com.IsExist(localPath) {
  390. if err := git.Clone(repoPath, localPath, git.CloneRepoOptions{
  391. Timeout: time.Duration(setting.Git.Timeout.Clone) * time.Second,
  392. Branch: branch,
  393. }); err != nil {
  394. return fmt.Errorf("git clone %s: %v", branch, err)
  395. }
  396. } else {
  397. if err := git.Checkout(localPath, git.CheckoutOptions{
  398. Branch: branch,
  399. }); err != nil {
  400. return fmt.Errorf("git checkout %s: %v", branch, err)
  401. }
  402. if err := git.Pull(localPath, git.PullRemoteOptions{
  403. Timeout: time.Duration(setting.Git.Timeout.Pull) * time.Second,
  404. Remote: "origin",
  405. Branch: branch,
  406. }); err != nil {
  407. return fmt.Errorf("git pull origin %s: %v", branch, err)
  408. }
  409. }
  410. return nil
  411. }
  412. // UpdateLocalCopyBranch makes sure local copy of repository in given branch is up-to-date.
  413. func (repo *Repository) UpdateLocalCopyBranch(branch string) error {
  414. return UpdateLocalCopyBranch(repo.RepoPath(), repo.LocalCopyPath(), branch)
  415. }
  416. // PatchPath returns corresponding patch file path of repository by given issue ID.
  417. func (repo *Repository) PatchPath(index int64) (string, error) {
  418. if err := repo.GetOwner(); err != nil {
  419. return "", err
  420. }
  421. return filepath.Join(RepoPath(repo.Owner.Name, repo.Name), "pulls", com.ToStr(index)+".patch"), nil
  422. }
  423. // SavePatch saves patch data to corresponding location by given issue ID.
  424. func (repo *Repository) SavePatch(index int64, patch []byte) error {
  425. patchPath, err := repo.PatchPath(index)
  426. if err != nil {
  427. return fmt.Errorf("PatchPath: %v", err)
  428. }
  429. os.MkdirAll(filepath.Dir(patchPath), os.ModePerm)
  430. if err = ioutil.WriteFile(patchPath, patch, 0644); err != nil {
  431. return fmt.Errorf("WriteFile: %v", err)
  432. }
  433. return nil
  434. }
  435. func isRepositoryExist(e Engine, u *User, repoName string) (bool, error) {
  436. has, err := e.Get(&Repository{
  437. OwnerID: u.ID,
  438. LowerName: strings.ToLower(repoName),
  439. })
  440. return has && com.IsDir(RepoPath(u.Name, repoName)), err
  441. }
  442. // IsRepositoryExist returns true if the repository with given name under user has already existed.
  443. func IsRepositoryExist(u *User, repoName string) (bool, error) {
  444. return isRepositoryExist(x, u, repoName)
  445. }
  446. // CloneLink represents different types of clone URLs of repository.
  447. type CloneLink struct {
  448. SSH string
  449. HTTPS string
  450. Git string
  451. }
  452. // ComposeHTTPSCloneURL returns HTTPS clone URL based on given owner and repository name.
  453. func ComposeHTTPSCloneURL(owner, repo string) string {
  454. return fmt.Sprintf("%s%s/%s.git", setting.AppUrl, owner, repo)
  455. }
  456. func (repo *Repository) cloneLink(isWiki bool) *CloneLink {
  457. repoName := repo.Name
  458. if isWiki {
  459. repoName += ".wiki"
  460. }
  461. repo.Owner = repo.MustOwner()
  462. cl := new(CloneLink)
  463. if setting.SSH.Port != 22 {
  464. cl.SSH = fmt.Sprintf("ssh://%s@%s:%d/%s/%s.git", setting.RunUser, setting.SSH.Domain, setting.SSH.Port, repo.Owner.Name, repoName)
  465. } else {
  466. cl.SSH = fmt.Sprintf("%s@%s:%s/%s.git", setting.RunUser, setting.SSH.Domain, repo.Owner.Name, repoName)
  467. }
  468. cl.HTTPS = ComposeHTTPSCloneURL(repo.Owner.Name, repoName)
  469. return cl
  470. }
  471. // CloneLink returns clone URLs of repository.
  472. func (repo *Repository) CloneLink() (cl *CloneLink) {
  473. return repo.cloneLink(false)
  474. }
  475. // Mirror represents a mirror information of repository.
  476. type Mirror struct {
  477. ID int64 `xorm:"pk autoincr"`
  478. RepoID int64
  479. Repo *Repository `xorm:"-"`
  480. Interval int // Hour.
  481. EnablePrune bool `xorm:"NOT NULL DEFAULT true"`
  482. Updated time.Time `xorm:"-"`
  483. UpdatedUnix int64
  484. NextUpdate time.Time `xorm:"-"`
  485. NextUpdateUnix int64
  486. address string `xorm:"-"`
  487. }
  488. func (m *Mirror) BeforeInsert() {
  489. m.NextUpdateUnix = m.NextUpdate.Unix()
  490. }
  491. func (m *Mirror) BeforeUpdate() {
  492. m.UpdatedUnix = time.Now().Unix()
  493. m.NextUpdateUnix = m.NextUpdate.Unix()
  494. }
  495. func (m *Mirror) AfterSet(colName string, _ xorm.Cell) {
  496. var err error
  497. switch colName {
  498. case "repo_id":
  499. m.Repo, err = GetRepositoryByID(m.RepoID)
  500. if err != nil {
  501. log.Error(3, "GetRepositoryByID[%d]: %v", m.ID, err)
  502. }
  503. case "updated_unix":
  504. m.Updated = time.Unix(m.UpdatedUnix, 0).Local()
  505. case "next_updated_unix":
  506. m.NextUpdate = time.Unix(m.NextUpdateUnix, 0).Local()
  507. }
  508. }
  509. func (m *Mirror) readAddress() {
  510. if len(m.address) > 0 {
  511. return
  512. }
  513. cfg, err := ini.Load(m.Repo.GitConfigPath())
  514. if err != nil {
  515. log.Error(4, "Load: %v", err)
  516. return
  517. }
  518. m.address = cfg.Section("remote \"origin\"").Key("url").Value()
  519. }
  520. // HandleCloneUserCredentials replaces user credentials from HTTP/HTTPS URL
  521. // with placeholder <credentials>.
  522. // It will fail for any other forms of clone addresses.
  523. func HandleCloneUserCredentials(url string, mosaics bool) string {
  524. i := strings.Index(url, "@")
  525. if i == -1 {
  526. return url
  527. }
  528. start := strings.Index(url, "://")
  529. if start == -1 {
  530. return url
  531. }
  532. if mosaics {
  533. return url[:start+3] + "<credentials>" + url[i:]
  534. }
  535. return url[:start+3] + url[i+1:]
  536. }
  537. // Address returns mirror address from Git repository config without credentials.
  538. func (m *Mirror) Address() string {
  539. m.readAddress()
  540. return HandleCloneUserCredentials(m.address, false)
  541. }
  542. // FullAddress returns mirror address from Git repository config.
  543. func (m *Mirror) FullAddress() string {
  544. m.readAddress()
  545. return m.address
  546. }
  547. // SaveAddress writes new address to Git repository config.
  548. func (m *Mirror) SaveAddress(addr string) error {
  549. configPath := m.Repo.GitConfigPath()
  550. cfg, err := ini.Load(configPath)
  551. if err != nil {
  552. return fmt.Errorf("Load: %v", err)
  553. }
  554. cfg.Section("remote \"origin\"").Key("url").SetValue(addr)
  555. return cfg.SaveToIndent(configPath, "\t")
  556. }
  557. func getMirror(e Engine, repoId int64) (*Mirror, error) {
  558. m := &Mirror{RepoID: repoId}
  559. has, err := e.Get(m)
  560. if err != nil {
  561. return nil, err
  562. } else if !has {
  563. return nil, ErrMirrorNotExist
  564. }
  565. return m, nil
  566. }
  567. // GetMirror returns mirror object by given repository ID.
  568. func GetMirror(repoId int64) (*Mirror, error) {
  569. return getMirror(x, repoId)
  570. }
  571. func updateMirror(e Engine, m *Mirror) error {
  572. _, err := e.Id(m.ID).AllCols().Update(m)
  573. return err
  574. }
  575. func UpdateMirror(m *Mirror) error {
  576. return updateMirror(x, m)
  577. }
  578. func DeleteMirrorByRepoID(repoID int64) error {
  579. _, err := x.Delete(&Mirror{RepoID: repoID})
  580. return err
  581. }
  582. func createUpdateHook(repoPath string) error {
  583. return git.SetUpdateHook(repoPath,
  584. fmt.Sprintf(_TPL_UPDATE_HOOK, setting.ScriptType, "\""+setting.AppPath+"\"", setting.CustomConf))
  585. }
  586. type MigrateRepoOptions struct {
  587. Name string
  588. Description string
  589. IsPrivate bool
  590. IsMirror bool
  591. RemoteAddr string
  592. }
  593. /*
  594. GitHub, GitLab, Gogs: *.wiki.git
  595. BitBucket: *.git/wiki
  596. */
  597. var commonWikiURLSuffixes = []string{".wiki.git", ".git/wiki"}
  598. // wikiRemoteURL returns accessible repository URL for wiki if exists.
  599. // Otherwise, it returns an empty string.
  600. func wikiRemoteURL(remote string) string {
  601. remote = strings.TrimSuffix(remote, ".git")
  602. for _, suffix := range commonWikiURLSuffixes {
  603. wikiURL := remote + suffix
  604. if git.IsRepoURLAccessible(wikiURL) {
  605. return wikiURL
  606. }
  607. }
  608. return ""
  609. }
  610. // MigrateRepository migrates a existing repository from other project hosting.
  611. func MigrateRepository(u *User, opts MigrateRepoOptions) (*Repository, error) {
  612. repo, err := CreateRepository(u, CreateRepoOptions{
  613. Name: opts.Name,
  614. Description: opts.Description,
  615. IsPrivate: opts.IsPrivate,
  616. IsMirror: opts.IsMirror,
  617. })
  618. if err != nil {
  619. return nil, err
  620. }
  621. // Clone to temprory path and do the init commit.
  622. tmpDir := filepath.Join(os.TempDir(), fmt.Sprintf("%d", time.Now().Nanosecond()))
  623. os.MkdirAll(tmpDir, os.ModePerm)
  624. repoPath := RepoPath(u.Name, opts.Name)
  625. wikiPath := WikiPath(u.Name, opts.Name)
  626. if u.IsOrganization() {
  627. t, err := u.GetOwnerTeam()
  628. if err != nil {
  629. return nil, err
  630. }
  631. repo.NumWatches = t.NumMembers
  632. } else {
  633. repo.NumWatches = 1
  634. }
  635. migrateTimeout := time.Duration(setting.Git.Timeout.Migrate) * time.Second
  636. os.RemoveAll(repoPath)
  637. if err = git.Clone(opts.RemoteAddr, repoPath, git.CloneRepoOptions{
  638. Mirror: true,
  639. Quiet: true,
  640. Timeout: migrateTimeout,
  641. }); err != nil {
  642. return repo, fmt.Errorf("Clone: %v", err)
  643. }
  644. wikiRemotePath := wikiRemoteURL(opts.RemoteAddr)
  645. if len(wikiRemotePath) > 0 {
  646. os.RemoveAll(wikiPath)
  647. if err = git.Clone(wikiRemotePath, wikiPath, git.CloneRepoOptions{
  648. Mirror: true,
  649. Quiet: true,
  650. Timeout: migrateTimeout,
  651. }); err != nil {
  652. log.Info("Clone wiki: %v", err)
  653. }
  654. }
  655. // Check if repository is empty.
  656. _, stderr, err := com.ExecCmdDir(repoPath, "git", "log", "-1")
  657. if err != nil {
  658. if strings.Contains(stderr, "fatal: bad default revision 'HEAD'") {
  659. repo.IsBare = true
  660. } else {
  661. return repo, fmt.Errorf("check bare: %v - %s", err, stderr)
  662. }
  663. }
  664. if !repo.IsBare {
  665. // Try to get HEAD branch and set it as default branch.
  666. gitRepo, err := git.OpenRepository(repoPath)
  667. if err != nil {
  668. return repo, fmt.Errorf("OpenRepository: %v", err)
  669. }
  670. headBranch, err := gitRepo.GetHEADBranch()
  671. if err != nil {
  672. return repo, fmt.Errorf("GetHEADBranch: %v", err)
  673. }
  674. if headBranch != nil {
  675. repo.DefaultBranch = headBranch.Name
  676. }
  677. }
  678. if opts.IsMirror {
  679. if _, err = x.InsertOne(&Mirror{
  680. RepoID: repo.ID,
  681. Interval: setting.Mirror.DefaultInterval,
  682. EnablePrune: true,
  683. NextUpdate: time.Now().Add(time.Duration(setting.Mirror.DefaultInterval) * time.Hour),
  684. }); err != nil {
  685. return repo, fmt.Errorf("InsertOne: %v", err)
  686. }
  687. repo.IsMirror = true
  688. return repo, UpdateRepository(repo, false)
  689. }
  690. return CleanUpMigrateInfo(repo)
  691. }
  692. // cleanUpMigrateGitConfig removes mirror info which prevents "push --all".
  693. // This also removes possible user credentials.
  694. func cleanUpMigrateGitConfig(configPath string) error {
  695. cfg, err := ini.Load(configPath)
  696. if err != nil {
  697. return fmt.Errorf("open config file: %v", err)
  698. }
  699. cfg.DeleteSection("remote \"origin\"")
  700. if err = cfg.SaveToIndent(configPath, "\t"); err != nil {
  701. return fmt.Errorf("save config file: %v", err)
  702. }
  703. return nil
  704. }
  705. // Finish migrating repository and/or wiki with things that don't need to be done for mirrors.
  706. func CleanUpMigrateInfo(repo *Repository) (*Repository, error) {
  707. repoPath := repo.RepoPath()
  708. if err := createUpdateHook(repoPath); err != nil {
  709. return repo, fmt.Errorf("createUpdateHook: %v", err)
  710. }
  711. if repo.HasWiki() {
  712. if err := createUpdateHook(repo.WikiPath()); err != nil {
  713. return repo, fmt.Errorf("createUpdateHook (wiki): %v", err)
  714. }
  715. }
  716. if err := cleanUpMigrateGitConfig(repo.GitConfigPath()); err != nil {
  717. return repo, fmt.Errorf("cleanUpMigrateGitConfig: %v", err)
  718. }
  719. if repo.HasWiki() {
  720. if err := cleanUpMigrateGitConfig(path.Join(repo.WikiPath(), "config")); err != nil {
  721. return repo, fmt.Errorf("cleanUpMigrateGitConfig (wiki): %v", err)
  722. }
  723. }
  724. return repo, UpdateRepository(repo, false)
  725. }
  726. // initRepoCommit temporarily changes with work directory.
  727. func initRepoCommit(tmpPath string, sig *git.Signature) (err error) {
  728. var stderr string
  729. if _, stderr, err = process.ExecDir(-1,
  730. tmpPath, fmt.Sprintf("initRepoCommit (git add): %s", tmpPath),
  731. "git", "add", "--all"); err != nil {
  732. return fmt.Errorf("git add: %s", stderr)
  733. }
  734. if _, stderr, err = process.ExecDir(-1,
  735. tmpPath, fmt.Sprintf("initRepoCommit (git commit): %s", tmpPath),
  736. "git", "commit", fmt.Sprintf("--author='%s <%s>'", sig.Name, sig.Email),
  737. "-m", "initial commit"); err != nil {
  738. return fmt.Errorf("git commit: %s", stderr)
  739. }
  740. if _, stderr, err = process.ExecDir(-1,
  741. tmpPath, fmt.Sprintf("initRepoCommit (git push): %s", tmpPath),
  742. "git", "push", "origin", "master"); err != nil {
  743. return fmt.Errorf("git push: %s", stderr)
  744. }
  745. return nil
  746. }
  747. type CreateRepoOptions struct {
  748. Name string
  749. Description string
  750. Gitignores string
  751. License string
  752. Readme string
  753. IsPrivate bool
  754. IsMirror bool
  755. AutoInit bool
  756. }
  757. func getRepoInitFile(tp, name string) ([]byte, error) {
  758. relPath := path.Join("conf", tp, strings.TrimLeft(name, "./"))
  759. // Use custom file when available.
  760. customPath := path.Join(setting.CustomPath, relPath)
  761. if com.IsFile(customPath) {
  762. return ioutil.ReadFile(customPath)
  763. }
  764. return bindata.Asset(relPath)
  765. }
  766. func prepareRepoCommit(repo *Repository, tmpDir, repoPath string, opts CreateRepoOptions) error {
  767. // Clone to temprory path and do the init commit.
  768. _, stderr, err := process.Exec(
  769. fmt.Sprintf("initRepository(git clone): %s", repoPath), "git", "clone", repoPath, tmpDir)
  770. if err != nil {
  771. return fmt.Errorf("git clone: %v - %s", err, stderr)
  772. }
  773. // README
  774. data, err := getRepoInitFile("readme", opts.Readme)
  775. if err != nil {
  776. return fmt.Errorf("getRepoInitFile[%s]: %v", opts.Readme, err)
  777. }
  778. cloneLink := repo.CloneLink()
  779. match := map[string]string{
  780. "Name": repo.Name,
  781. "Description": repo.Description,
  782. "CloneURL.SSH": cloneLink.SSH,
  783. "CloneURL.HTTPS": cloneLink.HTTPS,
  784. }
  785. if err = ioutil.WriteFile(filepath.Join(tmpDir, "README.md"),
  786. []byte(com.Expand(string(data), match)), 0644); err != nil {
  787. return fmt.Errorf("write README.md: %v", err)
  788. }
  789. // .gitignore
  790. if len(opts.Gitignores) > 0 {
  791. var buf bytes.Buffer
  792. names := strings.Split(opts.Gitignores, ",")
  793. for _, name := range names {
  794. data, err = getRepoInitFile("gitignore", name)
  795. if err != nil {
  796. return fmt.Errorf("getRepoInitFile[%s]: %v", name, err)
  797. }
  798. buf.WriteString("# ---> " + name + "\n")
  799. buf.Write(data)
  800. buf.WriteString("\n")
  801. }
  802. if buf.Len() > 0 {
  803. if err = ioutil.WriteFile(filepath.Join(tmpDir, ".gitignore"), buf.Bytes(), 0644); err != nil {
  804. return fmt.Errorf("write .gitignore: %v", err)
  805. }
  806. }
  807. }
  808. // LICENSE
  809. if len(opts.License) > 0 {
  810. data, err = getRepoInitFile("license", opts.License)
  811. if err != nil {
  812. return fmt.Errorf("getRepoInitFile[%s]: %v", opts.License, err)
  813. }
  814. if err = ioutil.WriteFile(filepath.Join(tmpDir, "LICENSE"), data, 0644); err != nil {
  815. return fmt.Errorf("write LICENSE: %v", err)
  816. }
  817. }
  818. return nil
  819. }
  820. // InitRepository initializes README and .gitignore if needed.
  821. func initRepository(e Engine, repoPath string, u *User, repo *Repository, opts CreateRepoOptions) (err error) {
  822. // Somehow the directory could exist.
  823. if com.IsExist(repoPath) {
  824. return fmt.Errorf("initRepository: path already exists: %s", repoPath)
  825. }
  826. // Init bare new repository.
  827. if err = git.InitRepository(repoPath, true); err != nil {
  828. return fmt.Errorf("InitRepository: %v", err)
  829. } else if err = createUpdateHook(repoPath); err != nil {
  830. return fmt.Errorf("createUpdateHook: %v", err)
  831. }
  832. tmpDir := filepath.Join(os.TempDir(), "gogs-"+repo.Name+"-"+com.ToStr(time.Now().Nanosecond()))
  833. // Initialize repository according to user's choice.
  834. if opts.AutoInit {
  835. os.MkdirAll(tmpDir, os.ModePerm)
  836. defer os.RemoveAll(tmpDir)
  837. if err = prepareRepoCommit(repo, tmpDir, repoPath, opts); err != nil {
  838. return fmt.Errorf("prepareRepoCommit: %v", err)
  839. }
  840. // Apply changes and commit.
  841. if err = initRepoCommit(tmpDir, u.NewGitSig()); err != nil {
  842. return fmt.Errorf("initRepoCommit: %v", err)
  843. }
  844. }
  845. // Re-fetch the repository from database before updating it (else it would
  846. // override changes that were done earlier with sql)
  847. if repo, err = getRepositoryByID(e, repo.ID); err != nil {
  848. return fmt.Errorf("getRepositoryByID: %v", err)
  849. }
  850. if !opts.AutoInit {
  851. repo.IsBare = true
  852. }
  853. repo.DefaultBranch = "master"
  854. if err = updateRepository(e, repo, false); err != nil {
  855. return fmt.Errorf("updateRepository: %v", err)
  856. }
  857. return nil
  858. }
  859. var (
  860. reservedRepoNames = []string{".", ".."}
  861. reservedRepoPatterns = []string{"*.git", "*.wiki"}
  862. )
  863. func IsUsableRepoName(name string) error {
  864. return isUsableName(reservedRepoNames, reservedRepoPatterns, name)
  865. }
  866. func createRepository(e *xorm.Session, u *User, repo *Repository) (err error) {
  867. if err = IsUsableRepoName(repo.Name); err != nil {
  868. return err
  869. }
  870. has, err := isRepositoryExist(e, u, repo.Name)
  871. if err != nil {
  872. return fmt.Errorf("IsRepositoryExist: %v", err)
  873. } else if has {
  874. return ErrRepoAlreadyExist{u.Name, repo.Name}
  875. }
  876. if _, err = e.Insert(repo); err != nil {
  877. return err
  878. }
  879. u.NumRepos++
  880. // Remember visibility preference.
  881. u.LastRepoVisibility = repo.IsPrivate
  882. if err = updateUser(e, u); err != nil {
  883. return fmt.Errorf("updateUser: %v", err)
  884. }
  885. // Give access to all members in owner team.
  886. if u.IsOrganization() {
  887. t, err := u.getOwnerTeam(e)
  888. if err != nil {
  889. return fmt.Errorf("getOwnerTeam: %v", err)
  890. } else if err = t.addRepository(e, repo); err != nil {
  891. return fmt.Errorf("addRepository: %v", err)
  892. }
  893. } else {
  894. // Organization automatically called this in addRepository method.
  895. if err = repo.recalculateAccesses(e); err != nil {
  896. return fmt.Errorf("recalculateAccesses: %v", err)
  897. }
  898. }
  899. if err = watchRepo(e, u.ID, repo.ID, true); err != nil {
  900. return fmt.Errorf("watchRepo: %v", err)
  901. } else if err = newRepoAction(e, u, repo); err != nil {
  902. return fmt.Errorf("newRepoAction: %v", err)
  903. }
  904. return nil
  905. }
  906. // CreateRepository creates a repository for given user or organization.
  907. func CreateRepository(u *User, opts CreateRepoOptions) (_ *Repository, err error) {
  908. if !u.CanCreateRepo() {
  909. return nil, ErrReachLimitOfRepo{u.MaxRepoCreation}
  910. }
  911. repo := &Repository{
  912. OwnerID: u.ID,
  913. Owner: u,
  914. Name: opts.Name,
  915. LowerName: strings.ToLower(opts.Name),
  916. Description: opts.Description,
  917. IsPrivate: opts.IsPrivate,
  918. EnableWiki: true,
  919. EnableIssues: true,
  920. EnablePulls: true,
  921. }
  922. sess := x.NewSession()
  923. defer sessionRelease(sess)
  924. if err = sess.Begin(); err != nil {
  925. return nil, err
  926. }
  927. if err = createRepository(sess, u, repo); err != nil {
  928. return nil, err
  929. }
  930. // No need for init mirror.
  931. if !opts.IsMirror {
  932. repoPath := RepoPath(u.Name, repo.Name)
  933. if err = initRepository(sess, repoPath, u, repo, opts); err != nil {
  934. if err2 := os.RemoveAll(repoPath); err2 != nil {
  935. log.Error(4, "initRepository: %v", err)
  936. return nil, fmt.Errorf(
  937. "delete repo directory %s/%s failed(2): %v", u.Name, repo.Name, err2)
  938. }
  939. return nil, fmt.Errorf("initRepository: %v", err)
  940. }
  941. _, stderr, err := process.ExecDir(-1,
  942. repoPath, fmt.Sprintf("CreateRepository(git update-server-info): %s", repoPath),
  943. "git", "update-server-info")
  944. if err != nil {
  945. return nil, errors.New("CreateRepository(git update-server-info): " + stderr)
  946. }
  947. }
  948. return repo, sess.Commit()
  949. }
  950. func countRepositories(userID int64, private bool) int64 {
  951. sess := x.Where("id > 0")
  952. if userID > 0 {
  953. sess.And("owner_id = ?", userID)
  954. }
  955. if !private {
  956. sess.And("is_private=?", false)
  957. }
  958. count, err := sess.Count(new(Repository))
  959. if err != nil {
  960. log.Error(4, "countRepositories: %v", err)
  961. }
  962. return count
  963. }
  964. // CountRepositories returns number of repositories.
  965. // Argument private only takes effect when it is false,
  966. // set it true to count all repositories.
  967. func CountRepositories(private bool) int64 {
  968. return countRepositories(-1, private)
  969. }
  970. // CountUserRepositories returns number of repositories user owns.
  971. // Argument private only takes effect when it is false,
  972. // set it true to count all repositories.
  973. func CountUserRepositories(userID int64, private bool) int64 {
  974. return countRepositories(userID, private)
  975. }
  976. func Repositories(page, pageSize int) (_ []*Repository, err error) {
  977. repos := make([]*Repository, 0, pageSize)
  978. return repos, x.Limit(pageSize, (page-1)*pageSize).Asc("id").Find(&repos)
  979. }
  980. // RepositoriesWithUsers returns number of repos in given page.
  981. func RepositoriesWithUsers(page, pageSize int) (_ []*Repository, err error) {
  982. repos, err := Repositories(page, pageSize)
  983. if err != nil {
  984. return nil, fmt.Errorf("Repositories: %v", err)
  985. }
  986. for i := range repos {
  987. if err = repos[i].GetOwner(); err != nil {
  988. return nil, err
  989. }
  990. }
  991. return repos, nil
  992. }
  993. // RepoPath returns repository path by given user and repository name.
  994. func RepoPath(userName, repoName string) string {
  995. return filepath.Join(UserPath(userName), strings.ToLower(repoName)+".git")
  996. }
  997. // TransferOwnership transfers all corresponding setting from old user to new one.
  998. func TransferOwnership(doer *User, newOwnerName string, repo *Repository) error {
  999. newOwner, err := GetUserByName(newOwnerName)
  1000. if err != nil {
  1001. return fmt.Errorf("get new owner '%s': %v", newOwnerName, err)
  1002. }
  1003. // Check if new owner has repository with same name.
  1004. has, err := IsRepositoryExist(newOwner, repo.Name)
  1005. if err != nil {
  1006. return fmt.Errorf("IsRepositoryExist: %v", err)
  1007. } else if has {
  1008. return ErrRepoAlreadyExist{newOwnerName, repo.Name}
  1009. }
  1010. sess := x.NewSession()
  1011. defer sessionRelease(sess)
  1012. if err = sess.Begin(); err != nil {
  1013. return fmt.Errorf("sess.Begin: %v", err)
  1014. }
  1015. owner := repo.Owner
  1016. // Note: we have to set value here to make sure recalculate accesses is based on
  1017. // new owner.
  1018. repo.OwnerID = newOwner.ID
  1019. repo.Owner = newOwner
  1020. // Update repository.
  1021. if _, err := sess.Id(repo.ID).Update(repo); err != nil {
  1022. return fmt.Errorf("update owner: %v", err)
  1023. }
  1024. // Remove redundant collaborators.
  1025. collaborators, err := repo.getCollaborators(sess)
  1026. if err != nil {
  1027. return fmt.Errorf("getCollaborators: %v", err)
  1028. }
  1029. // Dummy object.
  1030. collaboration := &Collaboration{RepoID: repo.ID}
  1031. for _, c := range collaborators {
  1032. collaboration.UserID = c.ID
  1033. if c.ID == newOwner.ID || newOwner.IsOrgMember(c.ID) {
  1034. if _, err = sess.Delete(collaboration); err != nil {
  1035. return fmt.Errorf("remove collaborator '%d': %v", c.ID, err)
  1036. }
  1037. }
  1038. }
  1039. // Remove old team-repository relations.
  1040. if owner.IsOrganization() {
  1041. if err = owner.getTeams(sess); err != nil {
  1042. return fmt.Errorf("getTeams: %v", err)
  1043. }
  1044. for _, t := range owner.Teams {
  1045. if !t.hasRepository(sess, repo.ID) {
  1046. continue
  1047. }
  1048. t.NumRepos--
  1049. if _, err := sess.Id(t.ID).AllCols().Update(t); err != nil {
  1050. return fmt.Errorf("decrease team repository count '%d': %v", t.ID, err)
  1051. }
  1052. }
  1053. if err = owner.removeOrgRepo(sess, repo.ID); err != nil {
  1054. return fmt.Errorf("removeOrgRepo: %v", err)
  1055. }
  1056. }
  1057. if newOwner.IsOrganization() {
  1058. t, err := newOwner.getOwnerTeam(sess)
  1059. if err != nil {
  1060. return fmt.Errorf("getOwnerTeam: %v", err)
  1061. } else if err = t.addRepository(sess, repo); err != nil {
  1062. return fmt.Errorf("add to owner team: %v", err)
  1063. }
  1064. } else {
  1065. // Organization called this in addRepository method.
  1066. if err = repo.recalculateAccesses(sess); err != nil {
  1067. return fmt.Errorf("recalculateAccesses: %v", err)
  1068. }
  1069. }
  1070. // Update repository count.
  1071. if _, err = sess.Exec("UPDATE `user` SET num_repos=num_repos+1 WHERE id=?", newOwner.ID); err != nil {
  1072. return fmt.Errorf("increase new owner repository count: %v", err)
  1073. } else if _, err = sess.Exec("UPDATE `user` SET num_repos=num_repos-1 WHERE id=?", owner.ID); err != nil {
  1074. return fmt.Errorf("decrease old owner repository count: %v", err)
  1075. }
  1076. if err = watchRepo(sess, newOwner.ID, repo.ID, true); err != nil {
  1077. return fmt.Errorf("watchRepo: %v", err)
  1078. } else if err = transferRepoAction(sess, doer, owner, repo); err != nil {
  1079. return fmt.Errorf("transferRepoAction: %v", err)
  1080. }
  1081. // Rename remote repository to new path and delete local copy.
  1082. os.MkdirAll(UserPath(newOwner.Name), os.ModePerm)
  1083. if err = os.Rename(RepoPath(owner.Name, repo.Name), RepoPath(newOwner.Name, repo.Name)); err != nil {
  1084. return fmt.Errorf("rename repository directory: %v", err)
  1085. }
  1086. RemoveAllWithNotice("Delete repository local copy", repo.LocalCopyPath())
  1087. // Rename remote wiki repository to new path and delete local copy.
  1088. wikiPath := WikiPath(owner.Name, repo.Name)
  1089. if com.IsExist(wikiPath) {
  1090. RemoveAllWithNotice("Delete repository wiki local copy", repo.LocalWikiPath())
  1091. if err = os.Rename(wikiPath, WikiPath(newOwner.Name, repo.Name)); err != nil {
  1092. return fmt.Errorf("rename repository wiki: %v", err)
  1093. }
  1094. }
  1095. return sess.Commit()
  1096. }
  1097. // ChangeRepositoryName changes all corresponding setting from old repository name to new one.
  1098. func ChangeRepositoryName(u *User, oldRepoName, newRepoName string) (err error) {
  1099. oldRepoName = strings.ToLower(oldRepoName)
  1100. newRepoName = strings.ToLower(newRepoName)
  1101. if err = IsUsableRepoName(newRepoName); err != nil {
  1102. return err
  1103. }
  1104. has, err := IsRepositoryExist(u, newRepoName)
  1105. if err != nil {
  1106. return fmt.Errorf("IsRepositoryExist: %v", err)
  1107. } else if has {
  1108. return ErrRepoAlreadyExist{u.Name, newRepoName}
  1109. }
  1110. repo, err := GetRepositoryByName(u.ID, oldRepoName)
  1111. if err != nil {
  1112. return fmt.Errorf("GetRepositoryByName: %v", err)
  1113. }
  1114. // Change repository directory name.
  1115. if err = os.Rename(repo.RepoPath(), RepoPath(u.Name, newRepoName)); err != nil {
  1116. return fmt.Errorf("rename repository directory: %v", err)
  1117. }
  1118. wikiPath := repo.WikiPath()
  1119. if com.IsExist(wikiPath) {
  1120. if err = os.Rename(wikiPath, WikiPath(u.Name, newRepoName)); err != nil {
  1121. return fmt.Errorf("rename repository wiki: %v", err)
  1122. }
  1123. RemoveAllWithNotice("Delete repository wiki local copy", repo.LocalWikiPath())
  1124. }
  1125. return nil
  1126. }
  1127. func getRepositoriesByForkID(e Engine, forkID int64) ([]*Repository, error) {
  1128. repos := make([]*Repository, 0, 10)
  1129. return repos, e.Where("fork_id=?", forkID).Find(&repos)
  1130. }
  1131. // GetRepositoriesByForkID returns all repositories with given fork ID.
  1132. func GetRepositoriesByForkID(forkID int64) ([]*Repository, error) {
  1133. return getRepositoriesByForkID(x, forkID)
  1134. }
  1135. func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err error) {
  1136. repo.LowerName = strings.ToLower(repo.Name)
  1137. if len(repo.Description) > 255 {
  1138. repo.Description = repo.Description[:255]
  1139. }
  1140. if len(repo.Website) > 255 {
  1141. repo.Website = repo.Website[:255]
  1142. }
  1143. if _, err = e.Id(repo.ID).AllCols().Update(repo); err != nil {
  1144. return fmt.Errorf("update: %v", err)
  1145. }
  1146. if visibilityChanged {
  1147. if err = repo.getOwner(e); err != nil {
  1148. return fmt.Errorf("getOwner: %v", err)
  1149. }
  1150. if repo.Owner.IsOrganization() {
  1151. // Organization repository need to recalculate access table when visivility is changed.
  1152. if err = repo.recalculateTeamAccesses(e, 0); err != nil {
  1153. return fmt.Errorf("recalculateTeamAccesses: %v", err)
  1154. }
  1155. }
  1156. // Create/Remove git-daemon-export-ok for git-daemon...
  1157. daemonExportFile := path.Join(repo.RepoPath(), `git-daemon-export-ok`)
  1158. if repo.IsPrivate && com.IsExist(daemonExportFile) {
  1159. if err = os.Remove(daemonExportFile); err != nil {
  1160. log.Error(4, "Failed to remove %s: %v", daemonExportFile, err)
  1161. }
  1162. } else if !repo.IsPrivate && !com.IsExist(daemonExportFile) {
  1163. if f, err := os.Create(daemonExportFile); err != nil {
  1164. log.Error(4, "Failed to create %s: %v", daemonExportFile, err)
  1165. } else {
  1166. f.Close()
  1167. }
  1168. }
  1169. forkRepos, err := getRepositoriesByForkID(e, repo.ID)
  1170. if err != nil {
  1171. return fmt.Errorf("getRepositoriesByForkID: %v", err)
  1172. }
  1173. for i := range forkRepos {
  1174. forkRepos[i].IsPrivate = repo.IsPrivate
  1175. if err = updateRepository(e, forkRepos[i], true); err != nil {
  1176. return fmt.Errorf("updateRepository[%d]: %v", forkRepos[i].ID, err)
  1177. }
  1178. }
  1179. }
  1180. return nil
  1181. }
  1182. func UpdateRepository(repo *Repository, visibilityChanged bool) (err error) {
  1183. sess := x.NewSession()
  1184. defer sessionRelease(sess)
  1185. if err = sess.Begin(); err != nil {
  1186. return err
  1187. }
  1188. if err = updateRepository(x, repo, visibilityChanged); err != nil {
  1189. return fmt.Errorf("updateRepository: %v", err)
  1190. }
  1191. return sess.Commit()
  1192. }
  1193. // DeleteRepository deletes a repository for a user or organization.
  1194. func DeleteRepository(uid, repoID int64) error {
  1195. repo := &Repository{ID: repoID, OwnerID: uid}
  1196. has, err := x.Get(repo)
  1197. if err != nil {
  1198. return err
  1199. } else if !has {
  1200. return ErrRepoNotExist{repoID, uid, ""}
  1201. }
  1202. // In case is a organization.
  1203. org, err := GetUserByID(uid)
  1204. if err != nil {
  1205. return err
  1206. }
  1207. if org.IsOrganization() {
  1208. if err = org.GetTeams(); err != nil {
  1209. return err
  1210. }
  1211. }
  1212. sess := x.NewSession()
  1213. defer sessionRelease(sess)
  1214. if err = sess.Begin(); err != nil {
  1215. return err
  1216. }
  1217. if org.IsOrganization() {
  1218. for _, t := range org.Teams {
  1219. if !t.hasRepository(sess, repoID) {
  1220. continue
  1221. } else if err = t.removeRepository(sess, repo, false); err != nil {
  1222. return err
  1223. }
  1224. }
  1225. }
  1226. if err = deleteBeans(sess,
  1227. &Repository{ID: repoID},
  1228. &Access{RepoID: repo.ID},
  1229. &Action{RepoID: repo.ID},
  1230. &Watch{RepoID: repoID},
  1231. &Star{RepoID: repoID},
  1232. &Mirror{RepoID: repoID},
  1233. &IssueUser{RepoID: repoID},
  1234. &Milestone{RepoID: repoID},
  1235. &Release{RepoID: repoID},
  1236. &Collaboration{RepoID: repoID},
  1237. &PullRequest{BaseRepoID: repoID},
  1238. ); err != nil {
  1239. return fmt.Errorf("deleteBeans: %v", err)
  1240. }
  1241. // Delete comments and attachments.
  1242. issues := make([]*Issue, 0, 25)
  1243. attachmentPaths := make([]string, 0, len(issues))
  1244. if err = sess.Where("repo_id=?", repoID).Find(&issues); err != nil {
  1245. return err
  1246. }
  1247. for i := range issues {
  1248. if _, err = sess.Delete(&Comment{IssueID: issues[i].ID}); err != nil {
  1249. return err
  1250. }
  1251. attachments := make([]*Attachment, 0, 5)
  1252. if err = sess.Where("issue_id=?", issues[i].ID).Find(&attachments); err != nil {
  1253. return err
  1254. }
  1255. for j := range attachments {
  1256. attachmentPaths = append(attachmentPaths, attachments[j].LocalPath())
  1257. }
  1258. if _, err = sess.Delete(&Attachment{IssueID: issues[i].ID}); err != nil {
  1259. return err
  1260. }
  1261. }
  1262. if _, err = sess.Delete(&Issue{RepoID: repoID}); err != nil {
  1263. return err
  1264. }
  1265. if repo.IsFork {
  1266. if _, err = sess.Exec("UPDATE `repository` SET num_forks=num_forks-1 WHERE id=?", repo.ForkID); err != nil {
  1267. return fmt.Errorf("decrease fork count: %v", err)
  1268. }
  1269. }
  1270. if _, err = sess.Exec("UPDATE `user` SET num_repos=num_repos-1 WHERE id=?", uid); err != nil {
  1271. return err
  1272. }
  1273. // Remove repository files.
  1274. repoPath := repo.repoPath(sess)
  1275. RemoveAllWithNotice("Delete repository files", repoPath)
  1276. repo.DeleteWiki()
  1277. // Remove attachment files.
  1278. for i := range attachmentPaths {
  1279. RemoveAllWithNotice("Delete attachment", attachmentPaths[i])
  1280. }
  1281. if err = sess.Commit(); err != nil {
  1282. return fmt.Errorf("Commit: %v", err)
  1283. }
  1284. if repo.NumForks > 0 {
  1285. if _, err = x.Exec("UPDATE `repository` SET fork_id=0,is_fork=? WHERE fork_id=?", false, repo.ID); err != nil {
  1286. log.Error(4, "reset 'fork_id' and 'is_fork': %v", err)
  1287. }
  1288. }
  1289. return nil
  1290. }
  1291. // GetRepositoryByRef returns a Repository specified by a GFM reference.
  1292. // See https://help.github.com/articles/writing-on-github#references for more information on the syntax.
  1293. func GetRepositoryByRef(ref string) (*Repository, error) {
  1294. n := strings.IndexByte(ref, byte('/'))
  1295. if n < 2 {
  1296. return nil, ErrInvalidReference
  1297. }
  1298. userName, repoName := ref[:n], ref[n+1:]
  1299. user, err := GetUserByName(userName)
  1300. if err != nil {
  1301. return nil, err
  1302. }
  1303. return GetRepositoryByName(user.ID, repoName)
  1304. }
  1305. // GetRepositoryByName returns the repository by given name under user if exists.
  1306. func GetRepositoryByName(ownerID int64, name string) (*Repository, error) {
  1307. repo := &Repository{
  1308. OwnerID: ownerID,
  1309. LowerName: strings.ToLower(name),
  1310. }
  1311. has, err := x.Get(repo)
  1312. if err != nil {
  1313. return nil, err
  1314. } else if !has {
  1315. return nil, ErrRepoNotExist{0, ownerID, name}
  1316. }
  1317. return repo, err
  1318. }
  1319. func getRepositoryByID(e Engine, id int64) (*Repository, error) {
  1320. repo := new(Repository)
  1321. has, err := e.Id(id).Get(repo)
  1322. if err != nil {
  1323. return nil, err
  1324. } else if !has {
  1325. return nil, ErrRepoNotExist{id, 0, ""}
  1326. }
  1327. return repo, nil
  1328. }
  1329. // GetRepositoryByID returns the repository by given id if exists.
  1330. func GetRepositoryByID(id int64) (*Repository, error) {
  1331. return getRepositoryByID(x, id)
  1332. }
  1333. // GetUserRepositories returns a list of repositories of given user.
  1334. func GetUserRepositories(userID int64, private bool, page, pageSize int) ([]*Repository, error) {
  1335. sess := x.Where("owner_id = ?", userID).Desc("updated_unix")
  1336. if !private {
  1337. sess.And("is_private=?", false)
  1338. }
  1339. if page <= 0 {
  1340. page = 1
  1341. }
  1342. sess.Limit(pageSize, (page-1)*pageSize)
  1343. repos := make([]*Repository, 0, pageSize)
  1344. return repos, sess.Find(&repos)
  1345. }
  1346. // GetUserRepositories returns a list of mirror repositories of given user.
  1347. func GetUserMirrorRepositories(userID int64) ([]*Repository, error) {
  1348. repos := make([]*Repository, 0, 10)
  1349. return repos, x.Where("owner_id = ?", userID).And("is_mirror = ?", true).Find(&repos)
  1350. }
  1351. // GetRecentUpdatedRepositories returns the list of repositories that are recently updated.
  1352. func GetRecentUpdatedRepositories(page, pageSize int) (repos []*Repository, err error) {
  1353. return repos, x.Limit(pageSize, (page-1)*pageSize).
  1354. Where("is_private=?", false).Limit(pageSize).Desc("updated_unix").Find(&repos)
  1355. }
  1356. func getRepositoryCount(e Engine, u *User) (int64, error) {
  1357. return x.Count(&Repository{OwnerID: u.ID})
  1358. }
  1359. // GetRepositoryCount returns the total number of repositories of user.
  1360. func GetRepositoryCount(u *User) (int64, error) {
  1361. return getRepositoryCount(x, u)
  1362. }
  1363. type SearchRepoOptions struct {
  1364. Keyword string
  1365. OwnerID int64
  1366. OrderBy string
  1367. Private bool // Include private repositories in results
  1368. Page int
  1369. PageSize int // Can be smaller than or equal to setting.ExplorePagingNum
  1370. }
  1371. // SearchRepositoryByName takes keyword and part of repository name to search,
  1372. // it returns results in given range and number of total results.
  1373. func SearchRepositoryByName(opts *SearchRepoOptions) (repos []*Repository, _ int64, _ error) {
  1374. if len(opts.Keyword) == 0 {
  1375. return repos, 0, nil
  1376. }
  1377. opts.Keyword = strings.ToLower(opts.Keyword)
  1378. if opts.Page <= 0 {
  1379. opts.Page = 1
  1380. }
  1381. repos = make([]*Repository, 0, opts.PageSize)
  1382. // Append conditions
  1383. sess := x.Where("LOWER(lower_name) LIKE ?", "%"+opts.Keyword+"%")
  1384. if opts.OwnerID > 0 {
  1385. sess.And("owner_id = ?", opts.OwnerID)
  1386. }
  1387. if !opts.Private {
  1388. sess.And("is_private=?", false)
  1389. }
  1390. var countSess xorm.Session
  1391. countSess = *sess
  1392. count, err := countSess.Count(new(Repository))
  1393. if err != nil {
  1394. return nil, 0, fmt.Errorf("Count: %v", err)
  1395. }
  1396. if len(opts.OrderBy) > 0 {
  1397. sess.OrderBy(opts.OrderBy)
  1398. }
  1399. return repos, count, sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize).Find(&repos)
  1400. }
  1401. // DeleteRepositoryArchives deletes all repositories' archives.
  1402. func DeleteRepositoryArchives() error {
  1403. return x.Where("id > 0").Iterate(new(Repository),
  1404. func(idx int, bean interface{}) error {
  1405. repo := bean.(*Repository)
  1406. return os.RemoveAll(filepath.Join(repo.RepoPath(), "archives"))
  1407. })
  1408. }
  1409. func gatherMissingRepoRecords() ([]*Repository, error) {
  1410. repos := make([]*Repository, 0, 10)
  1411. if err := x.Where("id > 0").Iterate(new(Repository),
  1412. func(idx int, bean interface{}) error {
  1413. repo := bean.(*Repository)
  1414. if !com.IsDir(repo.RepoPath()) {
  1415. repos = append(repos, repo)
  1416. }
  1417. return nil
  1418. }); err != nil {
  1419. if err2 := CreateRepositoryNotice(fmt.Sprintf("gatherMissingRepoRecords: %v", err)); err2 != nil {
  1420. return nil, fmt.Errorf("CreateRepositoryNotice: %v", err)
  1421. }
  1422. }
  1423. return repos, nil
  1424. }
  1425. // DeleteMissingRepositories deletes all repository records that lost Git files.
  1426. func DeleteMissingRepositories() error {
  1427. repos, err := gatherMissingRepoRecords()
  1428. if err != nil {
  1429. return fmt.Errorf("gatherMissingRepoRecords: %v", err)
  1430. }
  1431. if len(repos) == 0 {
  1432. return nil
  1433. }
  1434. for _, repo := range repos {
  1435. log.Trace("Deleting %d/%d...", repo.OwnerID, repo.ID)
  1436. if err := DeleteRepository(repo.OwnerID, repo.ID); err != nil {
  1437. if err2 := CreateRepositoryNotice(fmt.Sprintf("DeleteRepository [%d]: %v", repo.ID, err)); err2 != nil {
  1438. return fmt.Errorf("CreateRepositoryNotice: %v", err)
  1439. }
  1440. }
  1441. }
  1442. return nil
  1443. }
  1444. // ReinitMissingRepositories reinitializes all repository records that lost Git files.
  1445. func ReinitMissingRepositories() error {
  1446. repos, err := gatherMissingRepoRecords()
  1447. if err != nil {
  1448. return fmt.Errorf("gatherMissingRepoRecords: %v", err)
  1449. }
  1450. if len(repos) == 0 {
  1451. return nil
  1452. }
  1453. for _, repo := range repos {
  1454. log.Trace("Initializing %d/%d...", repo.OwnerID, repo.ID)
  1455. if err := git.InitRepository(repo.RepoPath(), true); err != nil {
  1456. if err2 := CreateRepositoryNotice(fmt.Sprintf("InitRepository [%d]: %v", repo.ID, err)); err2 != nil {
  1457. return fmt.Errorf("CreateRepositoryNotice: %v", err)
  1458. }
  1459. }
  1460. }
  1461. return nil
  1462. }
  1463. // RewriteRepositoryUpdateHook rewrites all repositories' update hook.
  1464. func RewriteRepositoryUpdateHook() error {
  1465. return x.Where("id > 0").Iterate(new(Repository),
  1466. func(idx int, bean interface{}) error {
  1467. repo := bean.(*Repository)
  1468. return createUpdateHook(repo.RepoPath())
  1469. })
  1470. }
  1471. // Prevent duplicate running tasks.
  1472. var taskStatusTable = sync.NewStatusTable()
  1473. const (
  1474. _MIRROR_UPDATE = "mirror_update"
  1475. _GIT_FSCK = "git_fsck"
  1476. _CHECK_REPOs = "check_repos"
  1477. )
  1478. // MirrorUpdate checks and updates mirror repositories.
  1479. func MirrorUpdate() {
  1480. if taskStatusTable.IsRunning(_MIRROR_UPDATE) {
  1481. return
  1482. }
  1483. taskStatusTable.Start(_MIRROR_UPDATE)
  1484. defer taskStatusTable.Stop(_MIRROR_UPDATE)
  1485. log.Trace("Doing: MirrorUpdate")
  1486. mirrors := make([]*Mirror, 0, 10)
  1487. if err := x.Where("next_update_unix<=?", time.Now().Unix()).Iterate(new(Mirror), func(idx int, bean interface{}) error {
  1488. m := bean.(*Mirror)
  1489. if m.Repo == nil {
  1490. log.Error(4, "Disconnected mirror repository found: %d", m.ID)
  1491. return nil
  1492. }
  1493. repoPath := m.Repo.RepoPath()
  1494. wikiPath := m.Repo.WikiPath()
  1495. timeout := time.Duration(setting.Git.Timeout.Mirror) * time.Second
  1496. gitArgs := []string{"remote", "update"}
  1497. if m.EnablePrune {
  1498. gitArgs = append(gitArgs, "--prune")
  1499. }
  1500. if _, stderr, err := process.ExecDir(
  1501. timeout, repoPath, fmt.Sprintf("MirrorUpdate: %s", repoPath),
  1502. "git", gitArgs...); err != nil {
  1503. desc := fmt.Sprintf("Fail to update mirror repository(%s): %s", repoPath, stderr)
  1504. log.Error(4, desc)
  1505. if err = CreateRepositoryNotice(desc); err != nil {
  1506. log.Error(4, "CreateRepositoryNotice: %v", err)
  1507. }
  1508. return nil
  1509. }
  1510. if m.Repo.HasWiki() {
  1511. if _, stderr, err := process.ExecDir(
  1512. timeout, wikiPath, fmt.Sprintf("MirrorUpdate: %s", wikiPath),
  1513. "git", "remote", "update", "--prune"); err != nil {
  1514. desc := fmt.Sprintf("Fail to update mirror wiki repository(%s): %s", wikiPath, stderr)
  1515. log.Error(4, desc)
  1516. if err = CreateRepositoryNotice(desc); err != nil {
  1517. log.Error(4, "CreateRepositoryNotice: %v", err)
  1518. }
  1519. return nil
  1520. }
  1521. }
  1522. m.NextUpdate = time.Now().Add(time.Duration(m.Interval) * time.Hour)
  1523. mirrors = append(mirrors, m)
  1524. return nil
  1525. }); err != nil {
  1526. log.Error(4, "MirrorUpdate: %v", err)
  1527. }
  1528. for i := range mirrors {
  1529. if err := UpdateMirror(mirrors[i]); err != nil {
  1530. log.Error(4, "UpdateMirror[%d]: %v", mirrors[i].ID, err)
  1531. }
  1532. }
  1533. }
  1534. // GitFsck calls 'git fsck' to check repository health.
  1535. func GitFsck() {
  1536. if taskStatusTable.IsRunning(_GIT_FSCK) {
  1537. return
  1538. }
  1539. taskStatusTable.Start(_GIT_FSCK)
  1540. defer taskStatusTable.Stop(_GIT_FSCK)
  1541. log.Trace("Doing: GitFsck")
  1542. if err := x.Where("id>0").Iterate(new(Repository),
  1543. func(idx int, bean interface{}) error {
  1544. repo := bean.(*Repository)
  1545. repoPath := repo.RepoPath()
  1546. if err := git.Fsck(repoPath, setting.Cron.RepoHealthCheck.Timeout, setting.Cron.RepoHealthCheck.Args...); err != nil {
  1547. desc := fmt.Sprintf("Fail to health check repository (%s): %v", repoPath, err)
  1548. log.Warn(desc)
  1549. if err = CreateRepositoryNotice(desc); err != nil {
  1550. log.Error(4, "CreateRepositoryNotice: %v", err)
  1551. }
  1552. }
  1553. return nil
  1554. }); err != nil {
  1555. log.Error(4, "GitFsck: %v", err)
  1556. }
  1557. }
  1558. func GitGcRepos() error {
  1559. args := append([]string{"gc"}, setting.Git.GCArgs...)
  1560. return x.Where("id > 0").Iterate(new(Repository),
  1561. func(idx int, bean interface{}) error {
  1562. repo := bean.(*Repository)
  1563. if err := repo.GetOwner(); err != nil {
  1564. return err
  1565. }
  1566. _, stderr, err := process.ExecDir(
  1567. time.Duration(setting.Git.Timeout.GC)*time.Second,
  1568. RepoPath(repo.Owner.Name, repo.Name), "Repository garbage collection",
  1569. "git", args...)
  1570. if err != nil {
  1571. return fmt.Errorf("%v: %v", err, stderr)
  1572. }
  1573. return nil
  1574. })
  1575. }
  1576. type repoChecker struct {
  1577. querySQL, correctSQL string
  1578. desc string
  1579. }
  1580. func repoStatsCheck(checker *repoChecker) {
  1581. results, err := x.Query(checker.querySQL)
  1582. if err != nil {
  1583. log.Error(4, "Select %s: %v", checker.desc, err)
  1584. return
  1585. }
  1586. for _, result := range results {
  1587. id := com.StrTo(result["id"]).MustInt64()
  1588. log.Trace("Updating %s: %d", checker.desc, id)
  1589. _, err = x.Exec(checker.correctSQL, id, id)
  1590. if err != nil {
  1591. log.Error(4, "Update %s[%d]: %v", checker.desc, id, err)
  1592. }
  1593. }
  1594. }
  1595. func CheckRepoStats() {
  1596. if taskStatusTable.IsRunning(_CHECK_REPOs) {
  1597. return
  1598. }
  1599. taskStatusTable.Start(_CHECK_REPOs)
  1600. defer taskStatusTable.Stop(_CHECK_REPOs)
  1601. log.Trace("Doing: CheckRepoStats")
  1602. checkers := []*repoChecker{
  1603. // Repository.NumWatches
  1604. {
  1605. "SELECT repo.id FROM `repository` repo WHERE repo.num_watches!=(SELECT COUNT(*) FROM `watch` WHERE repo_id=repo.id)",
  1606. "UPDATE `repository` SET num_watches=(SELECT COUNT(*) FROM `watch` WHERE repo_id=?) WHERE id=?",
  1607. "repository count 'num_watches'",
  1608. },
  1609. // Repository.NumStars
  1610. {
  1611. "SELECT repo.id FROM `repository` repo WHERE repo.num_stars!=(SELECT COUNT(*) FROM `star` WHERE repo_id=repo.id)",
  1612. "UPDATE `repository` SET num_stars=(SELECT COUNT(*) FROM `star` WHERE repo_id=?) WHERE id=?",
  1613. "repository count 'num_stars'",
  1614. },
  1615. // Label.NumIssues
  1616. {
  1617. "SELECT label.id FROM `label` WHERE label.num_issues!=(SELECT COUNT(*) FROM `issue_label` WHERE label_id=label.id)",
  1618. "UPDATE `label` SET num_issues=(SELECT COUNT(*) FROM `issue_label` WHERE label_id=?) WHERE id=?",
  1619. "label count 'num_issues'",
  1620. },
  1621. // User.NumRepos
  1622. {
  1623. "SELECT `user`.id FROM `user` WHERE `user`.num_repos!=(SELECT COUNT(*) FROM `repository` WHERE owner_id=`user`.id)",
  1624. "UPDATE `user` SET num_repos=(SELECT COUNT(*) FROM `repository` WHERE owner_id=?) WHERE id=?",
  1625. "user count 'num_repos'",
  1626. },
  1627. // Issue.NumComments
  1628. {
  1629. "SELECT `issue`.id FROM `issue` WHERE `issue`.num_comments!=(SELECT COUNT(*) FROM `comment` WHERE issue_id=`issue`.id AND type=0)",
  1630. "UPDATE `issue` SET num_comments=(SELECT COUNT(*) FROM `comment` WHERE issue_id=? AND type=0) WHERE id=?",
  1631. "issue count 'num_comments'",
  1632. },
  1633. }
  1634. for i := range checkers {
  1635. repoStatsCheck(checkers[i])
  1636. }
  1637. // ***** START: Repository.NumClosedIssues *****
  1638. desc := "repository count 'num_closed_issues'"
  1639. results, err := x.Query("SELECT repo.id FROM `repository` repo WHERE repo.num_closed_issues!=(SELECT COUNT(*) FROM `issue` WHERE repo_id=repo.id AND is_closed=? AND is_pull=?)", true, false)
  1640. if err != nil {
  1641. log.Error(4, "Select %s: %v", desc, err)
  1642. } else {
  1643. for _, result := range results {
  1644. id := com.StrTo(result["id"]).MustInt64()
  1645. log.Trace("Updating %s: %d", desc, id)
  1646. _, err = x.Exec("UPDATE `repository` SET num_closed_issues=(SELECT COUNT(*) FROM `issue` WHERE repo_id=? AND is_closed=? AND is_pull=?) WHERE id=?", id, true, false, id)
  1647. if err != nil {
  1648. log.Error(4, "Update %s[%d]: %v", desc, id, err)
  1649. }
  1650. }
  1651. }
  1652. // ***** END: Repository.NumClosedIssues *****
  1653. // FIXME: use checker when stop supporting old fork repo format.
  1654. // ***** START: Repository.NumForks *****
  1655. results, err = x.Query("SELECT repo.id FROM `repository` repo WHERE repo.num_forks!=(SELECT COUNT(*) FROM `repository` WHERE fork_id=repo.id)")
  1656. if err != nil {
  1657. log.Error(4, "Select repository count 'num_forks': %v", err)
  1658. } else {
  1659. for _, result := range results {
  1660. id := com.StrTo(result["id"]).MustInt64()
  1661. log.Trace("Updating repository count 'num_forks': %d", id)
  1662. repo, err := GetRepositoryByID(id)
  1663. if err != nil {
  1664. log.Error(4, "GetRepositoryByID[%d]: %v", id, err)
  1665. continue
  1666. }
  1667. rawResult, err := x.Query("SELECT COUNT(*) FROM `repository` WHERE fork_id=?", repo.ID)
  1668. if err != nil {
  1669. log.Error(4, "Select count of forks[%d]: %v", repo.ID, err)
  1670. continue
  1671. }
  1672. repo.NumForks = int(parseCountResult(rawResult))
  1673. if err = UpdateRepository(repo, false); err != nil {
  1674. log.Error(4, "UpdateRepository[%d]: %v", id, err)
  1675. continue
  1676. }
  1677. }
  1678. }
  1679. // ***** END: Repository.NumForks *****
  1680. }
  1681. type RepositoryList []*Repository
  1682. func (repos RepositoryList) loadAttributes(e Engine) error {
  1683. if len(repos) == 0 {
  1684. return nil
  1685. }
  1686. // Load owners.
  1687. set := make(map[int64]*User)
  1688. for i := range repos {
  1689. set[repos[i].OwnerID] = nil
  1690. }
  1691. userIDs := make([]int64, 0, len(set))
  1692. for userID := range set {
  1693. userIDs = append(userIDs, userID)
  1694. }
  1695. users := make([]*User, 0, len(userIDs))
  1696. if err := e.Where("id > 0").In("id", userIDs).Find(&users); err != nil {
  1697. return fmt.Errorf("find users: %v", err)
  1698. }
  1699. for i := range users {
  1700. set[users[i].ID] = users[i]
  1701. }
  1702. for i := range repos {
  1703. repos[i].Owner = set[repos[i].OwnerID]
  1704. }
  1705. return nil
  1706. }
  1707. func (repos RepositoryList) LoadAttributes() error {
  1708. return repos.loadAttributes(x)
  1709. }
  1710. type MirrorRepositoryList []*Repository
  1711. func (repos MirrorRepositoryList) loadAttributes(e Engine) error {
  1712. if len(repos) == 0 {
  1713. return nil
  1714. }
  1715. // Load mirrors.
  1716. repoIDs := make([]int64, 0, len(repos))
  1717. for i := range repos {
  1718. if !repos[i].IsMirror {
  1719. continue
  1720. }
  1721. repoIDs = append(repoIDs, repos[i].ID)
  1722. }
  1723. mirrors := make([]*Mirror, 0, len(repoIDs))
  1724. if err := e.Where("id > 0").In("repo_id", repoIDs).Find(&mirrors); err != nil {
  1725. return fmt.Errorf("find mirrors: %v", err)
  1726. }
  1727. set := make(map[int64]*Mirror)
  1728. for i := range mirrors {
  1729. set[mirrors[i].RepoID] = mirrors[i]
  1730. }
  1731. for i := range repos {
  1732. repos[i].Mirror = set[repos[i].ID]
  1733. }
  1734. return nil
  1735. }
  1736. func (repos MirrorRepositoryList) LoadAttributes() error {
  1737. return repos.loadAttributes(x)
  1738. }
  1739. // __ __ __ .__
  1740. // / \ / \_____ _/ |_ ____ | |__
  1741. // \ \/\/ /\__ \\ __\/ ___\| | \
  1742. // \ / / __ \| | \ \___| Y \
  1743. // \__/\ / (____ /__| \___ >___| /
  1744. // \/ \/ \/ \/
  1745. // Watch is connection request for receiving repository notification.
  1746. type Watch struct {
  1747. ID int64 `xorm:"pk autoincr"`
  1748. UserID int64 `xorm:"UNIQUE(watch)"`
  1749. RepoID int64 `xorm:"UNIQUE(watch)"`
  1750. }
  1751. func isWatching(e Engine, userID, repoID int64) bool {
  1752. has, _ := e.Get(&Watch{0, userID, repoID})
  1753. return has
  1754. }
  1755. // IsWatching checks if user has watched given repository.
  1756. func IsWatching(userID, repoID int64) bool {
  1757. return isWatching(x, userID, repoID)
  1758. }
  1759. func watchRepo(e Engine, userID, repoID int64, watch bool) (err error) {
  1760. if watch {
  1761. if isWatching(e, userID, repoID) {
  1762. return nil
  1763. }
  1764. if _, err = e.Insert(&Watch{RepoID: repoID, UserID: userID}); err != nil {
  1765. return err
  1766. }
  1767. _, err = e.Exec("UPDATE `repository` SET num_watches = num_watches + 1 WHERE id = ?", repoID)
  1768. } else {
  1769. if !isWatching(e, userID, repoID) {
  1770. return nil
  1771. }
  1772. if _, err = e.Delete(&Watch{0, userID, repoID}); err != nil {
  1773. return err
  1774. }
  1775. _, err = e.Exec("UPDATE `repository` SET num_watches = num_watches - 1 WHERE id = ?", repoID)
  1776. }
  1777. return err
  1778. }
  1779. // Watch or unwatch repository.
  1780. func WatchRepo(userID, repoID int64, watch bool) (err error) {
  1781. return watchRepo(x, userID, repoID, watch)
  1782. }
  1783. func getWatchers(e Engine, repoID int64) ([]*Watch, error) {
  1784. watches := make([]*Watch, 0, 10)
  1785. return watches, e.Find(&watches, &Watch{RepoID: repoID})
  1786. }
  1787. // GetWatchers returns all watchers of given repository.
  1788. func GetWatchers(repoID int64) ([]*Watch, error) {
  1789. return getWatchers(x, repoID)
  1790. }
  1791. // Repository.GetWatchers returns range of users watching given repository.
  1792. func (repo *Repository) GetWatchers(page int) ([]*User, error) {
  1793. users := make([]*User, 0, ItemsPerPage)
  1794. sess := x.Limit(ItemsPerPage, (page-1)*ItemsPerPage).Where("watch.repo_id=?", repo.ID)
  1795. if setting.UsePostgreSQL {
  1796. sess = sess.Join("LEFT", "watch", `"user".id=watch.user_id`)
  1797. } else {
  1798. sess = sess.Join("LEFT", "watch", "user.id=watch.user_id")
  1799. }
  1800. return users, sess.Find(&users)
  1801. }
  1802. func notifyWatchers(e Engine, act *Action) error {
  1803. // Add feeds for user self and all watchers.
  1804. watches, err := getWatchers(e, act.RepoID)
  1805. if err != nil {
  1806. return fmt.Errorf("get watchers: %v", err)
  1807. }
  1808. // Add feed for actioner.
  1809. act.UserID = act.ActUserID
  1810. if _, err = e.InsertOne(act); err != nil {
  1811. return fmt.Errorf("insert new actioner: %v", err)
  1812. }
  1813. for i := range watches {
  1814. if act.ActUserID == watches[i].UserID {
  1815. continue
  1816. }
  1817. act.ID = 0
  1818. act.UserID = watches[i].UserID
  1819. if _, err = e.InsertOne(act); err != nil {
  1820. return fmt.Errorf("insert new action: %v", err)
  1821. }
  1822. }
  1823. return nil
  1824. }
  1825. // NotifyWatchers creates batch of actions for every watcher.
  1826. func NotifyWatchers(act *Action) error {
  1827. return notifyWatchers(x, act)
  1828. }
  1829. // _________ __
  1830. // / _____// |______ _______
  1831. // \_____ \\ __\__ \\_ __ \
  1832. // / \| | / __ \| | \/
  1833. // /_______ /|__| (____ /__|
  1834. // \/ \/
  1835. type Star struct {
  1836. ID int64 `xorm:"pk autoincr"`
  1837. UID int64 `xorm:"UNIQUE(s)"`
  1838. RepoID int64 `xorm:"UNIQUE(s)"`
  1839. }
  1840. // Star or unstar repository.
  1841. func StarRepo(userID, repoID int64, star bool) (err error) {
  1842. if star {
  1843. if IsStaring(userID, repoID) {
  1844. return nil
  1845. }
  1846. if _, err = x.Insert(&Star{UID: userID, RepoID: repoID}); err != nil {
  1847. return err
  1848. } else if _, err = x.Exec("UPDATE `repository` SET num_stars = num_stars + 1 WHERE id = ?", repoID); err != nil {
  1849. return err
  1850. }
  1851. _, err = x.Exec("UPDATE `user` SET num_stars = num_stars + 1 WHERE id = ?", userID)
  1852. } else {
  1853. if !IsStaring(userID, repoID) {
  1854. return nil
  1855. }
  1856. if _, err = x.Delete(&Star{0, userID, repoID}); err != nil {
  1857. return err
  1858. } else if _, err = x.Exec("UPDATE `repository` SET num_stars = num_stars - 1 WHERE id = ?", repoID); err != nil {
  1859. return err
  1860. }
  1861. _, err = x.Exec("UPDATE `user` SET num_stars = num_stars - 1 WHERE id = ?", userID)
  1862. }
  1863. return err
  1864. }
  1865. // IsStaring checks if user has starred given repository.
  1866. func IsStaring(userID, repoID int64) bool {
  1867. has, _ := x.Get(&Star{0, userID, repoID})
  1868. return has
  1869. }
  1870. func (repo *Repository) GetStargazers(page int) ([]*User, error) {
  1871. users := make([]*User, 0, ItemsPerPage)
  1872. sess := x.Limit(ItemsPerPage, (page-1)*ItemsPerPage).Where("star.repo_id=?", repo.ID)
  1873. if setting.UsePostgreSQL {
  1874. sess = sess.Join("LEFT", "star", `"user".id=star.uid`)
  1875. } else {
  1876. sess = sess.Join("LEFT", "star", "user.id=star.uid")
  1877. }
  1878. return users, sess.Find(&users)
  1879. }
  1880. // ___________ __
  1881. // \_ _____/__________| | __
  1882. // | __)/ _ \_ __ \ |/ /
  1883. // | \( <_> ) | \/ <
  1884. // \___ / \____/|__| |__|_ \
  1885. // \/ \/
  1886. // HasForkedRepo checks if given user has already forked a repository with given ID.
  1887. func HasForkedRepo(ownerID, repoID int64) (*Repository, bool) {
  1888. repo := new(Repository)
  1889. has, _ := x.Where("owner_id=? AND fork_id=?", ownerID, repoID).Get(repo)
  1890. return repo, has
  1891. }
  1892. func ForkRepository(u *User, oldRepo *Repository, name, desc string) (_ *Repository, err error) {
  1893. repo := &Repository{
  1894. OwnerID: u.ID,
  1895. Owner: u,
  1896. Name: name,
  1897. LowerName: strings.ToLower(name),
  1898. Description: desc,
  1899. DefaultBranch: oldRepo.DefaultBranch,
  1900. IsPrivate: oldRepo.IsPrivate,
  1901. IsFork: true,
  1902. ForkID: oldRepo.ID,
  1903. }
  1904. sess := x.NewSession()
  1905. defer sessionRelease(sess)
  1906. if err = sess.Begin(); err != nil {
  1907. return nil, err
  1908. }
  1909. if err = createRepository(sess, u, repo); err != nil {
  1910. return nil, err
  1911. }
  1912. if _, err = sess.Exec("UPDATE `repository` SET num_forks=num_forks+1 WHERE id=?", oldRepo.ID); err != nil {
  1913. return nil, err
  1914. }
  1915. repoPath := RepoPath(u.Name, repo.Name)
  1916. _, stderr, err := process.ExecTimeout(10*time.Minute,
  1917. fmt.Sprintf("ForkRepository(git clone): %s/%s", u.Name, repo.Name),
  1918. "git", "clone", "--bare", oldRepo.RepoPath(), repoPath)
  1919. if err != nil {
  1920. return nil, fmt.Errorf("git clone: %v", stderr)
  1921. }
  1922. _, stderr, err = process.ExecDir(-1,
  1923. repoPath, fmt.Sprintf("ForkRepository(git update-server-info): %s", repoPath),
  1924. "git", "update-server-info")
  1925. if err != nil {
  1926. return nil, fmt.Errorf("git update-server-info: %v", err)
  1927. }
  1928. if err = createUpdateHook(repoPath); err != nil {
  1929. return nil, fmt.Errorf("createUpdateHook: %v", err)
  1930. }
  1931. return repo, sess.Commit()
  1932. }
  1933. func (repo *Repository) GetForks() ([]*Repository, error) {
  1934. forks := make([]*Repository, 0, repo.NumForks)
  1935. return forks, x.Find(&forks, &Repository{ForkID: repo.ID})
  1936. }
  1937. // ____ ___ .__ .___ ___________.___.__
  1938. // | | \______ | | _________ __| _/ \_ _____/| | | ____ ______
  1939. // | | /\____ \| | / _ \__ \ / __ | | __) | | | _/ __ \ / ___/
  1940. // | | / | |_> > |_( <_> ) __ \_/ /_/ | | \ | | |_\ ___/ \___ \
  1941. // |______/ | __/|____/\____(____ /\____ | \___ / |___|____/\___ >____ >
  1942. // |__| \/ \/ \/ \/ \/
  1943. //
  1944. // uploadRepoFiles uploads new files to repository.
  1945. func (repo *Repository) UploadRepoFiles(doer *User, oldBranchName, branchName, treePath, message string, uuids []string) (err error) {
  1946. repoWorkingPool.CheckIn(com.ToStr(repo.ID))
  1947. defer repoWorkingPool.CheckOut(com.ToStr(repo.ID))
  1948. localPath := repo.LocalCopyPath()
  1949. if err = discardLocalRepoBranchChanges(localPath, oldBranchName); err != nil {
  1950. return fmt.Errorf("discardLocalRepoChanges: %v", err)
  1951. } else if err = repo.UpdateLocalCopyBranch(oldBranchName); err != nil {
  1952. return fmt.Errorf("UpdateLocalCopyBranch: %v", err)
  1953. }
  1954. if oldBranchName != branchName {
  1955. repo.CheckoutNewBranch(oldBranchName, branchName)
  1956. }
  1957. dirPath := path.Join(localPath, treePath)
  1958. os.MkdirAll(dirPath, os.ModePerm)
  1959. // Copy uploaded files into repository.
  1960. for _, uuid := range uuids {
  1961. upload, err := getUpload(uuid, doer.ID, repo.ID)
  1962. if err != nil {
  1963. if IsErrUploadNotExist(err) {
  1964. continue
  1965. }
  1966. return fmt.Errorf("getUpload[%s]: %v", uuid, err)
  1967. }
  1968. uuidPath := upload.LocalPath()
  1969. filePath := dirPath + "/" + upload.Name
  1970. if err := os.Rename(uuidPath, filePath); err != nil {
  1971. DeleteUpload(upload, true)
  1972. return fmt.Errorf("Rename[%s -> %s]: %v", uuidPath, filePath, err)
  1973. }
  1974. DeleteUpload(upload, false) // false because we have moved the file
  1975. }
  1976. if len(message) == 0 {
  1977. message = "Add files to '" + treePath + "'"
  1978. }
  1979. if err = git.AddChanges(localPath, true); err != nil {
  1980. return fmt.Errorf("AddChanges: %v", err)
  1981. } else if err = git.CommitChanges(localPath, message, doer.NewGitSig()); err != nil {
  1982. return fmt.Errorf("CommitChanges: %v", err)
  1983. } else if err = git.Push(localPath, "origin", branchName); err != nil {
  1984. return fmt.Errorf("Push: %v", err)
  1985. }
  1986. return nil
  1987. }
  1988. // Upload represent a uploaded file to a repo to be deleted when moved
  1989. type Upload struct {
  1990. ID int64 `xorm:"pk autoincr"`
  1991. UUID string `xorm:"uuid UNIQUE"`
  1992. UID int64 `xorm:"INDEX"`
  1993. RepoID int64 `xorm:"INDEX"`
  1994. Name string
  1995. Created time.Time `xorm:"-"`
  1996. CreatedUnix int64
  1997. }
  1998. func (u *Upload) BeforeInsert() {
  1999. u.CreatedUnix = time.Now().UTC().Unix()
  2000. }
  2001. func (u *Upload) AfterSet(colName string, _ xorm.Cell) {
  2002. switch colName {
  2003. case "created_unix":
  2004. u.Created = time.Unix(u.CreatedUnix, 0).Local()
  2005. }
  2006. }
  2007. // UploadLocalPath returns where uploads is stored in local file system based on given UUID.
  2008. func UploadLocalPath(uuid string) string {
  2009. return path.Join(setting.Repository.Upload.TempPath, uuid[0:1], uuid[1:2], uuid)
  2010. }
  2011. // LocalPath returns where uploads are temporarily stored in local file system.
  2012. func (upload *Upload) LocalPath() string {
  2013. return UploadLocalPath(upload.UUID)
  2014. }
  2015. // NewUpload creates a new upload object.
  2016. func NewUpload(name string, buf []byte, file multipart.File, userId, repoId int64) (_ *Upload, err error) {
  2017. up := &Upload{
  2018. UUID: gouuid.NewV4().String(),
  2019. Name: name,
  2020. UID: userId,
  2021. RepoID: repoId,
  2022. }
  2023. if err = os.MkdirAll(path.Dir(up.LocalPath()), os.ModePerm); err != nil {
  2024. return nil, fmt.Errorf("MkdirAll: %v", err)
  2025. }
  2026. fw, err := os.Create(up.LocalPath())
  2027. if err != nil {
  2028. return nil, fmt.Errorf("Create: %v", err)
  2029. }
  2030. defer fw.Close()
  2031. if _, err = fw.Write(buf); err != nil {
  2032. return nil, fmt.Errorf("Write: %v", err)
  2033. } else if _, err = io.Copy(fw, file); err != nil {
  2034. return nil, fmt.Errorf("Copy: %v", err)
  2035. }
  2036. sess := x.NewSession()
  2037. defer sessionRelease(sess)
  2038. if err := sess.Begin(); err != nil {
  2039. return nil, err
  2040. }
  2041. if _, err := sess.Insert(up); err != nil {
  2042. return nil, err
  2043. }
  2044. return up, sess.Commit()
  2045. }
  2046. // RemoveUpload removes the file by UUID
  2047. func RemoveUpload(uuid string, userId, repoId int64) (err error) {
  2048. sess := x.NewSession()
  2049. defer sessionRelease(sess)
  2050. if err := sess.Begin(); err != nil {
  2051. return err
  2052. }
  2053. upload, err := getUpload(uuid, userId, repoId)
  2054. if err != nil {
  2055. return fmt.Errorf("getUpload[%s]: %v", uuid, err)
  2056. }
  2057. if err := DeleteUpload(upload, true); err != nil {
  2058. return fmt.Errorf("DeleteUpload[%s]: %v", uuid, err)
  2059. }
  2060. return nil
  2061. }
  2062. func getUpload(uuid string, userID, repoID int64) (*Upload, error) {
  2063. up := &Upload{UUID: uuid, UID: userID, RepoID: repoID}
  2064. has, err := x.Get(up)
  2065. if err != nil {
  2066. return nil, err
  2067. } else if !has {
  2068. return nil, ErrUploadNotExist{0, uuid, userID, repoID}
  2069. }
  2070. return up, nil
  2071. }
  2072. // GetUpload returns Upload by given UUID.
  2073. func GetUpload(uuid string, userId, repoId int64) (*Upload, error) {
  2074. return getUpload(uuid, userId, repoId)
  2075. }
  2076. // DeleteUpload deletes the given upload
  2077. func DeleteUpload(u *Upload, remove bool) error {
  2078. _, err := DeleteUploads([]*Upload{u}, remove)
  2079. return err
  2080. }
  2081. // DeleteUploads deletes the given uploads
  2082. func DeleteUploads(uploads []*Upload, remove bool) (int, error) {
  2083. for i, u := range uploads {
  2084. if remove {
  2085. if err := os.Remove(u.LocalPath()); err != nil {
  2086. return i, err
  2087. }
  2088. }
  2089. if _, err := x.Delete(u); err != nil {
  2090. return i, err
  2091. }
  2092. }
  2093. return len(uploads), nil
  2094. }
  2095. // __________ .__
  2096. // \______ \____________ ____ ____ | |__
  2097. // | | _/\_ __ \__ \ / \_/ ___\| | \
  2098. // | | \ | | \// __ \| | \ \___| Y \
  2099. // |______ / |__| (____ /___| /\___ >___| /
  2100. // \/ \/ \/ \/ \/
  2101. //
  2102. func (repo *Repository) CreateNewBranch(doer *User, oldBranchName, branchName string) (err error) {
  2103. repoWorkingPool.CheckIn(com.ToStr(repo.ID))
  2104. defer repoWorkingPool.CheckOut(com.ToStr(repo.ID))
  2105. localPath := repo.LocalCopyPath()
  2106. if err = discardLocalRepoBranchChanges(localPath, oldBranchName); err != nil {
  2107. return fmt.Errorf("discardLocalRepoChanges: %v", err)
  2108. } else if err = repo.UpdateLocalCopyBranch(oldBranchName); err != nil {
  2109. return fmt.Errorf("UpdateLocalCopyBranch: %v", err)
  2110. }
  2111. if err = repo.CheckoutNewBranch(oldBranchName, branchName); err != nil {
  2112. return fmt.Errorf("CreateNewBranch: %v", err)
  2113. }
  2114. if err = git.Push(localPath, "origin", branchName); err != nil {
  2115. return fmt.Errorf("Push: %v", err)
  2116. }
  2117. return nil
  2118. }