211 | | ==== Improve fetching from version control ==== #fetchtypes |
212 | | |
213 | | Make cvs/svn/git/hg/bzr fetch types checkout into the distfiles dir and then export into the work dir, to [[ticket:16373|avoid having to re-fetch]] after cleaning the work directory. |
214 | | "`fetch.type svn`" is inefficient in that it checks out a new working copy every time, directly to the work area. That would be like a normal port downloading the distfile every time. Instead, we should check out a working copy to that port's distpath, and then in the extract phase we should `svn export` it to the work area. |
215 | | |
216 | | Some checks will be needed in the fetch phase to ensure that an existing working copy: |
217 | | |
218 | | * has no modifications: check `svn status`. Ideally, we would try to clean up the working copy, for example by `svn revert`-ing modified or added or deleted files, and then in a second `svn status` run, delete any unversioned files. But it's already an improvement if we just discard the working copy if `svn status --ignore-externals` produces any output. |
219 | | * is from the right URL: check `svn info`: check if the "URL" is the one we want. If not, check that the "Repository Root" is a substring of the repository we want. If yes, try to `svn switch` to the URL and revision we want; if not, discard the working copy. |
220 | | |
221 | | * Difficulty: Easy |
222 | | * Languages: Tcl, C, bash |
223 | | * Contact: larryv |
224 | | |
| 294 | |
| 295 | |
| 296 | {{{ |
| 297 | #!comment |
| 298 | ==== Improve fetching from version control ==== #fetchtypes |
| 299 | |
| 300 | Make cvs/svn/git/hg/bzr fetch types checkout into the distfiles dir and then export into the work dir, to [[ticket:16373|avoid having to re-fetch]] after cleaning the work directory. |
| 301 | "`fetch.type svn`" is inefficient in that it checks out a new working copy every time, directly to the work area. That would be like a normal port downloading the distfile every time. Instead, we should check out a working copy to that port's distpath, and then in the extract phase we should `svn export` it to the work area. |
| 302 | |
| 303 | Some checks will be needed in the fetch phase to ensure that an existing working copy: |
| 304 | |
| 305 | * has no modifications: check `svn status`. Ideally, we would try to clean up the working copy, for example by `svn revert`-ing modified or added or deleted files, and then in a second `svn status` run, delete any unversioned files. But it's already an improvement if we just discard the working copy if `svn status --ignore-externals` produces any output. |
| 306 | * is from the right URL: check `svn info`: check if the "URL" is the one we want. If not, check that the "Repository Root" is a substring of the repository we want. If yes, try to `svn switch` to the URL and revision we want; if not, discard the working copy. |
| 307 | |
| 308 | * Difficulty: Easy |
| 309 | * Languages: Tcl, C, bash |
| 310 | * Contact: larryv |
| 311 | }}} |