equal
deleted
inserted
replaced
838 _("shortest() expects an integer minlength")) |
838 _("shortest() expects an integer minlength")) |
839 |
839 |
840 cl = mapping['ctx']._repo.changelog |
840 cl = mapping['ctx']._repo.changelog |
841 def isvalid(test): |
841 def isvalid(test): |
842 try: |
842 try: |
843 try: |
843 if cl._partialmatch(test) is None: |
844 cl.index.partialmatch(test) |
844 return False |
845 except AttributeError: |
|
846 # Pure mercurial doesn't support partialmatch on the index. |
|
847 # Fallback to the slow way. |
|
848 if cl._partialmatch(test) is None: |
|
849 return False |
|
850 |
845 |
851 try: |
846 try: |
852 i = int(test) |
847 i = int(test) |
853 # if we are a pure int, then starting with zero will not be |
848 # if we are a pure int, then starting with zero will not be |
854 # confused as a rev; or, obviously, if the int is larger than |
849 # confused as a rev; or, obviously, if the int is larger than |