Ticket #101 (closed enhancement: fixed)
[PATCH] Set "revision" property when using computeSourceRevision
| Reported by: | kvigor | Owned by: | warner |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.8.1 |
| Version: | 0.7.5 | Keywords: | p4 |
| Cc: |
Description
It would be useful to be able to retrieve the revision returned by computeSourceRevision in a source checkout step without a specified revision. The following tiny patch simply sets the "revision" property appropriately.
The motivation here is that I am using Perforce, which does not properly support the "got_revision" property. It would obviously be preferable to fix the Perforce support to support got_revision, but I have been unable to determine a proper way to do that. I believe that this alternate solution is generally useful, though.
--- /root/backup/source.py 2007-09-19 10:29:12.000000000 -0600 +++ source.py 2007-09-19 10:43:41.000000000 -0600 @@ -165,6 +165,7 @@
revision = s.revision if not revision and not self.alwaysUseLatest:
revision = self.computeSourceRevision(s.changes)
+ self.setProperty("revision", revision)
# if patch is None, then do not patch the tree after checkout
# 'patch' is None or a tuple of (patchlevel, diff)
Change History
comment:1 Changed 4 years ago by warner
- Owner set to warner
- Status changed from new to assigned
- Milestone changed from undecided to 0.7.8
comment:3 Changed 3 years ago by dustin
I'd like to only set this property in the P4 step - it should already be correct for the other supported VCs
comment:4 Changed 21 months ago by dustin
- Keywords p4 added
- Summary changed from Set "revision" property when using computeSourceRevision to [PATCH] Set "revision" property when using computeSourceRevision
- Milestone changed from 0.8.+ to 0.8.1
comment:5 Changed 21 months ago by dustin
Actually, I think this patch makes sense in general, not just for P4.
comment:6 Changed 21 months ago by Dustin J. Mitchell
- Status changed from assigned to closed
- Resolution set to fixed
Set the 'revision' property more often
If the requested SourceStamp? was HEAD, and we calculate a revision from the set of Changes passed in, then set the 'revision' property accordingly. Fixes #101.
Changeset: 5999e700b5b158a3c447885f45300ada717399b7
comment:7 Changed 20 months ago by Dustin J. Mitchell
Set the 'revision' property more often
If the requested SourceStamp? was HEAD, and we calculate a revision from the set of Changes passed in, then set the 'revision' property accordingly. Fixes #101.
Changeset: 5999e700b5b158a3c447885f45300ada717399b7
![[Buildbot Logo]](/chrome/site/header-text-transparent.png)
seems reasonable