Show More
@@ -676,20 +676,7 b' class dirstate(object):' | |||
|
676 | 676 | ): |
|
677 | 677 | entry = self._map.get(f) |
|
678 | 678 | if added or entry is not None and entry.removed: |
|
679 |
s |
|
|
680 | if self._map.hastrackeddir(f): | |
|
681 | msg = _(b'directory %r already in dirstate') | |
|
682 | msg %= pycompat.bytestr(f) | |
|
683 | raise error.Abort(msg) | |
|
684 | # shadows | |
|
685 | for d in pathutil.finddirs(f): | |
|
686 | if self._map.hastrackeddir(d): | |
|
687 | break | |
|
688 | entry = self._map.get(d) | |
|
689 | if entry is not None and not entry.removed: | |
|
690 | msg = _(b'file %r in dirstate clashes with %r') | |
|
691 | msg %= (pycompat.bytestr(d), pycompat.bytestr(f)) | |
|
692 | raise error.Abort(msg) | |
|
679 | self._check_new_tracked_filename(f) | |
|
693 | 680 | self._dirty = True |
|
694 | 681 | self._updatedfiles.add(f) |
|
695 | 682 | self._map.addfile( |
@@ -703,6 +690,22 b' class dirstate(object):' | |||
|
703 | 690 | possibly_dirty=possibly_dirty, |
|
704 | 691 | ) |
|
705 | 692 | |
|
693 | def _check_new_tracked_filename(self, filename): | |
|
694 | scmutil.checkfilename(filename) | |
|
695 | if self._map.hastrackeddir(filename): | |
|
696 | msg = _(b'directory %r already in dirstate') | |
|
697 | msg %= pycompat.bytestr(filename) | |
|
698 | raise error.Abort(msg) | |
|
699 | # shadows | |
|
700 | for d in pathutil.finddirs(filename): | |
|
701 | if self._map.hastrackeddir(d): | |
|
702 | break | |
|
703 | entry = self._map.get(d) | |
|
704 | if entry is not None and not entry.removed: | |
|
705 | msg = _(b'file %r in dirstate clashes with %r') | |
|
706 | msg %= (pycompat.bytestr(d), pycompat.bytestr(filename)) | |
|
707 | raise error.Abort(msg) | |
|
708 | ||
|
706 | 709 | def _get_filedata(self, filename): |
|
707 | 710 | """returns""" |
|
708 | 711 | s = os.lstat(self._join(filename)) |
General Comments 0
You need to be logged in to leave comments.
Login now