##// END OF EJS Templates
qrefresh: keep changeset phase during refresh
Pierre-Yves David -
r16026:31c02546 stable
parent child Browse files
Show More
@@ -1511,6 +1511,8 b' class queue(object):'
1511
1511
1512 user = ph.user or changes[1]
1512 user = ph.user or changes[1]
1513
1513
1514 oldphase = repo[top].phase()
1515
1514 # assumes strip can roll itself back if interrupted
1516 # assumes strip can roll itself back if interrupted
1515 repo.dirstate.setparents(*cparents)
1517 repo.dirstate.setparents(*cparents)
1516 self.applied.pop()
1518 self.applied.pop()
@@ -1523,8 +1525,15 b' class queue(object):'
1523
1525
1524 try:
1526 try:
1525 # might be nice to attempt to roll back strip after this
1527 # might be nice to attempt to roll back strip after this
1526 n = secretcommit(repo, message, user, ph.date, match=match,
1528 backup = repo.ui.backupconfig('phases', 'new-commit')
1527 force=True)
1529 try:
1530 # Ensure we create a new changeset in the same phase than
1531 # the old one.
1532 repo.ui.setconfig('phases', 'new-commit', oldphase)
1533 n = repo.commit(message, user, ph.date, match=match,
1534 force=True)
1535 finally:
1536 repo.ui.restoreconfig(backup)
1528 # only write patch after a successful commit
1537 # only write patch after a successful commit
1529 patchf.close()
1538 patchf.close()
1530 self.applied.append(statusentry(n, patchfn))
1539 self.applied.append(statusentry(n, patchfn))
@@ -523,3 +523,23 b' but only after writing the bad name into'
523 diff --git a/a b/a
523 diff --git a/a b/a
524 new file mode 100644
524 new file mode 100644
525 $ cd ..
525 $ cd ..
526
527 Refresh with phase data:
528
529
530
531 $ cd repo
532 $ echo 'babar' >> a
533 $ hg qnew -m 'update a' p2.diff
534 $ hg phase p2.diff
535 2: draft
536 $ echo 'beber' >> a
537 $ hg qref
538 $ hg phase p2.diff
539 2: draft
540 $ hg phase --force --secret p2.diff
541 $ echo 'bibir' >> a
542 $ hg qref
543 $ hg phase p2.diff
544 2: secret
545
General Comments 0
You need to be logged in to leave comments. Login now