Ticket UUID: | e0352240adeafd4d4d8d297c2141dacf076507b7 | ||
Title: | Support for importing vendor source | ||
Status: | Open | Type: | Feature_Request |
Severity: | Important | Priority: | |
Subsystem: | Resolution: | Open | |
Last Modified: | 2011-02-04 21:55:32 | ||
Version Found In: | 356e877cea | ||
Description & Comments: | |||
When tracking third party software in Fossil, I want to have better support for checking external source in in full.
Handling it manually is tiresome: fossil open ~/repo/project vendor --keep fossil add $(fossil extras --dotfiles) fossil rm $(fossil changes | awk '$1 == "MISSING" {print $2}' fossil ci -m "Import vendor version 6.6.6"The shell magic is error-prone, it works badly with files containing white space in names, it is good luck I haven't run into problems yet. I propose to create some "import" command that synchronizes inventory with file system. anonymous added on 2010-10-13 13:26:02: wolfgang added on 2010-10-13 19:44:04: Maybe you take a look at it and/or test it in your environment. The command help is: Usage: fossil.exe import best regards Wolfgang anonymous claiming to be Joerg Sonnenberger added on 2010-10-13 21:38:34: (1) A separate branch with the unmodified sources in a specific location. Ideally, the import command does a sanity check that the "vendor" branch doesn't contain anything else. (2) A symbol for each each imported version. Normally, this is the release version from upstream or the commit id or whatever. This should be a non-propagating tag. (3) A merge from the vendor branch to trunk. As fossil keeps track of the merge state, this is easier than with cvs, where it had to be simulated with cvs up -j old-tag -j new-tag. A really useful "fossil import" would therefore be: fossil import REPOSITORY PATH BRANCH TAG and not require a checkout of the proper branch. The merge part is easy enough to do with the normal merge processing and can be skipped. anonymous added on 2010-10-14 07:54:40: $ fossil merge vendor fossil: lack both primary and secondary filesPerhaps this should be fixed too. A symbol for each version isn't needed, you have version identifiers already, and you can always tag what you want. wolfgang added on 2010-10-14 10:20:26: The main problem, deescribed at the beginning was the sync of the checkout file tree and the files in the repository. This can be hanlded with the new commen. Would the merge work, if we use the cherrypicck option? I cannot test it now, but i'll try it later and i think, it will work. The only problem, we may have is the fact, that the import command needs to be called from an ceckout. The new command shares most of its code withalready exitant code for add/extras/rm and all these ccommands are only implemented, when called from an existing checkout. It will be complex to extendd it to work with standalone checkouts, and i don't believe, that it's neccesary:
Merging to main development branch should be possible by using cherrypick best regards Wolfgang anonymous claiming to be Joerg Sonnenberger added on 2010-10-14 10:41:57: I've had to deal with vendor imports that often enough lack any version number other than some RCS ids in the file. Importing files directly from the upstream version control system is a common task for larger projects. Sadly enough, having to identify what changed between different imports is also often enough required. Re main problem: I consider "import" a convenience command. The original set of commands can be simplified a lot by removing all files first with find . -type f -print0 | xargs -0 fossil rm, copying the new files and doing find . -type f -print0 | xargs -0 fossil add. That's safe for spaces in names etc. Having to switch to the vendor branch requires either creating another checkout and copying files or switching from a large checkout to a minimal one. The latter isn't a lot of fun if you have a working copy size of > 100MB and uncommitted changes. Not having to move the vendor branch has another very property, it reduces the chance of accidentally messing it up. Re fossil merge failure: This looks like a bug. Merging to the initial empty version should certainly be allowed as special case. It works fine if any commit was done on trunk first. wolfgang added on 2010-10-14 13:30:13: The import command is useful on OS != *nix. On windows, scripting these commands is a little bit tricky. Because add/extras can work recursiv, i think it's a good extension, to offer the mixed comman import. I would always use multiple checkouts, to handle venddor imports - on the vendor branch - and development - main trunk or development branch. anonymous added on 2010-10-14 14:03:04: anonymous claiming to be Joerg Sonnenberger added on 2010-10-14 14:11:54: I maintain that having to use a separate working copy for doing vendor imports is a PITA. wolfgang added on 2010-10-14 18:36:16: I've started a small test repository on chiselapp.com:
import/addremove and merging with cherrypick seems to work fine for me. But i can see some problems/weak points:
This could only be done, using a import directory outside of the checkout. Merging is OK for me. Conclusion:
anonymous claiming to be Joerg Sonnenberger added on 2010-10-14 18:56:30: I was thinking about the import in terms of creating the manifest mostly from scratch, just using the correct P card. I haven't looked (yet) how much work the commit code creates for that. wolfgang added on 2010-10-14 19:49:43: So doing fossil open VENDOR --keep creates just the needed synchronisation information into a new venddor delivery, to use addremove/commit/tag to do a proper import. So i think, addremove in its current form shouldd be good enough as first step. anonymous added on 2010-10-25 08:20:01: anonymous added on 2011-02-04 21:55:32 UTC: % fossil help | tail -1 This is fossil version [356e877cea] 2011-01-13 19:55:28.947 UTC % fossil help addremove | head -1 Usage: fossil addremove ?--dotfiles? ?--ignore GLOBPATTERN? ?--test? |