summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-12 12:27:15 +0200
committerYann Dirson <ydirson@altern.org>2008-03-31 16:09:12 +0200
commite6209a9323d19b940842e27a7ec7c03f02d92497 (patch)
tree9ba214c2c9108f465ed6fdf21ce92f742fdb297c
parent1a680d69dd39346bdf3674c6cb2460e11e15c7d2 (diff)
downloadcvsps-e6209a9323d19b940842e27a7ec7c03f02d92497.tar.gz
Make time ordering less important than revision ordering
On Mon, 12 Jun 2006, Robin Rosenberg (list subscriber) wrote: > > The script creates a small CVS repo with three commits on two files. What's > odd is that cvsps lists revision 1.2 of the file v.txt *before* version 1.1, > like this: What seems to happen is that the two changes to v.txt are broken up into separate changesets (because they touch the same file), but then the _first_ one is merged with the changeset that contains the k.txt change (because they have the same log message, and roughly the same date). Then, because it has the earlier date, that combined changeset ends up being considered to be before the later one, even though it contains a version of v.txt that is newer. Does this patch fix it for you (untested - it could result in tons of other trouble, but it basically just says that time ordering is less important than member revision ordering). I don't think this is strictly correct, btw. I suspect you can still get into strange situations where the changeset merging has resulted in one file ordering one way, and another file ordering the other way. I really don't think cvsps is really very good about this.
-rw-r--r--cvsps.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cvsps.c b/cvsps.c
index 81c6e21..372b05d 100644
--- a/cvsps.c
+++ b/cvsps.c
@@ -1707,14 +1707,14 @@ static int compare_patch_sets_bytime(const PatchSet * ps1, const PatchSet * ps2)
* know that insertions are unique at this point.
*/
- diff = ps1->date - ps2->date;
- if (diff)
- return (diff < 0) ? -1 : 1;
-
ret = compare_patch_sets_by_members(ps1, ps2);
if (ret)
return ret;
+ diff = ps1->date - ps2->date;
+ if (diff)
+ return (diff < 0) ? -1 : 1;
+
ret = strcmp(ps1->author, ps2->author);
if (ret)
return ret;