Commits

Anonymous committed 1bc3452

Now check that the revisions to be collapsed are all from the correct user.

Comments (0)

Files changed (1)

hgext/collapse.py

     ui.debug(_('Collapsing revisions %s\n') % revs)
 
     for r in revs:
+        if repo[r].user() != ui.username() and not opts['force']:
+            raise util.Abort(_('revision %s does not belong to %s\n') %
+                (r, ui.username()))
         if r != last:
             children = repo[r].children()
             if len(children) > 1:
         [
         ('r', 'rev', [], _('revisions to collapse')),
         ('', 'keep', False, _('keep original revisions')),
+        ('f', 'force', False, _('force collapse of changes from different users'))
         ],
         _('hg collapse -r REVS [--keep | --keepbranches]')),
 }