Title: RE: RE: [Svnmerge] [PATCH] svnmerge.py: Add check for already init-ed head

Pl. find attached the patch with the --force option change.

[[[
Add check for already initialized head.

* contrib/client-side/svnmerge.py
  (action_init): Modified to print error message and exit,
  when the branch provided has already been initialized for
  the given head. This check is skipped on using the --force
  option.
]]]

Regards,
Madan.

PS : Apologize for top-posting.

-----Original Message-----
From: Madan U S [mailto:[EMAIL PROTECTED]]
Sent: Thu 4/6/2006 11:54 AM
To: Giovanni Bajo; [EMAIL PROTECTED]; [email protected]
Subject:  RE: [Svnmerge] [PATCH] svnmerge.py: Add check for already init-ed head

On Thursday 06 Apr 2006 3:23 am, Giovanni Bajo wrote:
> Madan U S <[EMAIL PROTECTED]> wrote:
> > [[[
> > Add check for already initialized head.
> >
> > * contrib/client-side/svnmerge.py
> >   (action_init): Modified to print error message and exit,
> >   when the branch provided has already been initialized for
> >   the given head.
> > ]]]
>
> This is commonly used to "reset" the merge status after some confusing
> commands.

oh, no. If it is meant to be used like that, it should not be called 'init'.
Maybe 'sync' or 'integrate'?

> At the very least, you should make --force override this check.

agree.

> I'd be more satisfied if you just printed a warning and let the operation
> continue: the user can easily revert the command after the fact if he wants
> to.

Revert may not be possible in some cases, given the other user changes.
I'd rather like the command failing with a message saying 'Use --force to
force this operation'.

Regards,
Madan.


Index: contrib/client-side/svnmerge.py
===================================================================
--- contrib/client-side/svnmerge.py     (revision 19196)
+++ contrib/client-side/svnmerge.py     (working copy)
@@ -937,6 +937,13 @@
            (branch_dir, revs, opts["head-url"]))
 
     revs = str(revs)
+    # if the head-path already has an entry
+    # in the svnmerge-integrated property,
+    # simply error out.
+    if not opts["force"] and branch_props.has_key(opts["head-path"]):
+      err_msg  = opts["head-path"] + " has already been initialized at "
+      err_msg += branch_dir + "\nUse --force to force re-init"
+      error(err_msg)
     branch_props[opts["head-path"]] = revs
 
     # Set property
Add check for already initialized head.

* contrib/client-side/svnmerge.py
  (action_init): Modified to print error message and exit, 
  when the branch provided has already been initialized for
  the given head. This check is skipped on using the --force
  option.
_______________________________________________
Svnmerge mailing list
[email protected]
http://www.orcaware.com/mailman/listinfo/svnmerge

Reply via email to