Return-Path: X-Original-To: apmail-subversion-users-archive@minotaur.apache.org Delivered-To: apmail-subversion-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AB3F7CECD for ; Thu, 13 Jun 2013 19:47:46 +0000 (UTC) Received: (qmail 20370 invoked by uid 500); 13 Jun 2013 19:47:46 -0000 Delivered-To: apmail-subversion-users-archive@subversion.apache.org Received: (qmail 20354 invoked by uid 500); 13 Jun 2013 19:47:45 -0000 Mailing-List: contact users-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@subversion.apache.org Received: (qmail 20347 invoked by uid 99); 13 Jun 2013 19:47:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Jun 2013 19:47:45 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of markphip@gmail.com designates 209.85.219.49 as permitted sender) Received: from [209.85.219.49] (HELO mail-oa0-f49.google.com) (209.85.219.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Jun 2013 19:47:40 +0000 Received: by mail-oa0-f49.google.com with SMTP id n9so3096209oag.22 for ; Thu, 13 Jun 2013 12:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Xrr4fvV4oEOwPQCgMss33mXPZv4o33MzW77F/037IwQ=; b=fuXjpS7snhe4Vwckldc9qrHcGpC7dNk1UU2lKoaJNdlVZLebxjeORR+kH/+vSD+TKJ cwnJDeBxHUxE+ETN2C1ZinnO4OrTHzdK4yVqkmI8sSsbXIPr22E+d9WhGtapkq96erYs za3B1mbw7I5zY4Di56nni1/J/bfKP+VdBw3m5npYek1HQBxUu8a/fstxy73o3YX8yPtG nPECq+BvwVoSI33nAytTQluPMlTx1qksS2eINcwBYuYxkDxmIHuwhgEvgBlbvtkGW9dL orm+NXSiRmSJ9syH4Hkr/IkOdCourmNKg8oczigb7+8G6gwh8pI9ihKSN18YnJl1C4/O bMwg== MIME-Version: 1.0 X-Received: by 10.182.92.225 with SMTP id cp1mr1801137obb.97.1371152839108; Thu, 13 Jun 2013 12:47:19 -0700 (PDT) Received: by 10.76.115.135 with HTTP; Thu, 13 Jun 2013 12:47:19 -0700 (PDT) In-Reply-To: References: Date: Thu, 13 Jun 2013 15:47:19 -0400 Message-ID: Subject: Re: Managing "needs-lock" files on multiple branches From: Mark Phippard To: Benjamin Fritz Cc: "users@subversion.apache.org" Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Jun 13, 2013 at 3:41 PM, Benjamin Fritz wrote: > Where I work, we branch for every bugfix, to allow a "clean" trunk at all times. > > Some files we work with are not easily merged, so we have > svn:needs-lock set on them. > > Locking one of these files is supposed to indicate to the rest of the > team not to touch it until you're done (or at least, ask first). But > since the lock is on a branch, somebody else on a different branch, or > even merging back to trunk, will have no way to know you are editing > the file. > > I wanted to solve this using a pre-lock hook on the server, which > would automatically try to lock the trunk version of an artifact when > somebody locks on a branch. But, since locking requires a username and > password, and hook scripts do not have access to that information, the > best I could do is deny the lock if the trunk is not locked, and also > if the existing trunk lock does not contain the branch name in the > lock comment. The hook is running on the server, so it could access the repository via file:// URL to do the lock. This does not require authentication. In SVN 1.8, the svnadmin command can be used as well: $ svnadmin help lock lock: usage: svnadmin lock REPOS_PATH PATH USERNAME COMMENT-FILE [TOKEN] Lock PATH by USERNAME setting comments from COMMENT-FILE. If provided, use TOKEN as lock token. Use --bypass-hooks to avoid triggering the pre-lock and post-lock hook scripts. Valid options: --bypass-hooks : bypass the repository hook system -- Thanks Mark Phippard http://markphip.blogspot.com/