##// END OF EJS Templates
shelve: add a shelve extension to save/restore working changes...
shelve: add a shelve extension to save/restore working changes This extension saves shelved changes using a temporary draft commit, and bundles the temporary commit and its draft ancestors, then strips them. This strategy makes it possible to use Mercurial's bundle and merge machinery to resolve conflicts if necessary when unshelving, even when the destination commit or its ancestors have been amended, squashed, or evolved. (Once a change has been unshelved, its associated unbundled commits are either rolled back or stripped.) Storing the shelved change as a bundle also avoids the difficulty that hidden commits would cause, of making it impossible to amend the parent if it is a draft commits (a common scenario). Although this extension shares its name and some functionality with the third party hgshelve extension, it has little else in common. Notably, the hgshelve extension shelves changes as unified diffs, which makes conflict resolution a matter of finding .rej files and conflict markers, and cleaning up the mess by hand. We do not yet allow hunk-level choosing of changes to record. Compared to the hgshelve extension, this is a small regression in usability, but we hope to integrate that at a later point, once the record machinery becomes more reusable and robust.

File last commit:

r18178:6ae45c0b default
r19854:49d4919d default
Show More
test-symlink-os-yes-fs-no.py
45 lines | 1.2 KiB | text/x-python | PythonLexer
/ tests / test-symlink-os-yes-fs-no.py
Martin Geisler
dirstate: ignore symlinks when fs cannot handle them (issue1888)...
r11769 import os, sys, time
Dan Villiom Podlaski Christiansen
prevent transient leaks of file handle by using new helper functions...
r14168 from mercurial import hg, ui, commands, util
Dov Feldstern
test symlinks on symlink-capable os but non-capable filesystem (issue1149)...
r6879
TESTDIR = os.environ["TESTDIR"]
Nicolas Dumazet
tests: move test bundles in a bundles/ subdirectory
r14116 BUNDLEPATH = os.path.join(TESTDIR, 'bundles', 'test-no-symlinks.hg')
Dov Feldstern
test symlinks on symlink-capable os but non-capable filesystem (issue1149)...
r6879
# only makes sense to test on os which supports symlinks
Augie Fackler
tests: use getattr instead of hasattr
r14971 if not getattr(os, "symlink", False):
Dov Feldstern
test symlinks on symlink-capable os but non-capable filesystem (issue1149)...
r6879 sys.exit(80) # SKIPPED_STATUS defined in run-tests.py
Mads Kiilerich
tests: add missing no-outer-repo requirements...
r17015 u = ui.ui()
# hide outer repo
hg.peer(u, {}, '.', create=True)
Martin Geisler
dirstate: ignore symlinks when fs cannot handle them (issue1888)...
r11769 # clone with symlink support
Peter Arrenbrecht
hg: add opts argument to clone for internal remoteui
r14553 hg.clone(u, {}, BUNDLEPATH, 'test0')
Martin Geisler
dirstate: ignore symlinks when fs cannot handle them (issue1888)...
r11769
repo = hg.repository(u, 'test0')
# wait a bit, or the status call wont update the dirstate
time.sleep(1)
commands.status(u, repo)
# now disable symlink support -- this is what os.symlink would do on a
# non-symlink file system
Dov Feldstern
test symlinks on symlink-capable os but non-capable filesystem (issue1149)...
r6879 def symlink_failure(src, dst):
Augie Fackler
test-symlink-os-yes-fs-no.py: clean up use of two-argument raise...
r18178 raise OSError(1, "Operation not permitted")
Dov Feldstern
test symlinks on symlink-capable os but non-capable filesystem (issue1149)...
r6879 os.symlink = symlink_failure
Martin Geisler
dirstate: ignore symlinks when fs cannot handle them (issue1888)...
r11769 # dereference links as if a Samba server has exported this to a
# Windows client
for f in 'test0/a.lnk', 'test0/d/b.lnk':
os.unlink(f)
fp = open(f, 'wb')
Dan Villiom Podlaski Christiansen
prevent transient leaks of file handle by using new helper functions...
r14168 fp.write(util.readfile(f[:-4]))
Martin Geisler
dirstate: ignore symlinks when fs cannot handle them (issue1888)...
r11769 fp.close()
# reload repository
u = ui.ui()
repo = hg.repository(u, 'test0')
commands.status(u, repo)
# try cloning a repo which contains symlinks
Dov Feldstern
test symlinks on symlink-capable os but non-capable filesystem (issue1149)...
r6879 u = ui.ui()
Peter Arrenbrecht
hg: add opts argument to clone for internal remoteui
r14553 hg.clone(u, {}, BUNDLEPATH, 'test1')