Mercurial > archived > louis > tools > doxyhook
comparison doxyhook.py @ 3:3a06b35bd591 default tip
Avoid infinite recursion on hook call ("clone bomb")
author | Louis Opter <louis.opter@dotcloud.com> |
---|---|
date | Thu, 25 Mar 2010 20:09:55 +0100 |
parents | a85cbad8dadb |
children |
comparison
equal
deleted
inserted
replaced
2:a85cbad8dadb | 3:3a06b35bd591 |
---|---|
48 return self.__path | 48 return self.__path |
49 | 49 |
50 def __exit__(self, exc_type, exc_value, traceback): | 50 def __exit__(self, exc_type, exc_value, traceback): |
51 shutil.rmtree(self.__path) | 51 shutil.rmtree(self.__path) |
52 | 52 |
53 def clone_repo(ui, source, dest): | 53 def clone_repo(sui, source, dest): |
54 """Clone repo at directory source to directory dest""" | 54 """Clone repo at directory source to directory dest""" |
55 | 55 |
56 commands.clone(ui, source, dest, opts={'uncompressed': True}) | 56 # We have to use a different ui than the source ui. If you don't take this |
57 ui.status('doxyhook: working copy created.\n') | 57 # precaution your hook will be called recursively by the clone command, |
58 # leading to a clone bomb. | |
59 cui = ui.ui() | |
60 commands.clone(cui, source, dest, opts={'uncompressed': True}) | |
61 sui.status('doxyhook: working copy created.\n') | |
58 | 62 |
59 def gen_doc(clone): | 63 def gen_doc(clone): |
60 """ | 64 """ |
61 Generate the documentation with the first doxyfile found under clone | 65 Generate the documentation with the first doxyfile found under clone |
62 directory. | 66 directory. |