Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
43974cd4
Commit
43974cd4
authored
6 years ago
by
Boris Feld
Browse files
Options
Downloads
Patches
Plain Diff
revlog: introduce a constant for nullrev in `revlog.c`
The value is important enough to be explicitly tracked.
parent
d097dd0a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mercurial/cext/revlog.c
+4
-3
4 additions, 3 deletions
mercurial/cext/revlog.c
with
4 additions
and
3 deletions
mercurial/cext/revlog.c
+
4
−
3
View file @
43974cd4
...
...
@@ -98,6 +98,7 @@
static
PyObject
*
nullentry
=
NULL
;
static
const
char
nullid
[
20
]
=
{
0
};
static
const
Py_ssize_t
nullrev
=
-
1
;
static
Py_ssize_t
inline_scan
(
indexObject
*
self
,
const
char
**
offsets
);
...
...
@@ -308,7 +309,7 @@
Py_ssize_t
length
=
index_length
(
self
);
PyObject
*
entry
;
if
(
pos
==
-
1
)
{
if
(
pos
==
nullrev
)
{
Py_INCREF
(
nullentry
);
return
nullentry
;
}
...
...
@@ -378,7 +379,7 @@
Py_ssize_t
length
=
index_length
(
self
);
const
char
*
data
;
if
(
pos
==
-
1
)
if
(
pos
==
nullrev
)
return
nullid
;
if
(
pos
>=
length
)
...
...
@@ -701,7 +702,7 @@
}
/* Add its parents to the list of nodes to visit */
if
(
revnum
==
-
1
)
if
(
revnum
==
nullrev
)
continue
;
r
=
index_get_parents
(
self
,
revnum
,
parents
,
(
int
)
len
-
1
);
if
(
r
<
0
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment