summaryrefslogtreecommitdiff
path: root/dgit
Commit message (Collapse)AuthorAge
...
* dgit: Tidying up after tag format: drop ..._can_splitbrainIan Jackson2019-06-28
| | | | | | Substitute this fixed value into its call sites. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Drop support for old tag formatIan Jackson2019-06-28
| | | | | | | | | | access_cfg_tagformats_can_splitbrain always returns true now. We'll delete it in a moment. We now insist on protocol version 4 because older ones imply the old tag format. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: tag format: Add missing $protovsn comment re tagformat paramIan Jackson2019-06-28
| | | | | | | No fuctional change. We are going to get rid of this in a moment, but this change makes clearer what is going on. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Do split brain cache and saving in build_maybe_quilt_fixupIan Jackson2019-06-28
| | | | | | | This wants to happy whenever we have a split brain, not only in splitting multipatch modes. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Fix --dgit-view-save optionIan Jackson2019-06-28
| | | | | | | This was supposed to be an alias for --save-dgit-view but didn't work because || forced scalar context. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: quiltify: Go back to dgit-view if appropriateIan Jackson2019-06-28
| | | | | | | | | Going back to master is fine with a unified view, but we are going to want to cope with a split view here. No functional change since $do_split_brain is not ever set here, yet. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Move git chedckout master out of quiltifyIan Jackson2019-06-28
| | | | | | | | | This is closer to where it is going to be used, and a bit less confusing. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: When propagating pseudomerge error, strip leading \nIan Jackson2019-06-28
| | | | | | | | fail adds an initial \n to provide a blank line separating the error message from previous output. We want to strip any such thing away again. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Split out default_from_access_cfgIan Jackson2019-06-28
| | | | | | No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: clean mode: Correctly reject bad modes from configIan Jackson2019-06-28
| | | | | | Add the missing ^ and $ (which do not appear in $cleanmode_re). Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: split brain reorg: Slight internal error check improvementsIan Jackson2019-06-28
| | | | | | | Move the $made_split_brain and $do_split_brain checks outside various conditionals. And change a die to a confess. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: split brain reorg: Rename $made_split_brainIan Jackson2019-06-28
| | | | | | | | This variable is not technnically necessary any more. But tracking this means if we introduce bugs which mean that we didn't do the split brain work, we will get much saner misbehaviour: a crash. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: split brain reorg: Check $split_brain against $do_split_brainIan Jackson2019-06-28
| | | | | | | | | | | | I think by now, $do_split_brain is always set early enough that $split_brain here implies $do_split_brain. And if $split_brain were not set but $do_split_brain was, that would mean we hadn't actually done the necessary work (constructing the and switching to the dgit-view branch in the playtree or computing $dgithead). Double check this with a couple of calls to confess. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: split brain reorg: debug print quilt mode in XXXIan Jackson2019-06-28
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Fix check for --include-dirty --quilt=<splitting>Ian Jackson2019-06-28
| | | | | | | | This needs to know whether we are actually in split brain mode. build_or_push_prep_modes has just determined the answer, so put it there. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: split brain reorg: Move do_split_brain settingIan Jackson2019-06-28
| | | | | | | | | | | | | | | | | | | | | We have to introduce a new "time", build_or_push_prep_modes, which is the point at which we know we have a working tree, and know the quilt mode, and know we are pushing or building. There is one call to build_or_push_prep_modes near every call to build_or_push_prep_early - after pushing/notpushing (which also means after parseopts_late_defaults). There is one nontrivial functional difference: Now we use the format from the working tree, rather than from the .dsc. But these ought to be identical in any sane situation. If they are not then the user has done something very strange. The quilt fixup machinery may go wrong, but we should detect a problem later, during the dpkg-source -x check, so nothing wrong will be pushed anywhere. Otherwise no overall functional change other than to debug output. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Add a comment about a bug we are about to eliminate.Ian Jackson2019-06-28
| | | | | | No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: split brain reorg: Move some split brain code further out.Ian Jackson2019-06-28
| | | | | | | | | | | | | | | | We are going to want this in other quilt modes. Logically, it should occur in build_maybe_quilt_fixup. Specifically, move: * the quilt cache check * the splitting of the dgit-view branch and setting $split_brain out of quilt_fixup_multipatch. quilt_fixup_multipatch now gets $upstreamversion as a parameter. Right now this logic in build_maybe_quilt_fixup is a bit flabby and confusing. We hope to tidy it up a bit later. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: split brain reorg: Change an internal error die to confessIan Jackson2019-06-28
| | | | | | No functional change in non-error cases. This was wrong before. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Reject split brain quilt modes with single-debian-patchIan Jackson2019-06-28
| | | | | | | | Right now, this malfunctions in dgit: we do not do the split brain stuff. And most of these combinations do not appear to make very much sense. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: split brain reorg: Check quilt cache iff $do_split_brain (2)Ian Jackson2019-06-28
| | | | | | | | | | | | When $do_split_brain becomes set when !quiltmode_splitbrain(), we want to check the cache even in the non split brain case. Change the quilt fixup, just before generating a new multipatch conversion. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: split brain reorg: Check quilt cache iff $do_split_brain (1)Ian Jackson2019-06-28
| | | | | | | | | | | When $do_split_brain becomes set when !quiltmode_splitbrain(), we want to check the cache even in the non split brain case. Change in dopush, where we check the cache. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Write down quilt mode split brain plans in a commentIan Jackson2019-06-28
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Move quilt_need_fake_dsc into the places that require itIan Jackson2019-06-28
| | | | | | No overall functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: gdr linear quilt fixup: Do it in a playtreeIan Jackson2019-06-28
| | | | | | | | It will work there, since this operation does not need any of the magic gdr refs. And this means that it will DTRT in split brain mode, when we enable that. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: quilt_need_fake_dsc: Make idempotentIan Jackson2019-06-28
| | | | | | No overall functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: unpack_playtree_need_cd_work: Make idempotentIan Jackson2019-06-28
| | | | | | | | | | | | | | | This won't be able to recover from a truly-messed-up "work" but this is good enough not to have to explicitly arrange for each place that uses it to know whether it has been done already. Checking in the filesystem is OK because mktree_in_ud_here calls playtree_setup which expects the playground to have been set up already - ie, all our callers have called prep_ud already. Add a comment about this requirement. No overall functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: rename unpack_playtree_mk_cd_work (from _mkwork)Ian Jackson2019-06-28
| | | | | | | | This makes the effect on cwd less confusing. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: quilt fixup: Move split brain branch creation out a bitIan Jackson2019-06-28
| | | | | | | | | | | | | | Move the playtree git branch, and the setting $split_brain from quiltify_splitbrain (inside quilt_fixup_multipatch, conditional on quiltmode_splitbrain) to quilt_fixup_multipatch. This is still not quite right - it needs to be further out, because it should affect quilt_fixup_singlepatch too. Right now singlepatch DTWT in split brain mode. No functional change for now, anyway. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: dopush pseudomerge, break apart from quilt fixupIan Jackson2019-06-28
| | | | | | | | | | | In the future, we are going to have split brain in situations without any quilt fixup. We will use $do_split_brain for this. In that situation, do the splitbrain pseudomerge too. No actual functional change yet. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Separate out build_check_quilt_splitbrainIan Jackson2019-06-28
| | | | | | | | | | | The only effect of this is to move the tag format check from before the main work of build_maybe_quilt_fixup to later, and to not check it at all for `dgit quilt-fixup'. We don't really care about this any more; this tag format stuff is obsolete and we will delete it at some point... Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Move quiltify_splitbrain_needed into its one call siteIan Jackson2019-06-28
| | | | | | | | I think $split_brain is always 0 on entry. It is this quiltify_splitbrain which used to calculate whether actually splitting brain was needed based on the quilt mode and the state of the tree. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: split brain reorg: Always _needed in split brain quilt modssIan Jackson2019-06-28
| | | | | | | | | | | | | | | | | | | | | | | | | The only differences are: 1. Call quiltify_splitbrain_needed earlier. This is of no consequence. 2. Call it even dpm mode when .gitignore was not edited. This is actually somewhat more correct. In dpm mode we are very likely later going to need split brain to keep the pseudomerge of the dgit view off the maintainer branch. And in fact that is what will happen because dopush fetches the quilt view from the cache and that sets $split_brain unconditionally. With the current code structure dgit's quilt fixup imagines that it can do a quilt fixup for dpm mode without split brain, when the .gitignore is not edited. But actually what is happening is that this is an empty tree fixup, and the history inclusion *will* be done split brain, but later. So overall this change will have no actual overall effect. But it is a move towards helping untangle the quilt mode from split brain. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Drop "dgit view: changes are required..." messageIan Jackson2019-06-28
| | | | | | | We are going to stop caring whether any changes are required, so we will no longer have this information to report. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: rpush: Work in splitting quilt modes, againIan Jackson2019-06-28
| | | | | | | | | | | | The failure case is missing the obviously-necessary check that the protocol version is, indeed, insufficient! This was broken in 045ec681a42fd823280cdec86a177309ddd741f0 Split tags: Genrate maintainer-view tag too which was first uploaded as part of dgit 2.0. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* Replace `confess $!' with `confess "$!"', to actually print errnoIan Jackson2019-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ perl -e 'use Carp; open X, ">/dev/eacces" or die $!' Permission denied at -e line 1. $ perl -e 'use Carp; open X, ">/dev/eacces" or confess $!' at -e line 1. $ perl -e 'use Carp; open X, ">/dev/eacces" or confess "$!"' Permission denied at -e line 1. $ confess will get references to its arguments in @_. Its documentation says it saves/restores $!. I conjecture that these interact as we see here: $ perl -e '$!=1; sub x { print ">@_<\n"; } x $!;' >Operation not permitted< $ perl -e '$!=1; sub x { local $!; print ">@_<\n"; } x $!;' >< Quoting "$!" averts the reference (and it will also ensure that we get the string value of $!, in case confess were to do anything in the future which would mess that up). This commit was made like this: perl -i -pe 's/confess \$!/confess "\$!"/g' dgit perl -i -pe 's/confess \$!/confess "\$!"/g' git-debrebase perl -i -pe 's/confess \$!/confess "\$!"/g' Debian/Dgit.pm I have manually reviewed each hunk and it all looks good to me. Closes: #929549 Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Do not misrecognise some initial packaging as gdr-processableIan Jackson2019-03-01
| | | | | | | | | | | | | | git-debrebase expects a breakwater start commit to not make any changes to upstream files. This means that sometimes dgit would fail to make this check, and expect gdr to be able to make patches; but then gdr would reject the branch. It is still of course possible for dgit to ask gdr to make patches for branches that the user does not *intend* to be handled by gdr, but that is OK so long as gdr will DTRT. Closes: #922446 Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: New relative path handling: debugging outputIan Jackson2019-03-01
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Fix another tiny typo in an error messageIan Jackson2019-03-01
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: import-dsc: Handle relative symlinks correctlyIan Jackson2019-03-01
| | | | | | | | | The logic here was correct only with bpd = `..'. Closes: #913259 Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk> squash!! dgit: import-dsc: Handle relative symlinks correctly
* dgit: cmd_import_dsc: comment on lack of is_orig_file checkIan Jackson2019-01-13
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: When reporting no such package, say `source package'Ian Jackson2019-01-06
| | | | | | This may help a bit pending a fuller fix to #844206/#870496. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: dotdot_bpd_transfer_origs: Change if to early returnIan Jackson2019-01-06
| | | | | | This drops an indentation level. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Transfer origs from .. to bpd when fetchingIan Jackson2019-01-06
| | | | | | | | | | | | | | | | | | | | | | | | This is the second half of #904878. When fetching we want to avoid downloading once again origs that are already in `..', but not in bpd. So call the facility we now have for making clones of things from `..' to bpd. `..' might contain various junk. We try to treat it with a bit of suspicion. In particular, when we have a dsc we know exactly which orig files we are looking for. So only try to link those. We don't do this transfer for debian tarballs or diffs, or for origs that would be related according to their filenames, but aren't in the dsc. This maximises the probability that fetch will succeed even if there is garbage in the `..'. (Garbage in the `..' will sometimes unavoidably cause source builds to fail, because when doing a source build we don't know what origs to expect.) Closes: #904878 Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Transfer origs from .. to bpd when buildingIan Jackson2019-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | This is apropos of #904878. When building we need to consider anything in .. that would be (accordingg to its filename) a possible orig for the package we are building, since we do not know what origs there are supposed to be, and missing ones generate unhelpful error messages. We `copy' things from .. to bpd, rather than just trying to use them directly from .., because otherwise lots of other things won't work right. For example, we might generate .dsc's in the bpd which expect the files alongside, but without the files. But we don't actually copy any files. We prefer to: * If the thing in .. is a symlink, copy the link text, adjusting it into an absolute link. * If the thing in .. is a file, try to hardlink it, or failing that make a symlink to it. The result is that we never duplicate the file contents, but still, where possible, we prefer to make the thing in bpd stand alone so that if the `copy' in .. is deleted everything is still fine. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Provide dotdot_bpd_transfer_origs for using origs from ..Ian Jackson2019-01-06
| | | | | | No callers yet so no functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Remove foolish use of $b in quilt_fixup_multipatchIan Jackson2019-01-06
| | | | Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: Remove foolish uses of $b in unpack_playtree_linkorigs etc.Ian Jackson2019-01-06
| | | | | | | Evidently I had forgotten that $b is weird in Perl and should not by used for things other than sorting. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: generate_commits_from_dsc: Move up $upstreamvIan Jackson2019-01-06
| | | | | | We will want this in a moment. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
* dgit: generate_commits_from_dsc: Factor out $bpd_absIan Jackson2019-01-06
| | | | | | | | And add a newline. We will want this in a moment. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>