mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
fastpartialmatch: handle nullid correctly
Summary: Special case for nullid Test Plan: arc unit Reviewers: #mercurial, simpkins, ikostia Reviewed By: ikostia Subscribers: net-systems-diffs@fb.com, mjpieters, #sourcecontrol Differential Revision: https://phabricator.intern.facebook.com/D4945927 Tasks: 17622253 Signature: t1:4945927:1493123209:712990c1e883241d99c0aeb4af8d48e18e1baa3d
This commit is contained in:
parent
c48413d98b
commit
64ecdf2691
@ -52,6 +52,9 @@ from mercurial.i18n import _
|
||||
from mercurial.node import (
|
||||
bin,
|
||||
hex,
|
||||
nullhex,
|
||||
nullid,
|
||||
nullrev,
|
||||
)
|
||||
|
||||
from operator import itemgetter
|
||||
@ -405,6 +408,8 @@ def _findcandidates(ui, vfs, id):
|
||||
candidates = {}
|
||||
if not (isinstance(id, str) and len(id) >= 4 and _maybehash(id)):
|
||||
return candidates
|
||||
if nullhex.startswith(id):
|
||||
candidates[nullid] = nullrev
|
||||
filename = id[:2]
|
||||
fullpath = os.path.join(_partialindexdir, filename)
|
||||
try:
|
||||
|
@ -462,3 +462,6 @@ Try to create empty commit
|
||||
$ hg ci -m empty
|
||||
nothing changed
|
||||
[1]
|
||||
|
||||
Try to checkout nullid
|
||||
$ hg up --config fastpartialmatch.raiseifinconsistent=True -q 0000000000
|
||||
|
Loading…
Reference in New Issue
Block a user