##// END OF EJS Templates
shelve: add test for Shelf.changed_files
Jason R. Coombs -
r50482:8a800502 default
parent child Browse files
Show More
@@ -1600,6 +1600,7 b' shelve --list --patch should work even w'
1600 $ rm -r .hg/shelve*
1600 $ rm -r .hg/shelve*
1601
1601
1602 #if phasebased
1602 #if phasebased
1603 $ cp $HGRCPATH $TESTTMP/hgrc-saved
1603 $ cat <<EOF >> $HGRCPATH
1604 $ cat <<EOF >> $HGRCPATH
1604 > [shelve]
1605 > [shelve]
1605 > store = strip
1606 > store = strip
@@ -1628,3 +1629,32 b' Override the disabling, re-enabling phas'
1628 #if stripbased
1629 #if stripbased
1629 $ hg log --hidden --template '{user}\n'
1630 $ hg log --hidden --template '{user}\n'
1630 #endif
1631 #endif
1632
1633 clean up
1634
1635 #if phasebased
1636 $ mv $TESTTMP/hgrc-saved $HGRCPATH
1637 #endif
1638
1639 changed files should be reachable in all shelves
1640
1641 create an extension that emits changed files
1642
1643 $ cat > shelve-changed-files.py << EOF
1644 > """Command to emit changed files for a shelf"""
1645 >
1646 > from mercurial import registrar, shelve
1647 >
1648 > cmdtable = {}
1649 > command = registrar.command(cmdtable)
1650 >
1651 >
1652 > @command(b'shelve-changed-files')
1653 > def shelve_changed_files(ui, repo, name):
1654 > shelf = shelve.ShelfDir(repo).get(name)
1655 > for file in shelf.changed_files(ui, repo):
1656 > ui.write(file + b'\n')
1657 > EOF
1658
1659 $ hg --config extensions.shelve-changed-files=shelve-changed-files.py shelve-changed-files default
1660 somefile.py
General Comments 0
You need to be logged in to leave comments. Login now