--- a/mercurial/cext/parsers.c Wed Nov 24 04:40:00 2021 +0100
+++ b/mercurial/cext/parsers.c Wed Nov 24 04:51:05 2021 +0100
@@ -335,10 +335,20 @@
&other_second_ambiguous)) {
return NULL;
}
- if ((self->flags & dirstate_flag_has_mtime) &&
- self->mtime_s == other_s &&
- (self->mtime_ns == other_ns || self->mtime_ns == 0 ||
- other_ns == 0)) {
+ if (!(self->flags & dirstate_flag_has_mtime)) {
+ Py_RETURN_FALSE;
+ }
+ if (self->mtime_s != other_s) {
+ Py_RETURN_FALSE;
+ }
+ if (self->mtime_ns == 0 || other_ns == 0) {
+ if (self->flags & dirstate_flag_mtime_second_ambiguous) {
+ Py_RETURN_FALSE;
+ } else {
+ Py_RETURN_TRUE;
+ }
+ }
+ if (self->mtime_ns == other_ns) {
Py_RETURN_TRUE;
} else {
Py_RETURN_FALSE;