[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Factorise 'svn lock' validation code

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2006-05-24 11:16:42 CEST

Madan U Sreenivasan writes:
>
> +def run_and_validate_lock(path, username, password):
> + """`svn lock' the given path and validate the contents of the lock.
> + Use the given username. This is important because locks are
> + user specific."""
>
> + comment = "Locking path:%s." % path
> +
> + # lock the path
> + run_and_verify_svn(None, ".*locked by user", [], 'lock',
> + '--username', username,
> + '--password', password,
> + '-m', comment, path)
> +
> + # Run info and check that we get the lock fields.
> + output, err = run_and_verify_svn(None, None, [],
> + 'info','-R',
> + path)
> +
> + lock_info = output[-6:-1]

While here, we could as well make this not break if we add more fields
to the info output in the future. I think we should search for the specific
fields, which is much easier with this refactorization.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 24 11:17:10 2006

This is an archived mail posted to the Subversion Dev mailing list.