view release on metacpan or search on metacpan
src/subversion/subversion/tests/libsvn_wc/wc-queries-test.c
src/subversion/subversion/tests/libsvn_wc/wc-test.c
src/subversion/subversion/tests/manual/README
src/subversion/subversion/tests/manual/tree-conflicts-add-vs-add.py
src/subversion/subversion/tests/README
src/subversion/subversion/tests/svn_test.h
src/subversion/subversion/tests/svn_test_fs.c
src/subversion/subversion/tests/svn_test_fs.h
src/subversion/subversion/tests/svn_test_main.c
src/subversion/subversion/tests/tests.conf
src/subversion/tools/backup/hot-backup.py.in
src/subversion/tools/bdb/erase-all-text-data.py
src/subversion/tools/bdb/skel.py
src/subversion/tools/bdb/svn-bdb-view.py
src/subversion/tools/bdb/svnfs.py
src/subversion/tools/bdb/whatis-rep.py
src/subversion/tools/buildbot/master/Feeder.py
src/subversion/tools/buildbot/master/master.cfg
src/subversion/tools/buildbot/master/private-sample.py
src/subversion/tools/buildbot/master/public_html/buildbot.css
src/subversion/tools/buildbot/master/public_html/index.html
src/subversion/tools/hook-scripts/validate-extensions.py
src/subversion/tools/hook-scripts/validate-files.conf.example
src/subversion/tools/hook-scripts/validate-files.py
src/subversion/tools/hook-scripts/verify-po.py
src/subversion/tools/po/l10n-report.py
src/subversion/tools/po/po-update.sh
src/subversion/tools/server-side/fsfs-reshard.py
src/subversion/tools/server-side/fsfs-stats.c
src/subversion/tools/server-side/mod_dontdothat/mod_dontdothat.c
src/subversion/tools/server-side/mod_dontdothat/README
src/subversion/tools/server-side/svn-backup-dumps.py
src/subversion/tools/server-side/svn-populate-node-origins-index.c
src/subversion/tools/server-side/svn-rep-sharing-stats.c
src/subversion/tools/server-side/svn_server_log_parse.py
src/subversion/tools/server-side/svnauthz.c
src/subversion/tools/server-side/svnpredumpfilter.py
src/subversion/tools/server-side/svnpubsub/commit-hook.py
src/subversion/tools/server-side/svnpubsub/daemonize.py
src/subversion/tools/server-side/svnpubsub/irkerbridge.py
src/subversion/tools/server-side/svnpubsub/rc.d/svnpubsub
src/subversion/tools/server-side/svnpubsub/rc.d/svnpubsub.debian
MANIFEST.SKIP view on Meta::CPAN
\bblibdirs\.ts$ # 6.18 through 6.25 generated this
# Avoid Module::Build generated and utility files.
\bBuild$
\b_build/
\bBuild.bat$
\bBuild.COM$
\bBUILD.COM$
\bbuild.com$
# Avoid temp and backup files.
~$
\.old$
\#$
\b\.#
\.bak$
\.tmp$
\.#
\.rej$
# Avoid OS-specific files/dirs
MANIFEST.SKIP view on Meta::CPAN
\bAlien-SVN-[\d\.\_]+
# Avoid SVN configure stuff
src/subversion/config.log$
src/subversion/config.nice$
src/subversion/config.status$
src/subversion/libtool$
src/subversion/mkmf.log$
src/subversion/subversion/bindings/swig/perl/native/Makefile.PL$
src/subversion/subversion/svn_private_config.h$
src/subversion/tools/backup/hot-backup.py$
src/subversion/tools/hook-scripts/commit-access-control.pl$
src/subversion/CHANGES view on Meta::CPAN
* fixed: show locking notifications in local path style (r20927)
* fixed: encoding error on error messages from invalid options (r20883)
- Server:
* support for new 'svnsync' repository mirroring utility
* support for BDB 4.4, including automatic recovery (issue #2449)
* new contrib hook scripts:
- enforcer
- detect-merge-conflict.sh
- case-insensitive.py
* new tools script svn-backup-dumps.py
* new tools hook script log-police.py
* svnserve improvements:
- can now run as a native Windows service (r18855)
- new option --pid-file (r17836)
- allow the password database to be read-only (r16840)
* mod_dav_svn improvements:
- fixed: error conversion crash (r19516)
- fixed: unfriendly error when locking already locked path (issue #2275)
- fixed: xml escaping bugs (r19760 -85 -86)
* authorization improvements:
src/subversion/CHANGES view on Meta::CPAN
post-commit hook. For example, the new post-commit.tmpl file
recommends 'nice -2 svnadmin deltify "$REPOS" -r "$REV" &'.
User-visible changes:
* now require APR/APU 0.9.5 (ships in Apache 2.0.48)
* lose automatic deltification, but recommend it in post-commit (r7695, #1573)
* new configuration and authn/authz support in ra_svn (r7604, r7601)
* much faster checkouts and updates, over both svn:// and http:// (#1429)
* new partial-authz feature: checkouts/updates just skip unauthorized items
* new 'use-commit-times = yes' config option to use commit-time timestamps
* new 'svnadmin hotcopy' command, like hot-backup.py (#1567)
* fix Win32 "access denied" error in renames (r7598, #1576)
* unnecessary working copy tree locks now avoided, to save time (#1245)
* Compatibility changes:
- lose ra_dav compatibility with servers 0.31 and earlier
- lose support for working copy format "1" (not created for over a year)
* 'svn diff' and other read-only actions now work in read-only working copies
* 'svn blame -rX' now does the intuitive thing
* 'svn log' output headers now say "rXXXX | " instead of "rev XXXX: "
* 'svnversion' no longer stymied by svn:externals
* new 'svn pd' alias for 'svn propdel'
src/subversion/CHANGES view on Meta::CPAN
Version 0.18.1 (released 26 Feb 2003, revision 5118, branches/release-0.18.1)
User-visible changes:
* editor environment variables no longer incorrectly required
* 'svn help import' now displays correct usage
* fix crashes in the internal diff library and ra_dav
* fix Win9x/Me console issue
* cvs2svn.py api fix
* hot_backup.py now correctly removes old backups
Developer-visible changes:
* various rpm package fixes
Version 0.18.0 (released 19 Feb 2003, revision 4968, branches/release-0.18)
User-visible changes:
* renamed the [default] section to [global] in the servers config file
* compression option is now http-compression and lives in servers file
src/subversion/CHANGES view on Meta::CPAN
* stringbuf cleanups and bugfixes
* interface to svn_wc_entry_t cleaned up
* tweaks to build system and freebsd port
* miscellaneous bugfixes in path escaping, pool usage, hp-ux compilation
Version 0.10.1 (released 17 Mar 2002, revision 1537)
User-visible changes:
* New --targets command-line option for some commands.
* conflicts now create conflict-markers in files, and 3 fulltext backups.
* new 'svn resolve' command removes conflicted state (by removing backups)
Developer-visible changes:
* no more dependency on 'patch'; only on GNU diff3 and some version of 'diff'
* complete rewrite of svn_wc_entry_t interface
* begin abstracting svn_fs API by hiding implementation details
* consolidate RA layer callbacks
* start work on commit-driver rewrite
* start work on ~/.subversion/ configuration directory, and proxy support
* move a lot of svn_wc.h into private wc.h
* bugfixes relating to commits, network prop xfers, 'svn log', 'svn co -q'
src/subversion/COMMITTERS view on Meta::CPAN
archiecobbs Archie Cobbs <archie@awarix.com> (svnmerge) [EMAIL
IS BOUNCING]
giovannibajo Giovanni Bajo <rasky@develer.com> (svnmerge)
offby1 Eric Hanchrow <offby1@blarg.net> (doc)
nomis80 Simon Perreault <nomis80@nomis80.org> (svn-clean)
jlvarner Joshua Varner <jlvarner@gmail.com> (doc)
nori Kobayashi Noritada <nori1@dolphin.c.u-tokyo.ac.jp> (Ruby tools,
po: ja) [EMAIL IS
BOUNCING]
mf Martin Furter <mf@apache.org> (svnmirror.sh
svn-backup-dumps.py)
adejong Arthur de Jong <arthur@ch.tudelft.nl> (svn2cl)
wsanchez Wilfredo Sánchez <wsanchez@wsanchez.net> (various contrib)
mhagger Michael Haggerty <mhagger@alum.mit.edu> (svntest)
madanus Madan U S <madan@collab.net> (svnmerge) [EMAIL
IS BOUNCING]
wein Mathias Weinert <wein@mccw.de> (mailer)
bhuvan Bhuvaneswaran A <bhuvan@apache.org> (svn2feed.py,
build/hudson)
aogier Anthony Ogier <aogier@iorga.com> (svn-merge-vendor.py)
dkagedal David KÃ¥gedal <davidk@lysator.liu.se> (dsvn.el)
src/subversion/INSTALL view on Meta::CPAN
Why would you want to do this? Well there are a number of
reasons...
* You may prefer to avoid "polluting" the working copy with
files generated during the build.
* You may want to put the build directory and the working
copy on different physical disks to improve performance.
* You may want to separate source and object code and only
backup the source.
* You may want to remote mount the working copy on multiple
machines, and build for different machines from the same
working copy.
* You may want to build multiple configurations from the
same working copy.
The last reason above is possibly the most useful. For instance
you can have separate debug and optimized builds each using the
src/subversion/build/ltmain.sh view on Meta::CPAN
func_append libobjs " $func_extract_archives_result"
test "X$libobjs" = "X " && libobjs=
fi
fi
if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
eval flag=\"$thread_safe_flag_spec\"
func_append linker_flags " $flag"
fi
# Make a backup of the uninstalled library when relinking
if test relink = "$opt_mode"; then
$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
fi
# Do each of the archive commands.
if test yes = "$module" && test -n "$module_cmds"; then
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
eval test_cmds=\"$module_expsym_cmds\"
cmds=$module_expsym_cmds
else
src/subversion/configure view on Meta::CPAN
# ==== Detection complete - output and run config.status =====================
ac_config_headers="$ac_config_headers subversion/svn_private_config.h.tmp:subversion/svn_private_config.h.in"
ac_config_commands="$ac_config_commands svn_private_config.h.tmp"
ac_config_files="$ac_config_files Makefile"
SVN_CONFIG_SCRIPT_FILES="$SVN_CONFIG_SCRIPT_FILES tools/backup/hot-backup.py"
ac_config_files="$ac_config_files tools/backup/hot-backup.py"
SVN_CONFIG_SCRIPT_FILES="$SVN_CONFIG_SCRIPT_FILES tools/hook-scripts/commit-access-control.pl"
ac_config_files="$ac_config_files tools/hook-scripts/commit-access-control.pl"
SVN_CONFIG_SCRIPT_FILES="$SVN_CONFIG_SCRIPT_FILES subversion/bindings/swig/perl/native/Makefile.PL"
ac_config_files="$ac_config_files subversion/bindings/swig/perl/native/Makefile.PL"
if test -e packages/solaris/pkginfo.in; then
src/subversion/configure view on Meta::CPAN
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Handling of arguments.
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"subversion/svn_private_config.h.tmp") CONFIG_HEADERS="$CONFIG_HEADERS subversion/svn_private_config.h.tmp:subversion/svn_private_config.h.in" ;;
"svn_private_config.h.tmp") CONFIG_COMMANDS="$CONFIG_COMMANDS svn_private_config.h.tmp" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"tools/backup/hot-backup.py") CONFIG_FILES="$CONFIG_FILES tools/backup/hot-backup.py" ;;
"tools/hook-scripts/commit-access-control.pl") CONFIG_FILES="$CONFIG_FILES tools/hook-scripts/commit-access-control.pl" ;;
"subversion/bindings/swig/perl/native/Makefile.PL") CONFIG_FILES="$CONFIG_FILES subversion/bindings/swig/perl/native/Makefile.PL" ;;
"packages/solaris/pkginfo") CONFIG_FILES="$CONFIG_FILES packages/solaris/pkginfo" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
# If the user did not use the arguments to specify the items to instantiate,
src/subversion/configure view on Meta::CPAN
compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
# ### END LIBTOOL TAG CONFIG: CXX
_LT_EOF
;;
"svn_private_config.h.tmp":C) svn_cf=subversion/svn_private_config.h;
$SED -e "s/@SVN_DB_HEADER@/$SVN_DB_HEADER/" $svn_cf.tmp > $svn_cf.tmp.new
cmp -s $svn_cf.tmp.new $svn_cf || mv -f $svn_cf.tmp.new $svn_cf
rm -f $svn_cf.tmp.new $svn_cf.tmp ;;
"tools/backup/hot-backup.py":F) chmod +x tools/backup/hot-backup.py ;;
"tools/hook-scripts/commit-access-control.pl":F) chmod +x tools/hook-scripts/commit-access-control.pl ;;
"subversion/bindings/swig/perl/native/Makefile.PL":F) chmod +x subversion/bindings/swig/perl/native/Makefile.PL ;;
"packages/solaris/pkginfo":F) chmod +x packages/solaris/pkginfo ;;
esac
done # for ac_tag
as_fn_exit 0
_ACEOF
src/subversion/configure.ac view on Meta::CPAN
AC_CONFIG_HEADERS(subversion/svn_private_config.h.tmp:subversion/svn_private_config.h.in)
AC_CONFIG_COMMANDS([svn_private_config.h.tmp],
[svn_cf=subversion/svn_private_config.h;
$SED -e "s/@SVN_DB_HEADER@/$SVN_DB_HEADER/" $svn_cf.tmp > $svn_cf.tmp.new
cmp -s $svn_cf.tmp.new $svn_cf || mv -f $svn_cf.tmp.new $svn_cf
rm -f $svn_cf.tmp.new $svn_cf.tmp],
[SED="$SED"
SVN_DB_HEADER="$SVN_DB_HEADER"])
AC_CONFIG_FILES([Makefile])
SVN_CONFIG_SCRIPT(tools/backup/hot-backup.py)
SVN_CONFIG_SCRIPT(tools/hook-scripts/commit-access-control.pl)
SVN_CONFIG_SCRIPT(subversion/bindings/swig/perl/native/Makefile.PL)
if test -e packages/solaris/pkginfo.in; then
SVN_CONFIG_SCRIPT(packages/solaris/pkginfo)
fi
AC_SUBST(SVN_CONFIG_SCRIPT_FILES)
# Ensure that SWIG is checked after reconfiguration.
rm -f .swig_checked
src/subversion/doc/user/lj_article.txt view on Meta::CPAN
repository creates a completely new filesystem tree, and is
individually labeled with a single, global revision number. Files and
directories which have changed are rewritten (and older versions are
backed up and stored as differences against the latest version), while
unchanged entries are pointed to via a shared-storage mechanism. This
is how the repository is able to version tree structures, not just
file contents.
Finally, it should be mentioned that using a database like Berkeley DB
immediately provides other nice features that Subversion needs: data
integrity, atomic writes, recoverability, and hot backups. (See
www.sleepycat.com for more information.)
--> The network layer.
Subversion has the mark of Apache all over it. At its very core, the
client uses the Apache Portable Runtime (APR) library. (In fact, this
means that Subversion client should compile and run anywhere Apache
httpd does -- right now, this list includes all flavors of Unix,
Win32, BeOS, OS/2, Mac OS X, and possibly Netware.)
src/subversion/subversion/bindings/javahl/native/ClientContext.cpp view on Meta::CPAN
is called on the same pool.
The use of this function assumes a proper subpool behavior by its user,
(read: SVNClient) usually per request.
*/
extern "C" {
struct clearctx_baton_t
{
svn_client_ctx_t *ctx;
svn_client_ctx_t *backup;
};
static apr_status_t clear_ctx_ptrs(void *ptr)
{
clearctx_baton_t *bt = reinterpret_cast<clearctx_baton_t*>(ptr);
/* Reset all values to those before overwriting by getContext. */
*bt->ctx = *bt->backup;
return APR_SUCCESS;
}
};
svn_client_ctx_t *
ClientContext::getContext(CommitMessage *message, SVN::Pool &in_pool)
{
apr_pool_t *pool = in_pool.getPool();
src/subversion/subversion/bindings/javahl/native/ClientContext.cpp view on Meta::CPAN
/* Make a temporary copy of ctx to restore at pool cleanup to avoid
leaving references to dangling pointers.
Note that this allows creating a stack of context changes if
the function is invoked multiple times with different pools.
*/
clearctx_baton_t *bt =
reinterpret_cast<clearctx_baton_t *>(apr_pcalloc(pool, sizeof(*bt)));
bt->ctx = ctx;
bt->backup =
reinterpret_cast<svn_client_ctx_t*>(apr_pmemdup(pool, ctx, sizeof(*ctx)));
apr_pool_cleanup_register(in_pool.getPool(), bt, clear_ctx_ptrs,
clear_ctx_ptrs);
if (!ctx->config)
{
const char *configDir = m_configDir.c_str();
if (m_configDir.empty())
configDir = NULL;
SVN_JNI_ERR(svn_config_get_config(&(ctx->config), configDir,
m_pool->getPool()),
NULL);
bt->backup->config = ctx->config;
}
svn_config_t *config =
reinterpret_cast<svn_config_t *>(apr_hash_get(ctx->config,
SVN_CONFIG_CATEGORY_CONFIG,
APR_HASH_KEY_STRING));
/* The whole list of registered providers */
apr_array_header_t *providers;
src/subversion/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java view on Meta::CPAN
/**
* Test the basic SVNClient.update functionality.
* @throws Throwable
*/
public void testBasicUpdate() throws Throwable
{
// build the test setup. Used for the changes
OneTest thisTest = new OneTest();
// build the backup test setup. That is the one that will be updated
OneTest backupTest = thisTest.copy(".backup");
// modify A/mu
File mu = new File(thisTest.getWorkingCopy(), "A/mu");
PrintWriter muWriter = new PrintWriter(new FileOutputStream(mu, true));
muWriter.print("appended mu text");
muWriter.close();
thisTest.getWc().setItemWorkingCopyRevision("A/mu", 2);
thisTest.getWc().setItemContent("A/mu",
thisTest.getWc().getItemContent("A/mu") + "appended mu text");
addExpectedCommitItem(thisTest.getWCPath(),
src/subversion/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java view on Meta::CPAN
CommitItemStateFlags.TextMods);
// commit the changes
checkCommitRevision(thisTest, "wrong revision number from commit", 2,
thisTest.getWCPathSet(), "log msg", Depth.infinity,
false, false, null, null);
// check the status of the working copy
thisTest.checkStatus();
// update the backup test
assertEquals("wrong revision number from update",
update(backupTest), 2);
// set the expected working copy layout for the backup test
backupTest.getWc().setItemWorkingCopyRevision("A/mu", 2);
backupTest.getWc().setItemContent("A/mu",
backupTest.getWc().getItemContent("A/mu") + "appended mu text");
backupTest.getWc().setItemWorkingCopyRevision("A/D/G/rho", 2);
backupTest.getWc().setItemContent("A/D/G/rho",
backupTest.getWc().getItemContent("A/D/G/rho")
+ "new appended text for rho");
// check the status of the working copy of the backup test
backupTest.checkStatus();
}
/**
* Test basic SVNClient.mkdir with URL parameter functionality.
* @throws Throwable
*/
public void testBasicMkdirUrl() throws Throwable
{
// build the test setup.
OneTest thisTest = new OneTest();
src/subversion/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java view on Meta::CPAN
NodeKind.file, CommitItemStateFlags.TextMods);
// commit the changes
checkCommitRevision(thisTest, "wrong revision number from commit", 2,
thisTest.getWCPathSet(), "log msg", Depth.infinity,
false, false, null, null);
// check the status of the first working copy
thisTest.checkStatus();
// create a backup copy of the working copy
OneTest backupTest = thisTest.copy(".backup");
// change the last line of A/mu in the first working copy
muWriter = new PrintWriter(new FileOutputStream(mu, true));
muContent = thisTest.getWc().getItemContent("A/mu");
muWriter.print(" Appended to line 10 of mu");
muContent = muContent + " Appended to line 10 of mu";
muWriter.close();
thisTest.getWc().setItemWorkingCopyRevision("A/mu", 3);
thisTest.getWc().setItemContent("A/mu", muContent);
addExpectedCommitItem(thisTest.getWCPath(),
src/subversion/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java view on Meta::CPAN
CommitItemStateFlags.TextMods);
// commit these changes to the repository
checkCommitRevision(thisTest, "wrong revision number from commit", 3,
thisTest.getWCPathSet(), "log msg", Depth.infinity,
false, false, null, null);
// check the status of the first working copy
thisTest.checkStatus();
// modify the first line of A/mu in the backup working copy
mu = new File(backupTest.getWorkingCopy(), "A/mu");
muWriter = new PrintWriter(new FileOutputStream(mu));
muWriter.print("This is the new line 1 in the backup copy of mu");
muContent = "This is the new line 1 in the backup copy of mu";
for (int i = 2; i < 11; i++)
{
muWriter.print("\nThis is line " + i + " in mu");
muContent = muContent + "\nThis is line " + i + " in mu";
}
muWriter.close();
backupTest.getWc().setItemWorkingCopyRevision("A/mu", 3);
muContent = muContent + " Appended to line 10 of mu";
backupTest.getWc().setItemContent("A/mu", muContent);
backupTest.getWc().setItemTextStatus("A/mu", Status.Kind.modified);
// modify the first line of A/D/G/rho in the backup working copy
rho = new File(backupTest.getWorkingCopy(), "A/D/G/rho");
rhoWriter = new PrintWriter(new FileOutputStream(rho));
rhoWriter.print("This is the new line 1 in the backup copy of rho");
rhoContent = "This is the new line 1 in the backup copy of rho";
for (int i = 2; i < 11; i++)
{
rhoWriter.print("\nThis is line " + i + " in rho");
rhoContent = rhoContent + "\nThis is line " + i + " in rho";
}
rhoWriter.close();
backupTest.getWc().setItemWorkingCopyRevision("A/D/G/rho", 3);
rhoContent = rhoContent + " Appended to line 10 of rho";
backupTest.getWc().setItemContent("A/D/G/rho", rhoContent);
backupTest.getWc().setItemTextStatus("A/D/G/rho", Status.Kind.modified);
// update the backup working copy
assertEquals("wrong revision number from update",
update(backupTest), 3);
// check the status of the backup working copy
backupTest.checkStatus();
}
/**
* Test the basic SVNClient.update functionality with concurrent
* changes in the repository and the working copy that generate
* conflicts.
* @throws Throwable
*/
public void testBasicConflict() throws Throwable
{
// build the first working copy
OneTest thisTest = new OneTest();
// copy the first working copy to the backup working copy
OneTest backupTest = thisTest.copy(".backup");
// append a line to A/mu in the first working copy
File mu = new File(thisTest.getWorkingCopy(), "A/mu");
PrintWriter muWriter = new PrintWriter(new FileOutputStream(mu, true));
String muContent = thisTest.getWc().getItemContent("A/mu");
muWriter.print("\nOriginal appended text for mu");
muContent = muContent + "\nOriginal appended text for mu";
muWriter.close();
thisTest.getWc().setItemWorkingCopyRevision("A/mu", 2);
thisTest.getWc().setItemContent("A/mu", muContent);
src/subversion/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java view on Meta::CPAN
CommitItemStateFlags.TextMods);
// commit the changes in the first working copy
checkCommitRevision(thisTest, "wrong revision number from commit", 2,
thisTest.getWCPathSet(), "log msg", Depth.infinity,
false, false, null, null);
// test the status of the working copy after the commit
thisTest.checkStatus();
// append a different line to A/mu in the backup working copy
mu = new File(backupTest.getWorkingCopy(), "A/mu");
muWriter = new PrintWriter(new FileOutputStream(mu, true));
muWriter.print("\nConflicting appended text for mu");
muContent = "<<<<<<< .mine\nThis is the file 'mu'.\n"+
"Conflicting appended text for mu=======\n"+
"This is the file 'mu'.\n"+
"Original appended text for mu>>>>>>> .r2";
muWriter.close();
backupTest.getWc().setItemWorkingCopyRevision("A/mu", 2);
backupTest.getWc().setItemContent("A/mu", muContent);
backupTest.getWc().setItemTextStatus("A/mu", Status.Kind.conflicted);
backupTest.getWc().addItem("A/mu.r1", "");
backupTest.getWc().setItemNodeKind("A/mu.r1", NodeKind.unknown);
backupTest.getWc().setItemTextStatus("A/mu.r1",
Status.Kind.unversioned);
backupTest.getWc().addItem("A/mu.r2", "");
backupTest.getWc().setItemNodeKind("A/mu.r2", NodeKind.unknown);
backupTest.getWc().setItemTextStatus("A/mu.r2",
Status.Kind.unversioned);
backupTest.getWc().addItem("A/mu.mine", "");
backupTest.getWc().setItemNodeKind("A/mu.mine", NodeKind.unknown);
backupTest.getWc().setItemTextStatus("A/mu.mine",
Status.Kind.unversioned);
// append a different line to A/D/G/rho in the backup working copy
rho = new File(backupTest.getWorkingCopy(), "A/D/G/rho");
rhoWriter = new PrintWriter(new FileOutputStream(rho, true));
rhoWriter.print("\nConflicting appended text for rho");
rhoContent = "<<<<<<< .mine\nThis is the file 'rho'.\n"+
"Conflicting appended text for rho=======\n"+
"his is the file 'rho'.\n"+
"Original appended text for rho>>>>>>> .r2";
rhoWriter.close();
backupTest.getWc().setItemWorkingCopyRevision("A/D/G/rho", 2);
backupTest.getWc().setItemContent("A/D/G/rho", rhoContent);
backupTest.getWc().setItemTextStatus("A/D/G/rho",
Status.Kind.conflicted);
backupTest.getWc().addItem("A/D/G/rho.r1", "");
backupTest.getWc().setItemNodeKind("A/D/G/rho.r1", NodeKind.unknown);
backupTest.getWc().setItemTextStatus("A/D/G/rho.r1",
Status.Kind.unversioned);
backupTest.getWc().addItem("A/D/G/rho.r2", "");
backupTest.getWc().setItemNodeKind("A/D/G/rho.r2", NodeKind.unknown);
backupTest.getWc().setItemTextStatus("A/D/G/rho.r2",
Status.Kind.unversioned);
backupTest.getWc().addItem("A/D/G/rho.mine", "");
backupTest.getWc().setItemNodeKind("A/D/G/rho.mine", NodeKind.unknown);
backupTest.getWc().setItemTextStatus("A/D/G/rho.mine",
Status.Kind.unversioned);
// update the backup working copy from the repository
assertEquals("wrong revision number from update",
update(backupTest), 2);
// check the status of the backup working copy
backupTest.checkStatus();
// flag A/mu as resolved
client.resolve(backupTest.getWCPath()+"/A/mu", Depth.empty,
ConflictResult.Choice.chooseMerged);
backupTest.getWc().setItemTextStatus("A/mu", Status.Kind.modified);
backupTest.getWc().removeItem("A/mu.r1");
backupTest.getWc().removeItem("A/mu.r2");
backupTest.getWc().removeItem("A/mu.mine");
// flag A/D/G/rho as resolved
client.resolve(backupTest.getWCPath()+"/A/D/G/rho", Depth.empty,
ConflictResult.Choice.chooseMerged);
backupTest.getWc().setItemTextStatus("A/D/G/rho",
Status.Kind.modified);
backupTest.getWc().removeItem("A/D/G/rho.r1");
backupTest.getWc().removeItem("A/D/G/rho.r2");
backupTest.getWc().removeItem("A/D/G/rho.mine");
// check the status after the conflicts are flaged as resolved
backupTest.checkStatus();
}
/**
* Test the basic SVNClient.cleanup functionality.
* Without a way to force a lock, this test just verifies
* the method can be called succesfully.
* @throws Throwable
*/
public void testBasicCleanup() throws Throwable
{
src/subversion/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java view on Meta::CPAN
/**
* Test the basic tree conflict functionality.
* @throws Throwable
*/
public void testTreeConflict() throws Throwable
{
// build the test setup. Used for the changes
OneTest thisTest = new OneTest();
WC wc = thisTest.getWc();
// build the backup test setup. That is the one that will be updated
OneTest tcTest = thisTest.copy(".tree-conflict");
// Move files from A/B/E to A/B/F.
Set<String> relPaths = new HashSet<String>(1);
relPaths.add("alpha");
Set<String> srcPaths = new HashSet<String>(1);
for (String fileName : relPaths)
{
srcPaths.add(new File(thisTest.getWorkingCopy(),
src/subversion/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java view on Meta::CPAN
// build the test setup
OneTest thisTest = new OneTest();
File file;
PrintWriter pw;
// ----- TEST CHECKOUT -----
// Use export to make unversioned obstructions for a second
// WC checkout (deleting export target from previous tests
// first if it exists).
String secondWC = thisTest.getWCPath() + ".backup1";
removeDirOrFile(new File(secondWC));
client.doExport(thisTest.getUrl(), secondWC, null, null, false, false,
Depth.infinity, null);
// Make an obstructing file that conflicts with add coming from repos
file = new File(secondWC, "A/B/lambda");
pw = new PrintWriter(new FileOutputStream(file));
pw.print("This is the conflicting obstructiong file 'lambda'.");
pw.close();
// Attempt to checkout backup WC without "--force"...
try
{
// ...should fail
client.checkout(thisTest.getUrl(), secondWC, null, null,
Depth.infinity, false, false);
fail("obstructed checkout should fail by default");
}
catch (ClientException expected)
{
}
// Attempt to checkout backup WC with "--force"
// so obstructions are tolerated
client.checkout(thisTest.getUrl(), secondWC, null, null,
Depth.infinity, false, true);
// Check the WC status, the only status should be a text
// mod to lambda. All the other obstructing files were identical
MyStatusCallback statusCallback = new MyStatusCallback();
client.status(secondWC, Depth.unknown, false, false, false, false,
null, statusCallback);
Status[] secondWCStatus = statusCallback.getStatusArray();
if (!(secondWCStatus.length == 1 &&
secondWCStatus[0].getPath().endsWith("A/B/lambda") &&
secondWCStatus[0].getTextStatus() == Status.Kind.modified &&
secondWCStatus[0].getPropStatus() == Status.Kind.none))
{
fail("Unexpected WC status after co with " +
"unversioned obstructions");
}
// Make a third WC to test obstruction tolerance of sw and up.
OneTest backupTest = thisTest.copy(".backup2");
// ----- TEST UPDATE -----
// r2: Add a file A/D/H/nu
file = new File(thisTest.getWorkingCopy(), "A/D/H/nu");
pw = new PrintWriter(new FileOutputStream(file));
pw.print("This is the file 'nu'.");
pw.close();
client.add(file.getAbsolutePath(), Depth.empty, false, false, false);
addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
"A/D/H/nu", NodeKind.file,
CommitItemStateFlags.TextMods +
CommitItemStateFlags.Add);
assertEquals("wrong revision number from commit",
commit(thisTest, "log msg"), 2);
thisTest.getWc().addItem("A/D/H/nu", "This is the file 'nu'.");
statusCallback = new MyStatusCallback();
client.status(thisTest.getWCPath() + "/A/D/H/nu", Depth.immediates,
false, true, false, false, null, statusCallback);
Status status = statusCallback.getStatusArray()[0];
// Add an unversioned file A/D/H/nu to the backup WC
file = new File(backupTest.getWorkingCopy(), "A/D/H/nu");
pw = new PrintWriter(new FileOutputStream(file));
pw.print("This is the file 'nu'.");
pw.close();
// Attempt to update backup WC without "--force"
try
{
// obstructed update should fail
update(backupTest);
fail("obstructed update should fail by default");
}
catch (ClientException expected)
{
}
// Attempt to update backup WC with "--force"
assertEquals("wrong revision from update",
client.update(backupTest.getWCPathSet(),
null, Depth.infinity, false, false,
true)[0],
2);
// ----- TEST SWITCH -----
// Add an unversioned file A/B/E/nu to the backup WC
// The file differs from A/D/H/nu
file = new File(backupTest.getWorkingCopy(), "A/B/E/nu");
pw = new PrintWriter(new FileOutputStream(file));
pw.print("This is yet another file 'nu'.");
pw.close();
// Add an unversioned file A/B/E/chi to the backup WC
// The file is identical to A/D/H/chi.
file = new File(backupTest.getWorkingCopy(), "A/B/E/chi");
pw = new PrintWriter(new FileOutputStream(file));
pw.print("This is the file 'chi'.");
pw.close();
// Attempt to switch A/B/E to A/D/H without "--force"
try
{
// obstructed switch should fail
client.doSwitch(backupTest.getWCPath() + "/A/B/E",
backupTest.getUrl() + "/A/D/H",
null, Revision.HEAD, Depth.files, false, false,
false);
fail("obstructed switch should fail by default");
}
catch (ClientException expected)
{
}
// Complete the switch using "--force" and check the status
client.doSwitch(backupTest.getWCPath() + "/A/B/E",
backupTest.getUrl() + "/A/D/H",
Revision.HEAD, Revision.HEAD, Depth.infinity,
false, false, true);
backupTest.getWc().setItemIsSwitched("A/B/E",true);
backupTest.getWc().removeItem("A/B/E/alpha");
backupTest.getWc().removeItem("A/B/E/beta");
backupTest.getWc().addItem("A/B/E/nu",
"This is yet another file 'nu'.");
backupTest.getWc().setItemTextStatus("A/B/E/nu", Status.Kind.modified);
backupTest.getWc().addItem("A/D/H/nu",
"This is the file 'nu'.");
backupTest.getWc().addItem("A/B/E/chi",
backupTest.getWc().getItemContent("A/D/H/chi"));
backupTest.getWc().addItem("A/B/E/psi",
backupTest.getWc().getItemContent("A/D/H/psi"));
backupTest.getWc().addItem("A/B/E/omega",
backupTest.getWc().getItemContent("A/D/H/omega"));
backupTest.checkStatus();
}*/
/**
* Test basic blame functionality. This test marginally tests blame
* correctness, mainly just that the blame APIs link correctly.
* @throws Throwable
* @since 1.5
*/
public void testBasicBlame() throws Throwable
{
src/subversion/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java view on Meta::CPAN
/**
* Test the basic SVNClient.update functionality.
* @throws Throwable
*/
public void testBasicUpdate() throws Throwable
{
// build the test setup. Used for the changes
OneTest thisTest = new OneTest();
// build the backup test setup. That is the one that will be updated
OneTest backupTest = thisTest.copy(".backup");
// modify A/mu
File mu = new File(thisTest.getWorkingCopy(), "A/mu");
PrintWriter muWriter = new PrintWriter(new FileOutputStream(mu, true));
muWriter.print("appended mu text");
muWriter.close();
thisTest.getWc().setItemWorkingCopyRevision("A/mu", 2);
thisTest.getWc().setItemContent("A/mu",
thisTest.getWc().getItemContent("A/mu") + "appended mu text");
addExpectedCommitItem(thisTest.getWCPath(),
src/subversion/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java view on Meta::CPAN
// commit the changes
assertEquals("wrong revision number from commit",
client.commit(new String[]{thisTest.getWCPath()},
"log msg",
true),
2);
// check the status of the working copy
thisTest.checkStatus();
// update the backup test
assertEquals("wrong revision number from update",
client.update(backupTest.getWCPath(), null, true),
2);
// set the expected working copy layout for the backup test
backupTest.getWc().setItemWorkingCopyRevision("A/mu", 2);
backupTest.getWc().setItemContent("A/mu",
backupTest.getWc().getItemContent("A/mu") + "appended mu text");
backupTest.getWc().setItemWorkingCopyRevision("A/D/G/rho", 2);
backupTest.getWc().setItemContent("A/D/G/rho",
backupTest.getWc().getItemContent("A/D/G/rho")
+ "new appended text for rho");
// check the status of the working copy of the backup test
backupTest.checkStatus();
}
/**
* Test basic SVNClient.mkdir with URL parameter functionality.
* @throws Throwable
*/
public void testBasicMkdirUrl() throws Throwable
{
// build the test setup.
OneTest thisTest = new OneTest();
src/subversion/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java view on Meta::CPAN
// commit the changes
assertEquals("wrong revision number from commit",
client.commit(new String[]{thisTest.getWCPath()},
"log msg",
true),
2);
// check the status of the first working copy
thisTest.checkStatus();
// create a backup copy of the working copy
OneTest backupTest = thisTest.copy(".backup");
// change the last line of A/mu in the first working copy
muWriter = new PrintWriter(new FileOutputStream(mu, true));
muContent = thisTest.getWc().getItemContent("A/mu");
muWriter.print(" Appended to line 10 of mu");
muContent = muContent + " Appended to line 10 of mu";
muWriter.close();
thisTest.getWc().setItemWorkingCopyRevision("A/mu", 3);
thisTest.getWc().setItemContent("A/mu", muContent);
addExpectedCommitItem(thisTest.getWCPath(),
src/subversion/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java view on Meta::CPAN
// commit these changes to the repository
assertEquals("wrong revision number from commit",
client.commit(new String[]{thisTest.getWCPath()},
"log msg",
true),
3);
// check the status of the first working copy
thisTest.checkStatus();
// modify the first line of A/mu in the backup working copy
mu = new File(backupTest.getWorkingCopy(), "A/mu");
muWriter = new PrintWriter(new FileOutputStream(mu));
muWriter.print("This is the new line 1 in the backup copy of mu");
muContent = "This is the new line 1 in the backup copy of mu";
for (int i = 2; i < 11; i++)
{
muWriter.print("\nThis is line " + i + " in mu");
muContent = muContent + "\nThis is line " + i + " in mu";
}
muWriter.close();
backupTest.getWc().setItemWorkingCopyRevision("A/mu", 3);
muContent = muContent + " Appended to line 10 of mu";
backupTest.getWc().setItemContent("A/mu", muContent);
backupTest.getWc().setItemTextStatus("A/mu", Status.Kind.modified);
// modify the first line of A/D/G/rho in the backup working copy
rho = new File(backupTest.getWorkingCopy(), "A/D/G/rho");
rhoWriter = new PrintWriter(new FileOutputStream(rho));
rhoWriter.print("This is the new line 1 in the backup copy of rho");
rhoContent = "This is the new line 1 in the backup copy of rho";
for (int i = 2; i < 11; i++)
{
rhoWriter.print("\nThis is line " + i + " in rho");
rhoContent = rhoContent + "\nThis is line " + i + " in rho";
}
rhoWriter.close();
backupTest.getWc().setItemWorkingCopyRevision("A/D/G/rho", 3);
rhoContent = rhoContent + " Appended to line 10 of rho";
backupTest.getWc().setItemContent("A/D/G/rho", rhoContent);
backupTest.getWc().setItemTextStatus("A/D/G/rho", Status.Kind.modified);
// update the backup working copy
assertEquals("wrong revision number from update",
client.update(backupTest.getWCPath(), null, true),
3);
// check the status of the backup working copy
backupTest.checkStatus();
}
/**
* Test the basic SVNClient.update functionality with concurrent
* changes in the repository and the working copy that generate
* conflicts.
* @throws Throwable
*/
public void testBasicConflict() throws Throwable
{
// build the first working copy
OneTest thisTest = new OneTest();
// copy the first working copy to the backup working copy
OneTest backupTest = thisTest.copy(".backup");
// append a line to A/mu in the first working copy
File mu = new File(thisTest.getWorkingCopy(), "A/mu");
PrintWriter muWriter = new PrintWriter(new FileOutputStream(mu, true));
String muContent = thisTest.getWc().getItemContent("A/mu");
muWriter.print("\nOriginal appended text for mu");
muContent = muContent + "\nOriginal appended text for mu";
muWriter.close();
thisTest.getWc().setItemWorkingCopyRevision("A/mu", 2);
thisTest.getWc().setItemContent("A/mu", muContent);
src/subversion/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java view on Meta::CPAN
// commit the changes in the first working copy
assertEquals("wrong revision number from commit",
client.commit(new String[]{thisTest.getWCPath()},
"log msg",
true),
2);
// test the status of the working copy after the commit
thisTest.checkStatus();
// append a different line to A/mu in the backup working copy
mu = new File(backupTest.getWorkingCopy(), "A/mu");
muWriter = new PrintWriter(new FileOutputStream(mu, true));
muWriter.print("\nConflicting appended text for mu");
muContent = "<<<<<<< .mine\nThis is the file 'mu'.\n"+
"Conflicting appended text for mu=======\n"+
"This is the file 'mu'.\n"+
"Original appended text for mu>>>>>>> .r2";
muWriter.close();
backupTest.getWc().setItemWorkingCopyRevision("A/mu", 2);
backupTest.getWc().setItemContent("A/mu", muContent);
backupTest.getWc().setItemTextStatus("A/mu", Status.Kind.conflicted);
backupTest.getWc().addItem("A/mu.r1", "");
backupTest.getWc().setItemNodeKind("A/mu.r1", NodeKind.unknown);
backupTest.getWc().setItemTextStatus("A/mu.r1",
Status.Kind.unversioned);
backupTest.getWc().addItem("A/mu.r2", "");
backupTest.getWc().setItemNodeKind("A/mu.r2", NodeKind.unknown);
backupTest.getWc().setItemTextStatus("A/mu.r2",
Status.Kind.unversioned);
backupTest.getWc().addItem("A/mu.mine", "");
backupTest.getWc().setItemNodeKind("A/mu.mine", NodeKind.unknown);
backupTest.getWc().setItemTextStatus("A/mu.mine",
Status.Kind.unversioned);
// append a different line to A/D/G/rho in the backup working copy
rho = new File(backupTest.getWorkingCopy(), "A/D/G/rho");
rhoWriter = new PrintWriter(new FileOutputStream(rho, true));
rhoWriter.print("\nConflicting appended text for rho");
rhoContent = "<<<<<<< .mine\nThis is the file 'rho'.\n"+
"Conflicting appended text for rho=======\n"+
"his is the file 'rho'.\n"+
"Original appended text for rho>>>>>>> .r2";
rhoWriter.close();
backupTest.getWc().setItemWorkingCopyRevision("A/D/G/rho", 2);
backupTest.getWc().setItemContent("A/D/G/rho", rhoContent);
backupTest.getWc().setItemTextStatus("A/D/G/rho",
Status.Kind.conflicted);
backupTest.getWc().addItem("A/D/G/rho.r1", "");
backupTest.getWc().setItemNodeKind("A/D/G/rho.r1", NodeKind.unknown);
backupTest.getWc().setItemTextStatus("A/D/G/rho.r1",
Status.Kind.unversioned);
backupTest.getWc().addItem("A/D/G/rho.r2", "");
backupTest.getWc().setItemNodeKind("A/D/G/rho.r2", NodeKind.unknown);
backupTest.getWc().setItemTextStatus("A/D/G/rho.r2",
Status.Kind.unversioned);
backupTest.getWc().addItem("A/D/G/rho.mine", "");
backupTest.getWc().setItemNodeKind("A/D/G/rho.mine", NodeKind.unknown);
backupTest.getWc().setItemTextStatus("A/D/G/rho.mine",
Status.Kind.unversioned);
// update the backup working copy from the repository
assertEquals("wrong revision number from update",
client.update(backupTest.getWCPath(), null, true),
2);
// check the status of the backup working copy
backupTest.checkStatus();
// flag A/mu as resolved
client.resolved(backupTest.getWCPath()+"/A/mu", false);
backupTest.getWc().setItemTextStatus("A/mu", Status.Kind.modified);
backupTest.getWc().removeItem("A/mu.r1");
backupTest.getWc().removeItem("A/mu.r2");
backupTest.getWc().removeItem("A/mu.mine");
// flag A/D/G/rho as resolved
client.resolved(backupTest.getWCPath()+"/A/D/G/rho", false);
backupTest.getWc().setItemTextStatus("A/D/G/rho",
Status.Kind.modified);
backupTest.getWc().removeItem("A/D/G/rho.r1");
backupTest.getWc().removeItem("A/D/G/rho.r2");
backupTest.getWc().removeItem("A/D/G/rho.mine");
// check the status after the conflicts are flaged as resolved
backupTest.checkStatus();
}
/**
* Test the basic SVNClient.cleanup functionality.
* Without a way to force a lock, this test just verifies
* the method can be called succesfully.
* @throws Throwable
*/
public void testBasicCleanup() throws Throwable
{
src/subversion/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java view on Meta::CPAN
/**
* Test the basic tree conflict functionality.
* @throws Throwable
*/
public void testTreeConflict() throws Throwable
{
// build the test setup. Used for the changes
OneTest thisTest = new OneTest();
WC wc = thisTest.getWc();
// build the backup test setup. That is the one that will be updated
OneTest tcTest = thisTest.copy(".tree-conflict");
// Move files from A/B/E to A/B/F.
String[] srcPaths = { "alpha" };
for (int i = 0; i < srcPaths.length; i++)
{
String fileName = srcPaths[i];
srcPaths[i] = new File(thisTest.getWorkingCopy(),
"A/B/E/" + fileName).getPath();
src/subversion/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/BasicTests.java view on Meta::CPAN
// build the test setup
OneTest thisTest = new OneTest();
File file;
PrintWriter pw;
// ----- TEST CHECKOUT -----
// Use export to make unversioned obstructions for a second
// WC checkout (deleting export target from previous tests
// first if it exists).
String secondWC = thisTest.getWCPath() + ".backup1";
removeDirOrFile(new File(secondWC));
client.doExport(thisTest.getUrl(), secondWC, null, false);
// Make an obstructing file that conflicts with add coming from repos
file = new File(secondWC, "A/B/lambda");
pw = new PrintWriter(new FileOutputStream(file));
pw.print("This is the conflicting obstructiong file 'lambda'.");
pw.close();
// Attempt to checkout backup WC without "--force"...
try
{
// ...should fail
client.checkout(thisTest.getUrl(), secondWC, null, null,
Depth.infinity, false, false);
fail("obstructed checkout should fail by default");
}
catch (ClientException expected)
{
}
// Attempt to checkout backup WC with "--force"
// so obstructions are tolerated
client.checkout(thisTest.getUrl(), secondWC, null, null,
Depth.infinity, false, true);
// Check the WC status, the only status should be a text
// mod to lambda. All the other obstructing files were identical
Status[] secondWCStatus = client.status(secondWC, true, false,
false, false, false);
if (!(secondWCStatus.length == 1 &&
secondWCStatus[0].getPath().endsWith("A/B/lambda") &&
secondWCStatus[0].getTextStatus() == StatusKind.modified &&
secondWCStatus[0].getPropStatus() == StatusKind.none))
{
fail("Unexpected WC status after co with " +
"unversioned obstructions");
}
// Make a third WC to test obstruction tolerance of sw and up.
OneTest backupTest = thisTest.copy(".backup2");
// ----- TEST UPDATE -----
// r2: Add a file A/D/H/nu
file = new File(thisTest.getWorkingCopy(), "A/D/H/nu");
pw = new PrintWriter(new FileOutputStream(file));
pw.print("This is the file 'nu'.");
pw.close();
client.add(file.getAbsolutePath(), false);
addExpectedCommitItem(thisTest.getWCPath(), thisTest.getUrl(),
"A/D/H/nu", NodeKind.file,
CommitItemStateFlags.TextMods +
CommitItemStateFlags.Add);
assertEquals("wrong revision number from commit",
client.commit(new String[] {thisTest.getWCPath()},
"log msg", true), 2);
thisTest.getWc().addItem("A/D/H/nu", "This is the file 'nu'.");
Status status = client.singleStatus(thisTest.getWCPath() +
"/A/D/H/nu",
false);
// Add an unversioned file A/D/H/nu to the backup WC
file = new File(backupTest.getWorkingCopy(), "A/D/H/nu");
pw = new PrintWriter(new FileOutputStream(file));
pw.print("This is the file 'nu'.");
pw.close();
// Attempt to update backup WC without "--force"
try
{
// obstructed update should fail
client.update(backupTest.getWCPath(), null, true);
fail("obstructed update should fail by default");
}
catch (ClientException expected)
{
}
// Attempt to update backup WC with "--force"
assertEquals("wrong revision from update",
client.update(backupTest.getWCPath(),
null, Depth.infinity, false, false, true),
2);
// ----- TEST SWITCH -----
// Add an unversioned file A/B/E/nu to the backup WC
// The file differs from A/D/H/nu
file = new File(backupTest.getWorkingCopy(), "A/B/E/nu");
pw = new PrintWriter(new FileOutputStream(file));
pw.print("This is yet another file 'nu'.");
pw.close();
// Add an unversioned file A/B/E/chi to the backup WC
// The file is identical to A/D/H/chi.
file = new File(backupTest.getWorkingCopy(), "A/B/E/chi");
pw = new PrintWriter(new FileOutputStream(file));
pw.print("This is the file 'chi'.");
pw.close();
// Attempt to switch A/B/E to A/D/H without "--force"
try
{
// obstructed switch should fail
client.doSwitch(backupTest.getWCPath() + "/A/B/E",
backupTest.getUrl() + "/A/D/H",
null, true);
fail("obstructed switch should fail by default");
}
catch (ClientException expected)
{
}
// Complete the switch using "--force" and check the status
client.doSwitch(backupTest.getWCPath() + "/A/B/E",
backupTest.getUrl() + "/A/D/H",
Revision.HEAD, Revision.HEAD, Depth.infinity,
false, false, true);
backupTest.getWc().setItemIsSwitched("A/B/E",true);
backupTest.getWc().removeItem("A/B/E/alpha");
backupTest.getWc().removeItem("A/B/E/beta");
backupTest.getWc().addItem("A/B/E/nu",
"This is yet another file 'nu'.");
backupTest.getWc().setItemTextStatus("A/B/E/nu", Status.Kind.modified);
backupTest.getWc().addItem("A/D/H/nu",
"This is the file 'nu'.");
backupTest.getWc().addItem("A/B/E/chi",
backupTest.getWc().getItemContent("A/D/H/chi"));
backupTest.getWc().addItem("A/B/E/psi",
backupTest.getWc().getItemContent("A/D/H/psi"));
backupTest.getWc().addItem("A/B/E/omega",
backupTest.getWc().getItemContent("A/D/H/omega"));
backupTest.checkStatus();
}*/
/**
* Test basic blame functionality. This test marginally tests blame
* correctness, mainly just that the blame APIs link correctly.
* @throws Throwable
* @since 1.5
*/
public void testBasicBlame() throws Throwable
{
src/subversion/subversion/bindings/swig/ruby/test/test_fs.rb view on Meta::CPAN
end
def assert_hotcopy
log = "sample log"
file = "hello.txt"
path = File.join(@wc_path, file)
FileUtils.touch(path)
rev = nil
backup_path = make_context(log) do |ctx|
ctx.add(path)
commit_info = ctx.commit(@wc_path)
rev = commit_info.revision
assert_equal(log, ctx.log_message(path, rev))
backup_path = File.join(@tmp_path, "back")
end
fs_path = @fs.path
@fs.close
@fs = nil
@repos.close
@repos = nil
FileUtils.mv(fs_path, backup_path)
FileUtils.mkdir_p(fs_path)
make_context(log) do |ctx|
assert_raises(Svn::Error::RaLocalReposOpenFailed) do
ctx.log_message(path, rev)
end
yield(backup_path, fs_path)
assert_equal(log, ctx.log_message(path, rev))
end
end
def test_hotcopy
assert_hotcopy do |src, dest|
Svn::Fs.hotcopy(src, dest)
end
end
src/subversion/subversion/bindings/swig/ruby/test/test_repos.rb view on Meta::CPAN
rev = make_context(log) do |ctx|
ctx.add(path)
commit_info = ctx.commit(@wc_path)
rev = commit_info.revision
assert_equal(log, ctx.log_message(path, rev))
rev
end
dest_path = File.join(@tmp_path, "dest")
backup_path = File.join(@tmp_path, "back")
config = {}
fs_config = {}
dest_repos = Svn::Repos.create(dest_path, config, fs_config)
dest_repos.fs.set_warning_func(&warning_func)
dest_repos_path = dest_repos.path
dest_repos.close
FileUtils.mv(test_repos_path, backup_path)
FileUtils.mv(dest_repos_path, test_repos_path)
make_context(log) do |ctx|
assert_raises(Svn::Error::FsNoSuchRevision) do
assert_equal(log, ctx.log_message(path, rev))
end
FileUtils.rm_r(test_repos_path)
Svn::Repos.hotcopy(backup_path, test_repos_path)
assert_equal(log, ctx.log_message(path, rev))
end
end
def assert_transaction
log = "sample log"
make_context(log) do |ctx|
ctx.checkout(@repos_uri, @wc_path)
ctx.mkdir(["#{@wc_path}/new_dir"])
src/subversion/subversion/include/private/svn_wc_private.h view on Meta::CPAN
*
* #svn_wc_conflict_choose_theirs_conflict and
* #svn_wc_conflict_choose_mine_conflict are not legal for binary
* files or properties.
*
* @a wc_ctx is a working copy context, with a write lock, for @a
* local_abspath.
*
* The implementation details are opaque, as our "conflicted" criteria
* might change over time. (At the moment, this routine removes the
* three fulltext 'backup' files and any .prej file created in a conflict,
* and modifies @a local_abspath's entry.)
*
* If @a local_abspath is not under version control and not a tree
* conflict, return #SVN_ERR_ENTRY_NOT_FOUND. If @a path isn't in a
* state of conflict to begin with, do nothing, and return #SVN_NO_ERROR.
*
* If @c local_abspath was successfully taken out of a state of conflict,
* report this information to @c notify_func (if non-@c NULL.) If only
* text, only property, or only tree conflict resolution was requested,
* and it was successful, then success gets reported.
src/subversion/subversion/include/svn_fs.h view on Meta::CPAN
/**
* Return, in @a *fs_type, a string identifying the back-end type of
* the Subversion filesystem located in @a path. Allocate @a *fs_type
* in @a pool.
*
* The string should be equal to one of the @c SVN_FS_TYPE_* defined
* constants, unless the filesystem is a new back-end type added in
* a later version of Subversion.
*
* In general, the type should make no difference in the filesystem's
* semantics, but there are a few situations (such as backups) where
* it might matter.
*
* @since New in 1.3.
*/
svn_error_t *
svn_fs_type(const char **fs_type,
const char *path,
apr_pool_t *pool);
/**
src/subversion/subversion/include/svn_io.h view on Meta::CPAN
/** Return a generic read-only stream connected to string @a str.
* Allocate the stream in @a pool.
*/
svn_stream_t *
svn_stream_from_string(const svn_string_t *str,
apr_pool_t *pool);
/** Return a generic stream which implements buffered reads and writes.
* The stream will preferentially store data in-memory, but may use
* disk storage as backup if the amount of data is large.
* Allocate the stream in @a result_pool
*
* @since New in 1.8.
*/
svn_stream_t *
svn_stream_buffered(apr_pool_t *result_pool);
/** Return a stream that decompresses all data read and compresses all
* data written. The stream @a stream is used to read and write all
* compressed data. All compression data structures are allocated on
src/subversion/subversion/include/svn_repos.h view on Meta::CPAN
* structure of the filesystem -- independent of any internal node-id
* schema or database back-end. All of the data in the dumpfile is
* acquired by public function calls into svn_fs.h. Similarly, the
* parser which reads the dumpfile is able to reconstruct the
* filesystem using only public svn_fs.h routines.
*
* Thus the dump/load feature's main purpose is for *migrating* data
* from one svn filesystem to another -- presumably two filesystems
* which have different internal implementations.
*
* If you simply want to backup your filesystem, you're probably
* better off using the built-in facilities of the DB backend (using
* Berkeley DB's hot-backup feature, for example.)
*
* For a description of the dumpfile format, see
* /trunk/notes/fs_dumprestore.txt.
*/
/* The RFC822-style headers in our dumpfile format. */
#define SVN_REPOS_DUMPFILE_MAGIC_HEADER "SVN-fs-dump-format-version"
#define SVN_REPOS_DUMPFILE_FORMAT_VERSION 3
#define SVN_REPOS_DUMPFILE_FORMAT_VERSION_DELTAS 3
#define SVN_REPOS_DUMPFILE_UUID "UUID"
src/subversion/subversion/include/svn_wc.h view on Meta::CPAN
/** A choice to either delay the conflict resolution or select a
particular file to resolve the conflict. */
svn_wc_conflict_choice_t choice;
/** If not NULL, this is a path to a file which contains the client's
(or more likely, the user's) merging of the three values in
conflict. libsvn_wc accepts this file if (and only if) @c choice
is set to #svn_wc_conflict_choose_merged.*/
const char *merged_file;
/** If true, save a backup copy of merged_file (or the original
merged_file from the conflict description, if merged_file is
NULL) in the user's working copy. */
svn_boolean_t save_merged;
} svn_wc_conflict_result_t;
/**
* Allocate an #svn_wc_conflict_result_t structure in @a pool,
* initialize and return it.
src/subversion/subversion/include/svn_wc.h view on Meta::CPAN
* @a wc_ctx is a working copy context, with a write lock, for @a
* local_abspath.
*
* Needless to say, this function doesn't touch conflict markers or
* anything of that sort -- only a human can semantically resolve a
* conflict. Instead, this function simply marks a file as "having
* been resolved", clearing the way for a commit.
*
* The implementation details are opaque, as our "conflicted" criteria
* might change over time. (At the moment, this routine removes the
* three fulltext 'backup' files and any .prej file created in a conflict,
* and modifies @a local_abspath's entry.)
*
* If @a local_abspath is not under version control and not a tree
* conflict, return #SVN_ERR_ENTRY_NOT_FOUND. If @a path isn't in a
* state of conflict to begin with, do nothing, and return #SVN_NO_ERROR.
*
* If @c local_abspath was successfully taken out of a state of conflict,
* report this information to @c notify_func (if non-@c NULL.) If only
* text, only property, or only tree conflict resolution was requested,
* and it was successful, then success gets reported.
src/subversion/subversion/include/svn_wc.h view on Meta::CPAN
* @a target_abspath, labeled with @a left_label, @a right_label, and
* @a target_label. (If any of these labels are @c NULL, default
* values will be used.)
*
* * Copy @a left_abspath, @a right_abspath, and the original @a
* target_abspath to unique names in the same directory as @a
* target_abspath, ending with the suffixes ".LEFT_LABEL", ".RIGHT_LABEL",
* and ".TARGET_LABEL" respectively.
*
* * Mark @a target_abspath as "text-conflicted", and track the above
* mentioned backup files as well.
*
* * If @a left_version and/or @a right_version are not NULL, provide
* these values to the conflict handler and track these while the conflict
* exists.
*
* Binary case:
*
* If @a target_abspath is a binary file, then no merging is attempted,
* the merge is deemed to be a conflict. If @a dry_run is @c FALSE the
* working @a target_abspath is untouched, and copies of @a left_abspath and
* @a right_abspath are created next to it using @a left_label and
* @a right_label. @a target_abspath is marked as "text-conflicted", and
* begins tracking the two backup files and the version information.
*
* If @a dry_run is @c TRUE no files are changed. The outcome of the merge
* is returned in @a *merge_content_outcome.
* ### (and what about @a *merge_props_state?)
*
* ### BH: Two kinds of outcome is not how it should be.
*
* ### For text, we report the outcome as 'merged' if there was some
* incoming change that we dealt with (even if we decided to no-op?)
* but the callers then convert this outcome into a notification
src/subversion/subversion/libsvn_fs_base/fs.c view on Meta::CPAN
"#\n"
"# Make sure you read the documentation at:\n"
"#\n"
"# http://docs.oracle.com/cd/E17076_02/html/api_reference/C/envset_lg_bsize.html\n"
"# http://docs.oracle.com/cd/E17076_02/html/api_reference/C/envset_lg_max.html\n"
"# http://docs.oracle.com/cd/E17076_02/html/programmer_reference/log_limits.html\n"
"#\n"
"# Increase the size of the in-memory log buffer from the default\n"
"# of 32 Kbytes to 256 Kbytes. Decrease the log file size from\n"
"# 10 Mbytes to 1 Mbyte. This will help reduce the amount of disk\n"
"# space required for hot backups. The size of the log file must be\n"
"# at least four times the size of the in-memory log buffer.\n"
"#\n"
"# Note: Decreasing the in-memory buffer size below 256 Kbytes will hurt\n"
"# hurt commit performance. For details, see:\n"
"#\n"
"# http://svn.haxx.se/dev/archive-2002-02/0141.shtml\n"
"#\n"
"set_lg_bsize 262144\n"
"set_lg_max 1048576\n"
"#\n"
src/subversion/subversion/libsvn_fs_base/fs.c view on Meta::CPAN
return svn_fs_bdb__close(bdb);
}
/* Copying a live Berkeley DB-base filesystem. */
/**
* Delete all unused log files from DBD enviroment at @a live_path that exist
* in @a backup_path.
*/
static svn_error_t *
svn_fs_base__clean_logs(const char *live_path,
const char *backup_path,
apr_pool_t *pool)
{
apr_array_header_t *logfiles;
SVN_ERR(base_bdb_logfiles(&logfiles,
live_path,
TRUE, /* Only unused logs */
pool));
{ /* Process unused logs from live area */
int idx;
apr_pool_t *sub_pool = svn_pool_create(pool);
/* Process log files. */
for (idx = 0; idx < logfiles->nelts; idx++)
{
const char *log_file = APR_ARRAY_IDX(logfiles, idx, const char *);
const char *live_log_path;
const char *backup_log_path;
svn_pool_clear(sub_pool);
live_log_path = svn_dirent_join(live_path, log_file, sub_pool);
backup_log_path = svn_dirent_join(backup_path, log_file, sub_pool);
{ /* Compare files. No point in using MD5 and wasting CPU cycles as we
got full copies of both logs */
svn_boolean_t files_match = FALSE;
svn_node_kind_t kind;
/* Check to see if there is a corresponding log file in the backup
directory */
SVN_ERR(svn_io_check_path(backup_log_path, &kind, pool));
/* If the copy of the log exists, compare them */
if (kind == svn_node_file)
SVN_ERR(svn_io_files_contents_same_p(&files_match,
live_log_path,
backup_log_path,
sub_pool));
/* If log files do not match, go to the next log file. */
if (!files_match)
continue;
}
SVN_ERR(svn_io_remove_file2(live_log_path, FALSE, sub_pool));
}
src/subversion/subversion/libsvn_fs_fs/fs_fs.c view on Meta::CPAN
present is healthy. In other words, we're willing to recover
from a missing or out-of-date db/current file, because db/current
is truly redundant -- it's basically a cache so we don't have to
find max_rev each time, albeit a cache with unusual semantics,
since it also officially defines when a revision goes live. But
if we're missing more than the cache, it's time to back out and
let the admin reconstruct things by hand: correctness at that
point may depend on external things like checking a commit email
list, looking in particular working copies, etc.
This policy matches well with a typical naive backup scenario.
Say you're rsyncing your FSFS repository nightly to the same
location. Once revs and revprops are written, you've got the
maximum rev; if the backup should bomb before db/current is
written, then db/current could stay arbitrarily out-of-date, but
we can still recover. It's a small window, but we might as well
do what we can. */
/* Even if db/current were missing, it would be created with 0 by
get_youngest(), so this conditional remains valid. */
if (youngest_rev > max_rev)
return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
_("Expected current rev to be <= %ld "
"but found %ld"), max_rev, youngest_rev);
src/subversion/subversion/libsvn_repos/repos.c view on Meta::CPAN
const char * lock_file = svn_repos_db_logs_lockfile(repos, pool);
/* Try to create a lock file, in case if it is missing. As in case of the
repositories created before hotcopy functionality. */
svn_error_clear(create_db_logs_lock(repos, pool));
return svn_io_file_lock2(lock_file, exclusive, FALSE, pool);
}
/* Make a copy of a repository with hot backup of fs. */
svn_error_t *
svn_repos_hotcopy2(const char *src_path,
const char *dst_path,
svn_boolean_t clean_logs,
svn_boolean_t incremental,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *pool)
{
svn_repos_t *src_repos;
src/subversion/subversion/libsvn_subr/sqlite.c view on Meta::CPAN
apr_pool_t *scratch_pool)
{
svn_sqlite__db_t *src_db;
SVN_ERR(svn_sqlite__open(&src_db, src_path, svn_sqlite__mode_readonly,
NULL, 0, NULL,
scratch_pool, scratch_pool));
{
svn_sqlite__db_t *dst_db;
sqlite3_backup *backup;
int rc1, rc2;
SVN_ERR(svn_sqlite__open(&dst_db, dst_path, svn_sqlite__mode_rwcreate,
NULL, 0, NULL, scratch_pool, scratch_pool));
backup = sqlite3_backup_init(dst_db->db3, "main", src_db->db3, "main");
if (!backup)
return svn_error_createf(SVN_ERR_SQLITE_ERROR, NULL,
_("SQLite hotcopy failed for %s"), src_path);
do
{
/* Pages are usually 1024 byte (SQLite docs). On my laptop
copying gets faster as the number of pages is increased up
to about 64, beyond that speed levels off. Lets put the
number of pages an order of magnitude higher, this is still
likely to be a fraction of large databases. */
rc1 = sqlite3_backup_step(backup, 1024);
/* Should we sleep on SQLITE_OK? That would make copying a
large database take much longer. When we do sleep how,
long should we sleep? Should the sleep get longer if we
keep getting BUSY/LOCKED? I have no real reason for
choosing 25. */
if (rc1 == SQLITE_BUSY || rc1 == SQLITE_LOCKED)
sqlite3_sleep(25);
}
while (rc1 == SQLITE_OK || rc1 == SQLITE_BUSY || rc1 == SQLITE_LOCKED);
rc2 = sqlite3_backup_finish(backup);
if (rc1 != SQLITE_DONE)
SQLITE_ERR(rc1, dst_db);
SQLITE_ERR(rc2, dst_db);
SVN_ERR(svn_sqlite__close(dst_db));
}
SVN_ERR(svn_sqlite__close(src_db));
return SVN_NO_ERROR;
}
src/subversion/subversion/libsvn_wc/merge.c view on Meta::CPAN
installed props. With 'svn merge', it's no big deal. But
when 'svn up' calls this routine, it needs to make sure that
this routine is using the newest property values that may
have been received *during* the update. Since this routine
will be run from within a log-command, merge_file()
needs to make sure that a previous log-command to 'install
latest props' has already executed first. Ben and I just
checked, and that is indeed the order in which the log items
are written, so everything should be fine. Really. */
/* Create LEFT and RIGHT backup files, in expanded form.
We use TARGET_ABSPATH's current properties to do the translation. */
/* Derive the basenames of the 3 backup files. */
SVN_ERR(svn_wc__wq_build_file_copy_translated(&work_item,
mt->db, mt->local_abspath,
tmp_left, *left_copy,
result_pool, scratch_pool));
*work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
SVN_ERR(svn_wc__wq_build_file_copy_translated(&work_item,
mt->db, mt->local_abspath,
tmp_right, *right_copy,
result_pool, scratch_pool));
src/subversion/subversion/libsvn_wc/merge.c view on Meta::CPAN
const char *right_abspath,
const char *left_label,
const char *right_label,
const char *target_label,
svn_boolean_t dry_run,
const char *detranslated_target_abspath,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
apr_pool_t *pool = scratch_pool; /* ### temporary rename */
/* ### when making the binary-file backups, should we be honoring
keywords and eol stuff? */
const char *left_copy, *right_copy;
const char *merge_dirpath, *merge_filename;
const char *conflict_wrk;
*work_items = NULL;
svn_dirent_split(&merge_dirpath, &merge_filename, mt->local_abspath, pool);
if (dry_run)
{
*merge_outcome = svn_wc_merge_conflict;
return SVN_NO_ERROR;
}
/* reserve names for backups of left and right fulltexts */
SVN_ERR(svn_io_open_uniquely_named(NULL,
&left_copy,
merge_dirpath,
merge_filename,
left_label,
svn_io_file_del_none,
pool, pool));
SVN_ERR(svn_io_open_uniquely_named(NULL,
&right_copy,
merge_dirpath,
merge_filename,
right_label,
svn_io_file_del_none,
pool, pool));
/* create the backup files */
SVN_ERR(svn_io_copy_file(left_abspath, left_copy, TRUE, pool));
SVN_ERR(svn_io_copy_file(right_abspath, right_copy, TRUE, pool));
/* Was the merge target detranslated? */
if (strcmp(mt->local_abspath, detranslated_target_abspath) != 0)
{
/* Create a .mine file too */
SVN_ERR(svn_io_open_uniquely_named(NULL,
&conflict_wrk,
merge_dirpath,
src/subversion/subversion/libsvn_wc/merge.c view on Meta::CPAN
detranslated_target_abspath,
conflict_wrk,
pool, result_pool));
}
else
{
conflict_wrk = NULL;
}
/* Mark target_abspath's entry as "Conflicted", and start tracking
the backup files in the entry as well. */
if (!*conflict_skel)
*conflict_skel = svn_wc__conflict_skel_create(result_pool);
SVN_ERR(svn_wc__conflict_skel_add_text_conflict(*conflict_skel,
mt->db, mt->local_abspath,
conflict_wrk,
left_copy,
right_copy,
result_pool, scratch_pool));
src/subversion/subversion/libsvn_wc/update_editor.c view on Meta::CPAN
eb->db, fb->local_abspath,
FALSE /* exact_comparison */,
scratch_pool));
}
/* For 'textual' merging, we use the following system:
When a file is modified and we have a new BASE:
- For text files
* svn_wc_merge uses diff3
* possibly makes backups and marks files as conflicted.
- For binary files
* svn_wc_merge makes backups and marks files as conflicted.
If a file is not modified and we have a new BASE:
* Install from pristine.
If we have property changes related to magic properties or if the
svn:keywords property is set:
* Retranslate from the working file.
*/
if (! is_locally_modified
&& fb->new_text_base_sha1_checksum)
src/subversion/subversion/tests/cmdline/basic_tests.py view on Meta::CPAN
#----------------------------------------------------------------------
def basic_update(sbox):
"basic update command"
sbox.build()
wc_dir = sbox.wc_dir
# Make a backup copy of the working copy
wc_backup = sbox.add_wc_path('backup')
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Make a couple of local mods to files
mu_path = sbox.ospath('A/mu')
rho_path = sbox.ospath('A/D/G/rho')
svntest.main.file_append(mu_path, 'appended mu text')
svntest.main.file_append(rho_path, 'new appended text for rho')
# Created expected output tree for 'svn ci'
expected_output = wc.State(wc_dir, {
'A/mu' : Item(verb='Sending'),
src/subversion/subversion/tests/cmdline/basic_tests.py view on Meta::CPAN
# Create expected status tree; all local revisions should be at 1,
# but mu and rho should be at revision 2.
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak('A/mu', 'A/D/G/rho', wc_rev=2)
# Commit.
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
# Create expected output tree for an update of the wc_backup.
expected_output = wc.State(wc_backup, {
'A/mu' : Item(status='U '),
'A/D/G/rho' : Item(status='U '),
})
# Create expected disk tree for the update.
expected_disk = svntest.main.greek_state.copy()
expected_disk.tweak('A/mu',
contents=expected_disk.desc['A/mu'].contents
+ 'appended mu text')
expected_disk.tweak('A/D/G/rho',
contents=expected_disk.desc['A/D/G/rho'].contents
+ 'new appended text for rho')
# Create expected status tree for the update.
expected_status = svntest.actions.get_virginal_state(wc_backup, 2)
# Do the update and check the results in three ways.
svntest.actions.run_and_verify_update(wc_backup,
expected_output,
expected_disk,
expected_status)
# Unversioned paths, those that are not immediate children of a versioned
# path, are skipped and do not raise an error
xx_path = sbox.ospath('xx/xx')
exit_code, out, err = svntest.actions.run_and_verify_svn(
"update xx/xx",
["Skipped '"+xx_path+"'\n",
src/subversion/subversion/tests/cmdline/basic_tests.py view on Meta::CPAN
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak('A/mu', 'A/D/G/rho', wc_rev=2)
# Initial commit.
svntest.actions.run_and_verify_commit(wc_dir,
expected_output,
expected_status,
None,
wc_dir)
# Make a backup copy of the working copy
wc_backup = sbox.add_wc_path('backup')
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Make a couple of local mods to files
svntest.main.file_append(mu_path, ' Appended to line 10 of mu')
svntest.main.file_append(rho_path, ' Appended to line 10 of rho')
# Created expected output tree for 'svn ci'
expected_output = wc.State(wc_dir, {
'A/mu' : Item(verb='Sending'),
'A/D/G/rho' : Item(verb='Sending'),
})
src/subversion/subversion/tests/cmdline/basic_tests.py view on Meta::CPAN
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak('A/mu', 'A/D/G/rho', wc_rev=3)
# Commit.
svntest.actions.run_and_verify_commit(wc_dir,
expected_output,
expected_status,
None,
wc_dir)
# Make local mods to wc_backup by recreating mu and rho
mu_path_backup = os.path.join(wc_backup, 'A', 'mu')
rho_path_backup = os.path.join(wc_backup, 'A', 'D', 'G', 'rho')
# open in 'truncate to zero then write" mode
backup_mu_text = 'This is the new line 1 in the backup copy of mu'
for x in range(2,11):
backup_mu_text = backup_mu_text + '\nThis is line ' + repr(x) + ' in mu'
svntest.main.file_write(mu_path_backup, backup_mu_text, 'w+')
backup_rho_text = 'This is the new line 1 in the backup copy of rho'
for x in range(2,11):
backup_rho_text = backup_rho_text + '\nThis is line ' + repr(x) + ' in rho'
svntest.main.file_write(rho_path_backup, backup_rho_text, 'w+')
# Create expected output tree for an update of the wc_backup.
expected_output = wc.State(wc_backup, {
'A/mu' : Item(status='G '),
'A/D/G/rho' : Item(status='G '),
})
# Create expected disk tree for the update.
expected_disk = svntest.main.greek_state.copy()
expected_disk.tweak('A/mu',
contents=backup_mu_text + ' Appended to line 10 of mu')
expected_disk.tweak('A/D/G/rho',
contents=backup_rho_text + ' Appended to line 10 of rho')
# Create expected status tree for the update.
expected_status = svntest.actions.get_virginal_state(wc_backup, 3)
expected_status.tweak('A/mu', 'A/D/G/rho', status='M ')
# Do the update and check the results in three ways.
svntest.actions.run_and_verify_update(wc_backup,
expected_output,
expected_disk,
expected_status)
#----------------------------------------------------------------------
def basic_conflict(sbox):
"basic conflict creation and resolution"
sbox.build()
wc_dir = sbox.wc_dir
# Make a backup copy of the working copy
wc_backup = sbox.add_wc_path('backup')
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Make a couple of local mods to files which will be committed
mu_path = sbox.ospath('A/mu')
rho_path = sbox.ospath('A/D/G/rho')
svntest.main.file_append(mu_path, 'Original appended text for mu\n')
svntest.main.file_append(rho_path, 'Original appended text for rho\n')
# Make a couple of local mods to files which will be conflicted
mu_path_backup = os.path.join(wc_backup, 'A', 'mu')
rho_path_backup = os.path.join(wc_backup, 'A', 'D', 'G', 'rho')
svntest.main.file_append(mu_path_backup,
'Conflicting appended text for mu\n')
svntest.main.file_append(rho_path_backup,
'Conflicting appended text for rho\n')
# Created expected output tree for 'svn ci'
expected_output = wc.State(wc_dir, {
'A/mu' : Item(verb='Sending'),
'A/D/G/rho' : Item(verb='Sending'),
})
# Create expected status tree; all local revisions should be at 1,
# but mu and rho should be at revision 2.
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak('A/mu', 'A/D/G/rho', wc_rev=2)
# Commit.
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
# Create expected output tree for an update of the wc_backup.
expected_output = wc.State(wc_backup, {
'A/mu' : Item(status='C '),
'A/D/G/rho' : Item(status='C '),
})
# Create expected disk tree for the update.
expected_disk = svntest.main.greek_state.copy()
expected_disk.tweak('A/mu',
contents="\n".join(["This is the file 'mu'.",
"<<<<<<< .mine",
"Conflicting appended text for mu",
src/subversion/subversion/tests/cmdline/basic_tests.py view on Meta::CPAN
expected_disk.tweak('A/D/G/rho',
contents="\n".join(["This is the file 'rho'.",
"<<<<<<< .mine",
"Conflicting appended text for rho",
"=======",
"Original appended text for rho",
">>>>>>> .r2",
""]))
# Create expected status tree for the update.
expected_status = svntest.actions.get_virginal_state(wc_backup, '2')
expected_status.tweak('A/mu', 'A/D/G/rho', status='C ')
# "Extra" files that we expect to result from the conflicts.
# These are expressed as list of regexps. What a cool system! :-)
extra_files = ['mu.*\.r1', 'mu.*\.r2', 'mu.*\.mine',
'rho.*\.r1', 'rho.*\.r2', 'rho.*\.mine',]
# Do the update and check the results in three ways.
# All "extra" files are passed to detect_conflict_files().
svntest.actions.run_and_verify_update(wc_backup,
expected_output,
expected_disk,
expected_status,
None,
svntest.tree.detect_conflict_files,
extra_files)
# verify that the extra_files list is now empty.
if len(extra_files) != 0:
# Because we want to be a well-behaved test, we silently raise if
src/subversion/subversion/tests/cmdline/basic_tests.py view on Meta::CPAN
# uncommented:
#
# logger.warn("Not all extra reject files have been accounted for:")
# logger.warn(extra_files)
### we should raise a less generic error here. which?
raise svntest.Failure
# So now mu and rho are both in a "conflicted" state. Run 'svn
# resolved' on them.
svntest.actions.run_and_verify_resolved([mu_path_backup, rho_path_backup])
# See if they've changed back to plain old 'M' state.
expected_status.tweak('A/mu', 'A/D/G/rho', status='M ')
# There should be *no* extra backup files lying around the working
# copy after resolving the conflict; thus we're not passing a custom
# singleton handler.
svntest.actions.run_and_verify_status(wc_backup, expected_status)
#----------------------------------------------------------------------
def basic_cleanup(sbox):
"basic cleanup command"
sbox.build(read_only = True)
wc_dir = sbox.wc_dir
src/subversion/subversion/tests/cmdline/basic_tests.py view on Meta::CPAN
expected_status)
# Test 2: remotely delete two directories in the same repository
F_url = repo_url + '/A/B/F'
C_url = repo_url + '/A/C'
svntest.actions.run_and_verify_svn(None, None, [],
'rm', '-m', 'log_msg',
F_url, C_url)
# Create expected output tree for an update of wc_backup.
expected_output = svntest.wc.State(wc_dir, {
'A/B/F' : Item(status='D '),
'A/C' : Item(status='D '),
})
# Create expected disk tree for the update
expected_disk.remove('A/B/F', 'A/C')
# Create expected status tree for the update.
expected_status.tweak(wc_rev = 3)
src/subversion/subversion/tests/cmdline/basic_tests.py view on Meta::CPAN
expected_disk,
expected_status)
#-----------------------------------------------------------------------
def automatic_conflict_resolution(sbox):
"automatic conflict resolution"
sbox.build()
wc_dir = sbox.wc_dir
# Make a backup copy of the working copy
wc_backup = sbox.add_wc_path('backup')
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Make a couple of local mods to files which will be committed
mu_path = sbox.ospath('A/mu')
lambda_path = sbox.ospath('A/B/lambda')
rho_path = sbox.ospath('A/D/G/rho')
tau_path = sbox.ospath('A/D/G/tau')
omega_path = sbox.ospath('A/D/H/omega')
svntest.main.file_append(mu_path, 'Original appended text for mu\n')
svntest.main.file_append(lambda_path, 'Original appended text for lambda\n')
svntest.main.file_append(rho_path, 'Original appended text for rho\n')
svntest.main.file_append(tau_path, 'Original appended text for tau\n')
svntest.main.file_append(omega_path, 'Original appended text for omega\n')
# Make a couple of local mods to files which will be conflicted
mu_path_backup = os.path.join(wc_backup, 'A', 'mu')
lambda_path_backup = os.path.join(wc_backup, 'A', 'B', 'lambda')
rho_path_backup = os.path.join(wc_backup, 'A', 'D', 'G', 'rho')
tau_path_backup = os.path.join(wc_backup, 'A', 'D', 'G', 'tau')
omega_path_backup = os.path.join(wc_backup, 'A', 'D', 'H', 'omega')
svntest.main.file_append(mu_path_backup,
'Conflicting appended text for mu\n')
svntest.main.file_append(lambda_path_backup,
'Conflicting appended text for lambda\n')
svntest.main.file_append(rho_path_backup,
'Conflicting appended text for rho\n')
svntest.main.file_append(tau_path_backup,
'Conflicting appended text for tau\n')
svntest.main.file_append(omega_path_backup,
'Conflicting appended text for omega\n')
# Created expected output tree for 'svn ci'
expected_output = wc.State(wc_dir, {
'A/mu' : Item(verb='Sending'),
'A/B/lambda' : Item(verb='Sending'),
'A/D/G/rho' : Item(verb='Sending'),
'A/D/G/tau' : Item(verb='Sending'),
'A/D/H/omega' : Item(verb='Sending'),
})
src/subversion/subversion/tests/cmdline/basic_tests.py view on Meta::CPAN
# Create expected status tree; all local revisions should be at 1,
# but lambda, mu and rho should be at revision 2.
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak('A/mu', 'A/B/lambda', 'A/D/G/rho', 'A/D/G/tau',
'A/D/H/omega', wc_rev=2)
# Commit.
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
# Create expected output tree for an update of the wc_backup.
expected_output = wc.State(wc_backup, {
'A/mu' : Item(status='C '),
'A/B/lambda' : Item(status='C '),
'A/D/G/rho' : Item(status='C '),
'A/D/G/tau' : Item(status='C '),
'A/D/H/omega' : Item(status='C '),
})
# Create expected disk tree for the update.
expected_disk = svntest.main.greek_state.copy()
expected_disk.tweak('A/B/lambda',
src/subversion/subversion/tests/cmdline/basic_tests.py view on Meta::CPAN
expected_disk.tweak('A/D/H/omega',
contents="\n".join(["This is the file 'omega'.",
"<<<<<<< .mine",
"Conflicting appended text for omega",
"=======",
"Original appended text for omega",
">>>>>>> .r2",
""]))
# Create expected status tree for the update.
expected_status = svntest.actions.get_virginal_state(wc_backup, '2')
expected_status.tweak('A/mu', 'A/B/lambda', 'A/D/G/rho', 'A/D/G/tau',
'A/D/H/omega', status='C ')
# "Extra" files that we expect to result from the conflicts.
# These are expressed as list of regexps. What a cool system! :-)
extra_files = ['mu.*\.r1', 'mu.*\.r2', 'mu.*\.mine',
'lambda.*\.r1', 'lambda.*\.r2', 'lambda.*\.mine',
'omega.*\.r1', 'omega.*\.r2', 'omega.*\.mine',
'rho.*\.r1', 'rho.*\.r2', 'rho.*\.mine',
'tau.*\.r1', 'tau.*\.r2', 'tau.*\.mine',
]
# Do the update and check the results in three ways.
# All "extra" files are passed to detect_conflict_files().
svntest.actions.run_and_verify_update(wc_backup,
expected_output,
expected_disk,
expected_status,
None,
svntest.tree.detect_conflict_files,
extra_files)
# verify that the extra_files list is now empty.
if len(extra_files) != 0:
# Because we want to be a well-behaved test, we silently raise if
src/subversion/subversion/tests/cmdline/basic_tests.py view on Meta::CPAN
# stdout, stderr
None,
".*invalid 'accept' ARG",
'resolve', '--accept=launch',
'--force-interactive')
# Run 'svn resolved --accept=NOPE. Using omega for the test.
svntest.actions.run_and_verify_svn("Resolve command", None,
".*NOPE' is not a valid --accept value",
'resolve',
'--accept=NOPE',
omega_path_backup)
# Resolve lambda, mu, and rho with different --accept options.
svntest.actions.run_and_verify_svn("Resolve command", None, [],
'resolve', '--accept=base',
lambda_path_backup)
svntest.actions.run_and_verify_svn("Resolve command", None, [],
'resolve',
'--accept=mine-full',
mu_path_backup)
svntest.actions.run_and_verify_svn("Resolve command", None, [],
'resolve',
'--accept=theirs-full',
rho_path_backup)
fp = open(tau_path_backup, 'w')
fp.write("Resolution text for 'tau'.\n")
fp.close()
svntest.actions.run_and_verify_svn("Resolve command", None, [],
'resolve',
'--accept=working',
tau_path_backup)
# Set the expected disk contents for the test
expected_disk = svntest.main.greek_state.copy()
expected_disk.tweak('A/B/lambda', contents="This is the file 'lambda'.\n")
expected_disk.tweak('A/mu', contents="This is the file 'mu'.\n"
"Conflicting appended text for mu\n")
expected_disk.tweak('A/D/G/rho', contents="This is the file 'rho'.\n"
"Original appended text for rho\n")
expected_disk.tweak('A/D/G/tau', contents="Resolution text for 'tau'.\n")
src/subversion/subversion/tests/cmdline/basic_tests.py view on Meta::CPAN
"Conflicting appended text for omega",
"=======",
"Original appended text for omega",
">>>>>>> .r2",
""]))
# Set the expected extra files for the test
extra_files = ['omega.*\.r1', 'omega.*\.r2', 'omega.*\.mine',]
# Set the expected status for the test
expected_status = svntest.actions.get_virginal_state(wc_backup, 2)
expected_status.tweak('A/mu', 'A/B/lambda', 'A/D/G/rho', 'A/D/G/tau',
'A/D/H/omega', wc_rev=2)
expected_status.tweak('A/mu', status='M ')
expected_status.tweak('A/B/lambda', status='M ')
expected_status.tweak('A/D/G/rho', status=' ')
expected_status.tweak('A/D/G/tau', status='M ')
expected_status.tweak('A/D/H/omega', status='C ')
# Set the expected output for the test
expected_output = wc.State(wc_backup, {})
# Do the update and check the results in three ways.
svntest.actions.run_and_verify_update(wc_backup,
expected_output,
expected_disk,
expected_status,
None,
svntest.tree.detect_conflict_files,
extra_files)
def info_nonexisting_file(sbox):
"get info on a file not in the repo"
src/subversion/subversion/tests/cmdline/checkout_tests.py view on Meta::CPAN
expected_output,
expected_wc)
#----------------------------------------------------------------------
def co_with_obstructing_local_adds(sbox):
"co handles obstructing paths scheduled for add"
sbox.build()
wc_dir = sbox.wc_dir
# Make a backup copy of the working copy
wc_backup = sbox.add_wc_path('backup')
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Add files and dirs to the repos via the first WC. Each of these
# will be added to the backup WC via a checkout:
#
# A/B/upsilon: Identical to the file scheduled for addition in
# the backup WC.
#
# A/C/nu: A "normal" add, won't exist in the backup WC.
#
# A/D/kappa: Conflicts with the file scheduled for addition in
# the backup WC.
#
# A/D/H/I: New dirs that will also be scheduled for addition
# A/D/H/I/J: in the backup WC.
# A/D/H/I/K:
#
# A/D/H/I/L: A "normal" dir add, won't exist in the backup WC.
#
# A/D/H/I/K/xi: Identical to the file scheduled for addition in
# the backup WC.
#
# A/D/H/I/K/eta: Conflicts with the file scheduled for addition in
# the backup WC.
upsilon_path = os.path.join(wc_dir, 'A', 'B', 'upsilon')
svntest.main.file_append(upsilon_path, "This is the file 'upsilon'\n")
nu_path = os.path.join(wc_dir, 'A', 'C', 'nu')
svntest.main.file_append(nu_path, "This is the file 'nu'\n")
kappa_path = os.path.join(wc_dir, 'A', 'D', 'kappa')
svntest.main.file_append(kappa_path, "This is REPOS file 'kappa'\n")
I_path = os.path.join(wc_dir, 'A', 'D', 'H', 'I')
os.mkdir(I_path)
J_path = os.path.join(I_path, 'J')
os.mkdir(J_path)
src/subversion/subversion/tests/cmdline/checkout_tests.py view on Meta::CPAN
'A/D/H/I/K/eta' : Item(status=' ', wc_rev=2),
'A/D/H/I/L' : Item(status=' ', wc_rev=2),
})
# Commit.
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None, wc_dir)
# Create various paths scheduled for addition which will obstruct
# the adds coming from the repos.
upsilon_backup_path = os.path.join(wc_backup, 'A', 'B', 'upsilon')
svntest.main.file_append(upsilon_backup_path,
"This is the file 'upsilon'\n")
kappa_backup_path = os.path.join(wc_backup, 'A', 'D', 'kappa')
svntest.main.file_append(kappa_backup_path,
"This is WC file 'kappa'\n")
I_backup_path = os.path.join(wc_backup, 'A', 'D', 'H', 'I')
os.mkdir(I_backup_path)
J_backup_path = os.path.join(I_backup_path, 'J')
os.mkdir(J_backup_path)
K_backup_path = os.path.join(I_backup_path, 'K')
os.mkdir(K_backup_path)
xi_backup_path = os.path.join(K_backup_path, 'xi')
svntest.main.file_append(xi_backup_path, "This is file 'xi'\n")
eta_backup_path = os.path.join(K_backup_path, 'eta')
svntest.main.file_append(eta_backup_path, "This is WC file 'eta'\n")
svntest.main.run_svn(None, 'add',
upsilon_backup_path,
kappa_backup_path,
I_backup_path)
# Create expected output tree for a checkout of the wc_backup.
expected_output = wc.State(wc_backup, {
'A/B/upsilon' : Item(status='E '),
'A/C/nu' : Item(status='A '),
'A/D/H/I' : Item(status='E '),
'A/D/H/I/J' : Item(status='E '),
'A/D/H/I/K' : Item(status='E '),
'A/D/H/I/K/xi' : Item(status='E '),
'A/D/H/I/K/eta' : Item(status='C '),
'A/D/H/I/L' : Item(status='A '),
'A/D/kappa' : Item(status='C '),
})
# Create expected disk for checkout of wc_backup.
expected_disk = svntest.main.greek_state.copy()
expected_disk.add({
'A/B/upsilon' : Item("This is the file 'upsilon'\n"),
'A/C/nu' : Item("This is the file 'nu'\n"),
'A/D/H/I' : Item(),
'A/D/H/I/J' : Item(),
'A/D/H/I/K' : Item(),
'A/D/H/I/K/xi' : Item("This is file 'xi'\n"),
'A/D/H/I/K/eta' : Item("\n".join(["<<<<<<< .mine",
"This is WC file 'eta'",
src/subversion/subversion/tests/cmdline/checkout_tests.py view on Meta::CPAN
'A/D/kappa' : Item("\n".join(["<<<<<<< .mine",
"This is WC file 'kappa'",
"=======",
"This is REPOS file 'kappa'",
">>>>>>> .r2",
""])),
})
# Create expected status tree for the checkout. Since the obstructing
# kappa and upsilon differ from the repos, they should show as modified.
expected_status = svntest.actions.get_virginal_state(wc_backup, 2)
expected_status.add({
'A/B/upsilon' : Item(status=' ', wc_rev=2),
'A/C/nu' : Item(status=' ', wc_rev=2),
'A/D/H/I' : Item(status=' ', wc_rev=2),
'A/D/H/I/J' : Item(status=' ', wc_rev=2),
'A/D/H/I/K' : Item(status=' ', wc_rev=2),
'A/D/H/I/K/xi' : Item(status=' ', wc_rev=2),
'A/D/H/I/K/eta' : Item(status='C ', wc_rev=2),
'A/D/H/I/L' : Item(status=' ', wc_rev=2),
'A/D/kappa' : Item(status='C ', wc_rev=2),
})
# "Extra" files that we expect to result from the conflicts.
extra_files = ['eta\.r0', 'eta\.r2', 'eta\.mine',
'kappa\.r0', 'kappa\.r2', 'kappa\.mine']
# Perform the checkout and check the results in three ways.
# We use --force here because run_and_verify_checkout() will delete
# wc_backup before performing the checkout otherwise.
svntest.actions.run_and_verify_checkout(sbox.repo_url, wc_backup,
expected_output, expected_disk,
svntest.tree.detect_conflict_files,
extra_files, None, None,
'--force')
svntest.actions.run_and_verify_status(wc_backup, expected_status)
# Some obstructions are still not permitted:
#
# Test that file and dir obstructions scheduled for addition *with*
# history fail when checkout tries to add the same path.
# URL to URL copy of A/D/G to A/D/M.
G_URL = sbox.repo_url + '/A/D/G'
M_URL = sbox.repo_url + '/A/D/M'
svntest.actions.run_and_verify_svn("Copy error:", None, [],
src/subversion/subversion/tests/cmdline/commit_tests.py view on Meta::CPAN
#----------------------------------------------------------------------
# Regression for #1017: ra_neon was allowing the deletion of out-of-date
# files or dirs, which majorly violates Subversion's semantics.
# An out-of-date error should be raised if the object to be committed has
# already been deleted or modified in the repo.
def commit_out_of_date_deletions(sbox):
"commit deletion of out-of-date file or dir"
# Path WC 1 WC backup
# =========== ==== =========
# A/C pset del
# A/I del pset
# A/B/F del del
# A/D/H/omega text del
# A/B/E/alpha pset del
# A/D/H/chi del text
# A/B/E/beta del pset
# A/D/H/psi del del
sbox.build()
wc_dir = sbox.wc_dir
# Need another empty dir
I_path = sbox.ospath('A/I')
os.mkdir(I_path)
svntest.main.run_svn(None, 'add', I_path)
svntest.main.run_svn(None, 'ci', '-m', 'prep', wc_dir)
svntest.main.run_svn(None, 'up', wc_dir)
# Make a backup copy of the working copy
wc_backup = sbox.add_wc_path('backup')
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Edits in wc 1
C_path = sbox.ospath('A/C')
omega_path = sbox.ospath('A/D/H/omega')
alpha_path = sbox.ospath('A/B/E/alpha')
svntest.main.run_svn(None, 'propset', 'fooprop', 'foopropval', C_path)
svntest.main.file_append(omega_path, 'appended omega text')
svntest.main.run_svn(None, 'propset', 'fooprop', 'foopropval', alpha_path)
# Deletions in wc 1
src/subversion/subversion/tests/cmdline/commit_tests.py view on Meta::CPAN
'A/B/E/beta' : Item(verb='Deleting'),
'A/D/H/psi' : Item(verb='Deleting'),
})
expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
expected_status.tweak('A/C', 'A/D/H/omega', 'A/B/E/alpha', wc_rev=3,
status=' ')
expected_status.remove('A/B/F', 'A/D/H/chi', 'A/B/E/beta', 'A/D/H/psi')
commit = svntest.actions.run_and_verify_commit
commit(wc_dir, expected_output, expected_status, None, wc_dir)
# Edits in wc backup
I_path = os.path.join(wc_backup, 'A', 'I')
chi_path = os.path.join(wc_backup, 'A', 'D', 'H', 'chi')
beta_path = os.path.join(wc_backup, 'A', 'B', 'E','beta')
svntest.main.run_svn(None, 'propset', 'fooprop', 'foopropval', I_path)
svntest.main.file_append(chi_path, 'appended chi text')
svntest.main.run_svn(None, 'propset', 'fooprop', 'foopropval', beta_path)
# Deletions in wc backup
C_path = os.path.join(wc_backup, 'A', 'C')
F_path = os.path.join(wc_backup, 'A', 'B', 'F')
omega_path = os.path.join(wc_backup, 'A', 'D', 'H', 'omega')
alpha_path = os.path.join(wc_backup, 'A', 'B', 'E', 'alpha')
psi_path = os.path.join(wc_backup, 'A', 'D', 'H', 'psi')
svntest.main.run_svn(None, 'rm', C_path, F_path, omega_path, alpha_path,
psi_path)
# A commit of any one of these files or dirs should fail, preferably
# with an out-of-date error message.
error_re = "(out of date|not found)"
commit(wc_backup, None, None, error_re, C_path)
commit(wc_backup, None, None, error_re, I_path)
commit(wc_backup, None, None, error_re, F_path)
commit(wc_backup, None, None, error_re, omega_path)
commit(wc_backup, None, None, error_re, alpha_path)
commit(wc_backup, None, None, error_re, chi_path)
commit(wc_backup, None, None, error_re, beta_path)
commit(wc_backup, None, None, error_re, psi_path)
def commit_with_bad_log_message(sbox):
"commit with a log message containing bad data"
sbox.build()
wc_dir = sbox.wc_dir
iota_path = sbox.ospath('iota')
log_msg_path = sbox.ospath('log-message')
src/subversion/subversion/tests/cmdline/commit_tests.py view on Meta::CPAN
#----------------------------------------------------------------------
def commit_out_of_date_file(sbox):
"try to commit a file that is out-of-date"
sbox.build()
wc_dir = sbox.wc_dir
# Make a backup copy of the working copy
wc_backup = sbox.add_wc_path('backup')
svntest.actions.duplicate_dir(wc_dir, wc_backup)
pi_path = sbox.ospath('A/D/G/pi')
backup_pi_path = os.path.join(wc_backup, 'A', 'D', 'G', 'pi')
svntest.main.file_append(pi_path, "new line\n")
expected_output = svntest.wc.State(wc_dir, {
"A/D/G/pi" : Item(verb='Sending'),
})
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.tweak("A/D/G/pi", wc_rev=2, status=" ")
svntest.actions.run_and_verify_commit(wc_dir,
expected_output,
expected_status,
None,
"-m", "log message", wc_dir)
svntest.main.file_append(backup_pi_path, "hello")
expected_err = ".*(pi.*out of date|Out of date.*pi).*"
svntest.actions.run_and_verify_svn(None, None, expected_err,
'commit', '-m', 'log message',
wc_backup)
@SkipUnless(server_gets_client_capabilities)
@Issue(2991)
def start_commit_detect_capabilities(sbox):
"start-commit hook sees client capabilities" # Issue #2991
sbox.build()
wc_dir = sbox.wc_dir
repos_dir = sbox.repo_dir
# Create a start-commit hook that detects the "mergeinfo" capability.
src/subversion/subversion/tests/cmdline/copy_tests.py view on Meta::CPAN
# one time it failed over ra_neon. Specifically, it failed when
# mod_dav_svn first started sending vsn-rsc-urls as "CR/path", and was
# sending bogus CR/paths for items within copied subtrees.
def receive_copy_in_update(sbox):
"receive a copied directory during update"
sbox.build()
wc_dir = sbox.wc_dir
# Make a backup copy of the working copy.
wc_backup = sbox.add_wc_path('backup')
svntest.actions.duplicate_dir(wc_dir, wc_backup)
# Define a zillion paths in both working copies.
G_path = sbox.ospath('A/D/G')
newG_path = sbox.ospath('A/B/newG')
# Copy directory A/D to A/B/newG
svntest.actions.run_and_verify_svn(None, None, [], 'cp', G_path, newG_path)
# Created expected output tree for 'svn ci':
expected_output = svntest.wc.State(wc_dir, {
src/subversion/subversion/tests/cmdline/copy_tests.py view on Meta::CPAN
svntest.actions.run_and_verify_commit(wc_dir,
expected_output,
expected_status,
None,
wc_dir)
# Now update the other working copy; it should receive a full add of
# the newG directory and its contents.
# Expected output of update
expected_output = svntest.wc.State(wc_backup, {
'A/B/newG' : Item(status='A '),
'A/B/newG/pi' : Item(status='A '),
'A/B/newG/rho' : Item(status='A '),
'A/B/newG/tau' : Item(status='A '),
})
# Create expected disk tree for the update.
expected_disk = svntest.main.greek_state.copy()
expected_disk.add({
'A/B/newG' : Item(),
'A/B/newG/pi' : Item("This is the file 'pi'.\n"),
'A/B/newG/rho' : Item("This is the file 'rho'.\n"),
'A/B/newG/tau' : Item("This is the file 'tau'.\n"),
})
# Create expected status tree for the update.
expected_status = svntest.actions.get_virginal_state(wc_backup, 2)
expected_status.add({
'A/B/newG' : Item(status=' ', wc_rev=2),
'A/B/newG/pi' : Item(status=' ', wc_rev=2),
'A/B/newG/rho' : Item(status=' ', wc_rev=2),
'A/B/newG/tau' : Item(status=' ', wc_rev=2),
})
# Do the update and check the results in three ways.
svntest.actions.run_and_verify_update(wc_backup,
expected_output,
expected_disk,
expected_status)
#----------------------------------------------------------------------
# Regression test for issue #683. In particular, this bug prevented
# us from running 'svn cp -r N src_URL dst_URL' as a means of
# resurrecting a deleted directory. Also, the final 'update' at the
src/subversion/subversion/tests/cmdline/merge_tests.py view on Meta::CPAN
mu_path = sbox.ospath('A/mu')
# CRLF is a string that will match a CRLF sequence read from a text file.
# ### On Windows, we assume CRLF will be read as LF, so it's a poor test.
if os.name == 'nt':
crlf = '\n'
else:
crlf = '\r\n'
# Checkout a second working copy
wc_backup = sbox.add_wc_path('backup')
svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
sbox.repo_url, wc_backup)
# set starting revision
cur_rev = 1
expected_disk = svntest.main.greek_state.copy()
expected_status = svntest.actions.get_virginal_state(wc_dir, cur_rev)
expected_backup_status = svntest.actions.get_virginal_state(wc_backup,
cur_rev)
path_backup = os.path.join(wc_backup, 'A', 'mu')
# do the test for each eol-style
for eol, eolchar in zip(['CRLF', 'CR', 'native', 'LF'],
[crlf, '\015', '\n', '\012']):
# rewrite file mu and set the eol-style property.
svntest.main.file_write(mu_path, "This is the file 'mu'."+ eolchar, 'wb')
svntest.main.run_svn(None, 'propset', 'svn:eol-style', eol, mu_path)
expected_disk.add({
'A/mu' : Item("This is the file 'mu'." + eolchar)
src/subversion/subversion/tests/cmdline/merge_tests.py view on Meta::CPAN
'A/mu' : Item(status=' ', wc_rev = cur_rev + 1),
})
# Commit the original change and note the 'base' revision number
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
expected_status, None,
wc_dir)
cur_rev = cur_rev + 1
base_rev = cur_rev
svntest.main.run_svn(None, 'update', wc_backup)
# Make a local mod to mu
svntest.main.file_append(mu_path,
'Original appended text for mu' + eolchar)
# Commit the original change and note the 'theirs' revision number
svntest.main.run_svn(None, 'commit', '-m', 'test log', wc_dir)
cur_rev = cur_rev + 1
theirs_rev = cur_rev
# Make a local mod to mu, will conflict with the previous change
svntest.main.file_append(path_backup,
'Conflicting appended text for mu' + eolchar)
# Create expected output tree for an update of the wc_backup.
expected_backup_output = svntest.wc.State(wc_backup, {
'A/mu' : Item(status='C '),
})
# Create expected disk tree for the update.
expected_backup_disk = expected_disk.copy()
# verify content of resulting conflicted file
expected_backup_disk.add({
'A/mu' : Item(contents= "This is the file 'mu'." + eolchar +
"<<<<<<< .working" + eolchar +
"Conflicting appended text for mu" + eolchar +
"=======" + eolchar +
"Original appended text for mu" + eolchar +
">>>>>>> .merge-right.r" + str(cur_rev) + eolchar),
})
# verify content of base(left) file
expected_backup_disk.add({
'A/mu.merge-left.r' + str(base_rev) :
Item(contents= "This is the file 'mu'." + eolchar)
})
# verify content of theirs(right) file
expected_backup_disk.add({
'A/mu.merge-right.r' + str(theirs_rev) :
Item(contents= "This is the file 'mu'." + eolchar +
"Original appended text for mu" + eolchar)
})
# verify content of mine file
expected_backup_disk.add({
'A/mu.working' : Item(contents= "This is the file 'mu'." +
eolchar +
"Conflicting appended text for mu" + eolchar)
})
# Create expected status tree for the update.
expected_backup_status.add({
'A/mu' : Item(status=' ', wc_rev=cur_rev),
})
expected_backup_status.tweak('A/mu', status='C ')
expected_backup_status.tweak(wc_rev = cur_rev - 1)
expected_backup_status.tweak('', status= ' M')
expected_mergeinfo_output = wc.State(wc_backup, {
'' : Item(status=' U'),
})
expected_elision_output = wc.State(wc_backup, {
})
expected_backup_skip = wc.State('', { })
svntest.actions.run_and_verify_merge(wc_backup, cur_rev - 1, cur_rev,
sbox.repo_url, None,
expected_backup_output,
expected_mergeinfo_output,
expected_elision_output,
expected_backup_disk,
expected_backup_status,
expected_backup_skip)
# cleanup for next run
svntest.main.run_svn(None, 'revert', '-R', wc_backup)
svntest.main.run_svn(None, 'update', wc_dir)
#----------------------------------------------------------------------
# eol-style handling during merge, scenario 2:
# if part of that merge is a propchange (add, change, delete) of
# svn:eol-style, make sure the correct eol-style is applied before
# calculating the merge (and conflicts if any)
#
# This test for 'svn update' can be found in update_tests.py as
# update_eolstyle_handling.
src/subversion/subversion/tests/cmdline/merge_tests.py view on Meta::CPAN
mu_path = sbox.ospath('A/mu')
# CRLF is a string that will match a CRLF sequence read from a text file.
# ### On Windows, we assume CRLF will be read as LF, so it's a poor test.
if os.name == 'nt':
crlf = '\n'
else:
crlf = '\r\n'
# Checkout a second working copy
wc_backup = sbox.add_wc_path('backup')
svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
sbox.repo_url, wc_backup)
path_backup = os.path.join(wc_backup, 'A', 'mu')
# Test 1: add the eol-style property and commit, change mu in the second
# working copy and merge the last revision; there should be no conflict!
svntest.main.run_svn(None, 'propset', 'svn:eol-style', "CRLF", mu_path)
svntest.main.run_svn(None,
'commit', '-m', 'set eol-style property', wc_dir)
svntest.main.file_append_binary(path_backup, 'Added new line of text.\012')
expected_backup_disk = svntest.main.greek_state.copy()
expected_backup_disk.tweak(
'A/mu', contents= "This is the file 'mu'." + crlf +
"Added new line of text." + crlf)
expected_backup_output = svntest.wc.State(wc_backup, {
'A/mu' : Item(status='GU'),
})
expected_mergeinfo_output = svntest.wc.State(wc_backup, {
'' : Item(status=' U'),
})
expected_elision_output = wc.State(wc_backup, {
})
expected_backup_status = svntest.actions.get_virginal_state(wc_backup, 1)
expected_backup_status.tweak('', status=' M')
expected_backup_status.tweak('A/mu', status='MM')
expected_backup_skip = wc.State('', { })
svntest.actions.run_and_verify_merge(wc_backup, '1', '2', sbox.repo_url, None,
expected_backup_output,
expected_mergeinfo_output,
expected_elision_output,
expected_backup_disk,
expected_backup_status,
expected_backup_skip)
# Test 2: now change the eol-style property to another value and commit,
# merge this revision in the still changed mu in the second working copy;
# there should be no conflict!
svntest.main.run_svn(None, 'propset', 'svn:eol-style', "CR", mu_path)
svntest.main.run_svn(None,
'commit', '-m', 'set eol-style property', wc_dir)
expected_backup_disk = svntest.main.greek_state.copy()
expected_backup_disk.add({
'A/mu' : Item(contents= "This is the file 'mu'.\015" +
"Added new line of text.\015")
})
expected_backup_output = svntest.wc.State(wc_backup, {
'A/mu' : Item(status='GU'),
})
expected_mergeinfo_output = svntest.wc.State(wc_backup, {
'' : Item(status=' G'),
})
expected_backup_status = svntest.actions.get_virginal_state(wc_backup, 1)
expected_backup_status.tweak('', status=' M')
expected_backup_status.tweak('A/mu', status='MM')
svntest.actions.run_and_verify_merge(wc_backup, '2', '3', sbox.repo_url, None,
expected_backup_output,
expected_mergeinfo_output,
expected_elision_output,
expected_backup_disk,
expected_backup_status,
expected_backup_skip)
# Test 3: now delete the eol-style property and commit, merge this revision
# in the still changed mu in the second working copy; there should be no
# conflict!
# EOL of mu should be unchanged (=CRLF).
svntest.main.run_svn(None, 'propdel', 'svn:eol-style', mu_path)
svntest.main.run_svn(None,
'commit', '-m', 'del eol-style property', wc_dir)
expected_backup_disk = svntest.main.greek_state.copy()
expected_backup_disk.add({
'A/mu' : Item(contents= "This is the file 'mu'.\015" +
"Added new line of text.\015")
})
expected_backup_output = svntest.wc.State(wc_backup, {
'A/mu' : Item(status=' G'),
})
expected_backup_status = svntest.actions.get_virginal_state(wc_backup, 1)
expected_backup_status.tweak('', status=' M')
expected_backup_status.tweak('A/mu', status='M ')
svntest.actions.run_and_verify_merge(wc_backup, '3', '4', sbox.repo_url, None,
expected_backup_output,
expected_mergeinfo_output,
expected_elision_output,
expected_backup_disk,
expected_backup_status,
expected_backup_skip)
#----------------------------------------------------------------------
def create_deep_trees(wc_dir):
"""Create A/B/F/E by moving A/B/E to A/B/F/E.
Copy A/B/F/E to A/B/F/E1.
Copy A/B to A/copy-of-B, and return the expected status.
At the end of this function WC would be at r4"""
A_path = os.path.join(wc_dir, 'A')
A_B_path = os.path.join(A_path, 'B')