Summary: | mercurial.eclass: improved working directory creation with respect to dependent ebuilds | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Matthias K. <makadev> |
Component: | Eclasses | Assignee: | Christoph Junghans (RETIRED) <junghans> |
Status: | RESOLVED WONTFIX | ||
Severity: | enhancement | CC: | binki, djc |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Patch proposal
mercurial.eclass.diff mercurial.eclass.diff cleanup, additional --repository switch for archive Fastest (use "hg update") suggested patch removed default revision "tip" (vs. --date") |
Description
Matthias K.
2009-07-31 08:23:19 UTC
Created attachment 199710 [details]
Patch proposal
Proposed Patch which has an additional Option for using hg archive instead of clone, using EHG_WC_OPT="nohistory".
Default is cloning.
Created attachment 199715 [details, diff]
mercurial.eclass.diff
Why do you duplicate the hg command when the only difference is the one defined via the EHG_WC_OPT variable? The attached patch avoids probably useless code duplication...
Created attachment 199717 [details, diff]
mercurial.eclass.diff
Sorry, I uploaded an early version of the diff...
Created attachment 199719 [details, diff]
cleanup, additional --repository switch for archive
thx for the cleanup, the reason for code duplication was/is a problem with the --repository switch, which is troublesome.
clone will issue a warning with it, archive will fail without it.
heres another patch, solving this problem
Created attachment 221317 [details, diff]
Fastest (use "hg update")
I use "hg update" with symlinking ".hg" - this is fastest and avoid twice full repo cloning. This is my code part only, you may move it into any "case" or (IMHO better) adding useflag like "fast-update".
This method keeping "dirstate" file in master ".hg" repo, but I do not know problems from this point.
Created attachment 221939 [details, diff]
suggested patch
I suggest this patch. IMHO it is compatible with "hg clone" (while I comment out symlink removing) and adding next features:
Useflags: release-branch, release-tag. Use latest named revision/"release" (branch or tag) instead of default/tip. May be used to try more stable last snapshot.
EHG_EXTRA_OPT variable (for "update" stage only): I use for "--date" roll-out (see "hd help dates"). ("archive" have no "--date" opt).
This stuff is pretty crazy. If you want to update to a certain branch or tag, just hg update <branch> or hg update <tag>, instead of doing a complicated dance with sed and whatnot. Also, I'm not seeing where you add the date handling at all. Created attachment 221941 [details, diff]
removed default revision "tip" (vs. --date")
Removed default revision until really set. For EHG_EXTRA_OPT="--date ..." compatibility.
After reading all this history I don't actually see what this patch would be good for. The original issue is actually not an issue as hg clone uses hardlinks if available, so no space is actually wasted. Having a source from a certain date could be useful, but I would just make that a special EHG_REVISION, like data:XXX. That would also not collide with mercurial's internals as tag and branch names must not contain the ":" character. [[ $EHG_REVISION = data:* ]] && rev="--data=\"${EHG_REVISION#date:}\"" || rev="--updaterev=\"${EHG_REVISION}\"" Actually it is slightly more complicated as only hg update, but not hg clone has the date option. So it will be more like if [[ $EHG_REVISION = date:* ]]; then hg clone -r default hg up -r $EHG_REVISION else hg clone -r $EHG_REVISION fi However, there is another catch, how do we define the branch from which we get the revision with the date. (In reply to comment #10) > However, there is another catch, how do we define the branch from which we > get the revision with the date. Instead of "date:" one could use the branch, i.e. default:12/12/12. However as the ebuild policy states: "Snapshot cvs ebuilds are greatly preferred over "live" cvs.eclass cvs ebuilds." (this also applies to mercurial), I will close that bugs as WONTFIX. In case the date logic is really needed one can always get it via: src_unpack() { mercurial_fetch cd "${S}" hg update --date "${HG_DATE}" } |