Skip to content

Commit 72da644

Browse files
committed
main.scm: move COMMIT_ID_HEX_LENGTH from pushlog (no bug) r=zeid
Small cleanup in preparation for the const to be used in more places. Pull request: #766
1 parent eb01973 commit 72da644

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/lando/main/scm/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from lando.main.scm.abstract_scm import AbstractSCM
22
from lando.main.scm.commit import CommitData
33
from lando.main.scm.consts import (
4+
COMMIT_ID_HEX_LENGTH,
45
SCM_TYPE_GIT,
56
SCM_TYPE_HG,
67
MergeStrategy,
@@ -39,6 +40,7 @@
3940
# commit
4041
"CommitData",
4142
# consts
43+
"COMMIT_ID_HEX_LENGTH",
4244
"SCM_TYPE_HG",
4345
"SCM_TYPE_GIT",
4446
"MergeStrategy",

src/lando/main/scm/consts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
SCM_TYPE_GIT = "git"
44
SCM_TYPE_HG = "hg"
55

6+
COMMIT_ID_HEX_LENGTH = 40
7+
68

79
@enum.unique
810
class MergeStrategy(str, enum.Enum):

src/lando/pushlog/models/commit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
from lando.main.models import Repo
1212

1313
# We need to import from the specific file to avoid dependency loops.
14-
from lando.main.scm.commit import CommitData
14+
from lando.main.scm import COMMIT_ID_HEX_LENGTH, CommitData
1515

16-
from .consts import COMMIT_ID_HEX_LENGTH, MAX_FILENAME_LENGTH, MAX_PATH_LENGTH
16+
from .consts import MAX_FILENAME_LENGTH, MAX_PATH_LENGTH
1717

1818
logger = logging.getLogger(__name__)
1919

src/lando/pushlog/models/consts.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
COMMIT_ID_HEX_LENGTH = 40
2-
31
# Those are fairly common values under Unix.
42
MAX_FILENAME_LENGTH = 255
53
MAX_PATH_LENGTH = 4096

0 commit comments

Comments
 (0)