Opened 12 years ago

Closed 9 years ago

Last modified 9 years ago

#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 (7)

comment:1 Changed 12 years ago by warner

  • Milestone changed from undecided to 0.7.8
  • Owner set to warner
  • Status changed from new to assigned

seems reasonable

comment:2 Changed 11 years ago by dustin

  • Milestone changed from 0.8.0 to 0.7.+

comment:3 Changed 11 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 9 years ago by dustin

  • Keywords p4 added
  • Milestone changed from 0.8.+ to 0.8.1
  • Summary changed from Set "revision" property when using computeSourceRevision to [PATCH] Set "revision" property when using computeSourceRevision

comment:5 Changed 9 years ago by dustin

Actually, I think this patch makes sense in general, not just for P4.

comment:6 Changed 9 years ago by Dustin J. Mitchell

  • Resolution set to fixed
  • Status changed from assigned to closed

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 9 years 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

Note: See TracTickets for help on using tickets.