mercurial/HGNoSuchBranchError.st
author Jan Vrany <jan.vrany@labware.com>
Fri, 19 Feb 2021 08:29:41 +0000
changeset 924 4d92f234f671
parent 509 f92210d4585b
child 782 abcf8437f58d
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:
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
     1
"
335
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
     2
stx:libscm - a new source code management library for Smalltalk/X
509
f92210d4585b Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 335
diff changeset
     3
Copyright (C) 2012-2015 Jan Vrany
335
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
     4
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
     5
This library is free software; you can redistribute it and/or
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
     6
modify it under the terms of the GNU Lesser General Public
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
     7
License as published by the Free Software Foundation; either
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
     8
version 2.1 of the License. 
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
     9
335
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    10
This library is distributed in the hope that it will be useful,
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    11
but WITHOUT ANY WARRANTY; without even the implied warranty of
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    13
Lesser General Public License for more details.
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    14
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    15
You should have received a copy of the GNU Lesser General Public
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    16
License along with this library; if not, write to the Free Software
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    17
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
    18
"
105
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
"{ Package: 'stx:libscm/mercurial' }"
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
HGError subclass:#HGNoSuchBranchError
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
	instanceVariableNames:''
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
	classVariableNames:''
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
	poolDictionaries:''
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
	category:'SCM-Mercurial-Exceptions'
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
!
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
    28
!HGNoSuchBranchError class methodsFor:'documentation'!
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
    29
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
    30
copyright
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
    31
"
335
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    32
stx:libscm - a new source code management library for Smalltalk/X
509
f92210d4585b Updated copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 335
diff changeset
    33
Copyright (C) 2012-2015 Jan Vrany
335
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    34
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    35
This library is free software; you can redistribute it and/or
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    36
modify it under the terms of the GNU Lesser General Public
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    37
License as published by the Free Software Foundation; either
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    38
version 2.1 of the License. 
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
    39
335
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    40
This library is distributed in the hope that it will be useful,
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    41
but WITHOUT ANY WARRANTY; without even the implied warranty of
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    42
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    43
Lesser General Public License for more details.
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    44
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    45
You should have received a copy of the GNU Lesser General Public
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    46
License along with this library; if not, write to the Free Software
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    47
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
    48
"
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
    49
! !
105
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
!HGNoSuchBranchError class methodsFor:'documentation'!
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
version_HG
115
b1ed2d29054b version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
    54
b1ed2d29054b version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
    55
    ^ '$Changeset: <not expanded> $'
105
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
! !
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
    57