[VCS] Merging IAtomic* into IBasic*

Matthew Woehlke mw_triad at users.sourceforge.net
Thu May 10 20:29:54 UTC 2007


(CVS gurus, please see the end of this post...)

Andreas Pakulat wrote:
> On 10.05.07 13:00:13, Matthew Woehlke wrote:
>> Andreas Pakulat wrote:
>>> On 10.05.07 10:10:22, Matthew Woehlke wrote:
>>>> Just to clarify:
>>>> repositoryRevision gets the most recent revision committed to the /whole 
>>>> repository/ (like the "Last Changed Rev" in 'svn info'). So if I am 
>>>> understanding you correctly, there is no such thing in CVS. Note that 
>>>> repositoryRevision does *not* take a repo path. I think you would use 
>>>> log() to get the information you are talking about.
>>> Did you look at repositoryRevision lately? It does take a path and IMHO
>>> its not what you want it to be. It tells you the last revision when the
>>> given path was changed. What would use-case do you have for knowing the
>>> latest global revision number?
>> Hmm, so it does, in which case I am mis-remembering. Given that it is in 
>> IAtomicBrowsableVC I think I must have meant for it to work as described 
>> above, since as it is currently written, it does indeed belong in 
>> IBrowsableVC. That being the case, do you think it's worth keeping 
>> repositoryRevision when it's just a simplified log()?
> 
> Its not a simplified log. repositoryRevision returns just the exact
> revision for HEAD (it shouldn't be just head but the number). log()
> returns what has changed for a given revision.

It isn't? Does log(repoPath, VcsRevision::Head, 1) not provide the same 
information?

>> I guess the only obvious use case is to facilitate getting a list of 
>> changes by means other than calling log() on the repository root.
> 
> My use case is simply letting a script determine wether the local copy
> of a file is up-to-date or not. So it would do something like:

Right, but log() should be able to do that. The time difference between 
using log() and 'svn info'/'p4 fstat' seems to be noise, so I don't see 
a performance reason for a separate method. That said, I guess we can 
provide it for symmetry with localRevision, which is less redundant 
because localRevision might not need a connection to the remote VCS 
where log(localPath) might. In any case, we agree that it should move to 
IBrowsableVC, right?

> if( rev1 < rev2 ) then do something fancy, like rm -rf /home

Um... no? ;-) I think doing update() would be a better idea :-).

Any thoughts on what this function should look like? I'm not fond of 
operators because a comparison might mean consulting the repo (think of 
comparing a Date to a GlobalNumber) and might fail (comparing a 
FileNumber to anything else, or a Range to anything). I guess comparing 
two FileNumbers should assume that they represent the same file; the 
conversion would be painful otherwise.

>> This brings up two other questions... Should we have a repositoryRoot() 
>> function?
> 
> What for?

log(repositoryRoot(), VcsRevision::Head, limit) to get a list of all 
changes that have happened anywhere. Also it's pretty important for a 
remote repository browser to know :-) (although I suppose it could 
require you to specify this).

> How do you determine that?

In perforce the root is simply '//' by definition. In svn, 'svn info' 
knows what the root is.

> For CVS the root is pretty clear but
> doesn't give you anything useful, because you work on modules there.

Again, I don't know CVS. Is the case above (log(theRoot)) possible? 
(Robert-or-someone-else-that-knows-CVS?)

-- 
Matthew
"Ah, yes. Control the media and you control the world."
   -- from a story by Raven Blackmane





More information about the KDevelop-devel mailing list