info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cvs update w/merge+conflict does not exit non-zero


From: Max Bowsher
Subject: Re: cvs update w/merge+conflict does not exit non-zero
Date: Tue, 22 Apr 2003 09:50:22 +0100

Mike Burgun wrote:
> Hi fellow CVS'ers,
>
> I believe the following is a bug but I'd like to pass it by the info-cvs
> community...
>
> Setup: + I have a file in my sandbox that is locally modified.
>        + This file is not up-to-date with respect to the repository.
>        + I also happen to know (okay, after the fact, I find out) that
> my edit will conflict with modification(s) already checked
> into the repository.
>
> When merging takes place _and_ conflict(s) are produced during a
> "cvs update", cvs currently exits with a zero status versus what I
> would expect to be a non-zero status due to the conflict(s).

This sounds like issue 73:
http://ccvs.cvshome.org/issues/show_bug.cgi?id=73

> PATCH
> =====
> The following patch/fix ensures that "cvs update" returns a non-zero
> exit status when conflict(s) occur...
>
> /tmp/cvs-1.11.5/src> diff -u update.c.orig update.c
> --- update.c.orig       Sat Dec 28 13:01:30 2002
> +++ update.c    Mon Apr 21 21:18:41 2003
> @@ -2114,6 +2114,7 @@
>         write_letter (finfo, 'C');
>
>         history_write ('C', finfo->update_dir, vers->vn_rcs, finfo->file,
> finfo->repository);
> +       retval = 1;
>
>      }
>      else if (retcode == -1)
> @@ -2126,8 +2127,8 @@
>         write_letter (finfo, 'M');
>         history_write ('G', finfo->update_dir, vers->vn_rcs, finfo->file,
>                        finfo->repository);
> +       retval = 0;
>      }
> -    retval = 0;
>   out:
>      free (backup);
>      return retval;
> /tmp/cvs-1.11.5/src>
>
>
> Thoughts?

Whilst investigating this, it might be a good idea to work out what is going
on with this code:
    else if (retcode == -1)
    {
        error (1, errno, "fork failed while examining update of %s",
               finfo->fullname);
    }
The conditional is always false, since retcode is initialized to 0 and never
used after that.


Max.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]