Show More
@@ -1463,7 +1463,8 b' class localrepository(object):' | |||||
1463 | text, user, date, extra) |
|
1463 | text, user, date, extra) | |
1464 |
|
1464 | |||
1465 | allowemptycommit = (wctx.branch() != wctx.p1().branch() or force |
|
1465 | allowemptycommit = (wctx.branch() != wctx.p1().branch() or force | |
1466 |
or extra.get('close') or merge or cctx.files() |
|
1466 | or extra.get('close') or merge or cctx.files() | |
|
1467 | or self.ui.configbool('ui', 'allowemptycommit')) | |||
1467 | if not allowemptycommit: |
|
1468 | if not allowemptycommit: | |
1468 | return None |
|
1469 | return None | |
1469 |
|
1470 |
@@ -544,6 +544,18 b' commit copy' | |||||
544 | 0 0 6 ..... 0 26d3ca0dfd18 000000000000 000000000000 (re) |
|
544 | 0 0 6 ..... 0 26d3ca0dfd18 000000000000 000000000000 (re) | |
545 | 1 6 7 ..... 1 d267bddd54f7 26d3ca0dfd18 000000000000 (re) |
|
545 | 1 6 7 ..... 1 d267bddd54f7 26d3ca0dfd18 000000000000 (re) | |
546 |
|
546 | |||
|
547 | Test making empty commits | |||
|
548 | $ hg commit --config ui.allowemptycommit=True -m "empty commit" | |||
|
549 | $ hg log -r . -v --stat | |||
|
550 | changeset: 2:d809f3644287 | |||
|
551 | tag: tip | |||
|
552 | user: test | |||
|
553 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
554 | description: | |||
|
555 | empty commit | |||
|
556 | ||||
|
557 | ||||
|
558 | ||||
547 | verify pathauditor blocks evil filepaths |
|
559 | verify pathauditor blocks evil filepaths | |
548 | $ cat > evil-commit.py <<EOF |
|
560 | $ cat > evil-commit.py <<EOF | |
549 | > from mercurial import ui, hg, context, node |
|
561 | > from mercurial import ui, hg, context, node | |
@@ -568,7 +580,7 b' verify pathauditor blocks evil filepaths' | |||||
568 | #endif |
|
580 | #endif | |
569 |
|
581 | |||
570 | $ hg rollback -f |
|
582 | $ hg rollback -f | |
571 |
repository tip rolled back to revision |
|
583 | repository tip rolled back to revision 2 (undo commit) | |
572 | $ cat > evil-commit.py <<EOF |
|
584 | $ cat > evil-commit.py <<EOF | |
573 | > from mercurial import ui, hg, context, node |
|
585 | > from mercurial import ui, hg, context, node | |
574 | > notrc = "HG~1/hgrc" |
|
586 | > notrc = "HG~1/hgrc" | |
@@ -586,7 +598,7 b' verify pathauditor blocks evil filepaths' | |||||
586 | [255] |
|
598 | [255] | |
587 |
|
599 | |||
588 | $ hg rollback -f |
|
600 | $ hg rollback -f | |
589 |
repository tip rolled back to revision |
|
601 | repository tip rolled back to revision 2 (undo commit) | |
590 | $ cat > evil-commit.py <<EOF |
|
602 | $ cat > evil-commit.py <<EOF | |
591 | > from mercurial import ui, hg, context, node |
|
603 | > from mercurial import ui, hg, context, node | |
592 | > notrc = "HG8B6C~2/hgrc" |
|
604 | > notrc = "HG8B6C~2/hgrc" |
General Comments 0
You need to be logged in to leave comments.
Login now