Mercurial > hgrepos > Python > apps > py-cutils
comparison cutils/treesum.py @ 301:d246b631b85a
treesum: Change debug output: make output when entering a new root directory different from recursing into a sub-directory
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 05 Mar 2025 10:06:38 +0100 |
| parents | 1fc117f5f9a1 |
| children | bf88323d6bf7 |
comparison
equal
deleted
inserted
replaced
| 300:1fc117f5f9a1 | 301:d246b631b85a |
|---|---|
| 641 else: | 641 else: |
| 642 self._generate(os.path.normpath(root), tuple()) | 642 self._generate(os.path.normpath(root), tuple()) |
| 643 self._writer.finish() | 643 self._writer.finish() |
| 644 | 644 |
| 645 def _generate(self, root, top): | 645 def _generate(self, root, top): |
| 646 logging.debug("Handling %s/%r", root, top) | 646 if top: |
| 647 logging.debug("Recursing into directory: %s/%r", root, top) | |
| 648 else: | |
| 649 logging.debug("Handling root directory: %s", root) | |
| 647 path = os.path.join(root, *top) if top else root | 650 path = os.path.join(root, *top) if top else root |
| 648 try: | 651 try: |
| 649 with walk.ScanDir(path) as dirscan: | 652 with walk.ScanDir(path) as dirscan: |
| 650 fsobjects = list(dirscan) | 653 fsobjects = list(dirscan) |
| 651 except OSError as e: | 654 except OSError as e: |
