Switch to unified view

a/scripts/refresh-all-repos.py b/scripts/refresh-all-repos.py
...
...
90
                try:
90
                try:
91
                    if options.all:
91
                    if options.all:
92
                        log.info('Refreshing ALL commits in %r', c.app.repo)
92
                        log.info('Refreshing ALL commits in %r', c.app.repo)
93
                    else:
93
                    else:
94
                        log.info('Refreshing NEW commits in %r', c.app.repo)
94
                        log.info('Refreshing NEW commits in %r', c.app.repo)
95
                    if options.profile:
96
                        import cProfile
97
                        cProfile.runctx('c.app.repo.refresh(options.all, notify=options.notify)',
98
                                globals(), locals(), 'refresh.profile')
99
                    else:
95
                    c.app.repo.refresh(options.all, notify=options.notify)
100
                        c.app.repo.refresh(options.all, notify=options.notify)
96
                except:
101
                except:
97
                    log.exception('Error refreshing %r', c.app.repo)
102
                    log.exception('Error refreshing %r', c.app.repo)
98
        ThreadLocalORMSession.flush_all()
103
        ThreadLocalORMSession.flush_all()
99
        ThreadLocalORMSession.close_all()
104
        ThreadLocalORMSession.close_all()
100
105
...
...
125
    parser.add_argument('--notify', action='store_true', dest='notify',
130
    parser.add_argument('--notify', action='store_true', dest='notify',
126
            default=False, help='Send email notifications of new commits.')
131
            default=False, help='Send email notifications of new commits.')
127
    parser.add_argument('--dry-run', action='store_true', dest='dry_run',
132
    parser.add_argument('--dry-run', action='store_true', dest='dry_run',
128
            default=False, help='Log names of projects that would have their '
133
            default=False, help='Log names of projects that would have their '
129
            'repos refreshed, but do not perform the actual refresh.')
134
            'repos refreshed, but do not perform the actual refresh.')
135
    parser.add_argument('--profile', action='store_true', dest='profile',
136
            default=False, help='Enable the profiler (slow). Will log '
137
            'profiling output to ./refresh.profile')
130
    return parser.parse_args()
138
    return parser.parse_args()
131
139
132
if __name__ == '__main__':
140
if __name__ == '__main__':
133
    import sys
141
    import sys
134
    faulthandler.enable()
142
    faulthandler.enable()