mercurial/HGObsoleteRevisionError.st
author Jan Vrany <jan.vrany@labware.com>
Fri, 19 Feb 2021 08:29:41 +0000
changeset 924 4d92f234f671
parent 808 ae9fdbfa8ba4
permissions -rw-r--r--
Rework and fix HGSourceCodeManager >> #revisionLogOf:...directory:module:` This commit changes the logic in two ways: 1. #newestRevision is now the newest revision in the branch that *contains* given file (not necesarily modidfes it). If there are multiple heads in that branch, pretty much random one is returned. This changes old behavior and therefore this commit updates tests. 2. If a specific single revision is requested, i.e., both from and to revisions are the same, revision log with that single revision is returned no matter whether it modifies the file or even contains that file at all. This is essentially a workaround to fix issue #305. Moreover, this commit simplifies the code a lot by delegating all the changeset searching and filtering to mercurial using revset expressions. See https://swing.fit.cvut.cz/projects/stx-jv/ticket/305#comment:3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
808
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
stx:libscm - a new source code management library for Smalltalk/X
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
Copyright (C) 2012-2015 Jan Vrany
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
This library is free software; you can redistribute it and/or
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
modify it under the terms of the GNU Lesser General Public
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
License as published by the Free Software Foundation; either
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
version 2.1 of the License. 
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
This library is distributed in the hope that it will be useful,
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
but WITHOUT ANY WARRANTY; without even the implied warranty of
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
Lesser General Public License for more details.
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
You should have received a copy of the GNU Lesser General Public
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
License along with this library; if not, write to the Free Software
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
"
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
"{ Package: 'stx:libscm/mercurial' }"
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
"{ NameSpace: Smalltalk }"
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
HGRepositoryError subclass:#HGObsoleteRevisionError
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
	instanceVariableNames:''
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
	classVariableNames:''
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
	poolDictionaries:''
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
	category:'SCM-Mercurial-Exceptions'
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
!
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
!HGObsoleteRevisionError class methodsFor:'documentation'!
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
copyright
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
"
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
stx:libscm - a new source code management library for Smalltalk/X
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
Copyright (C) 2012-2015 Jan Vrany
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
This library is free software; you can redistribute it and/or
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
modify it under the terms of the GNU Lesser General Public
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
License as published by the Free Software Foundation; either
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
version 2.1 of the License. 
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
This library is distributed in the hope that it will be useful,
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
but WITHOUT ANY WARRANTY; without even the implied warranty of
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
Lesser General Public License for more details.
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
You should have received a copy of the GNU Lesser General Public
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
License along with this library; if not, write to the Free Software
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
"
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
! !
ae9fdbfa8ba4 Initial support of obsolete changesets
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52