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

Bug in merge (repro included)

From: Thomas Börkel <tbo_at_ap-ag.com>
Date: 2005-02-02 16:07:00 CET

HI!

I think we have found a bug in Subversion's merge command.

I am attaching 3 versions of the same file:
- TransportOutUtil-B1.java = Rev 1 in the branch
- TransportOutUtil-B2.java = Rev 2 in the branch
- TransportOutUtil-T.java = trunk

Now we are merging the diff between B1 and B2 into T.

The unified diff between B1 and B2 looks like this:

--------------------------------------------------

@@ -444,20 +444,20 @@
       if (vkRahmenObj != null) {
         vkRahmenObj.setGeliefert(vkRahmenObj.getGeliefert() - lieferMenge);
         vkRahmenObj.update();
+
+ where = "KARTIKEL = '" + vkRahmenObj.getKartikel()+ "' and " +
+ "EDIPARTNER = '" + vkRahmenObj.getEdipartner() + "' and " +
+ "WERKKUNDE = '" + vkRahmenObj.getWerkkunde() + "' and " +
+ "ABLADESTELLE = '" + vkRahmenObj.getAbladestelle() + "' and
" +
+ "STATUS = 1";
+ lieferabrufInObj = LieferabrufInFactory.search2(manager,
+ where,
+ READ_LOCK,
+ true);
+ LieferabrufInUtil.unDispatchDeliverySchedule(lieferabrufInObj);
+ LieferabrufInUtil.dispatchDeliverySchedule(lieferabrufInObj);
       }

- where = "KARTIKEL = '" + vkRahmenObj.getKartikel()+ "' and " +
- "EDIPARTNER = '" + vkRahmenObj.getEdipartner() + "' and " +
- "WERKKUNDE = '" + vkRahmenObj.getWerkkunde() + "' and " +
- "ABLADESTELLE = '" + vkRahmenObj.getAbladestelle() + "' and "
+
- "STATUS = 1";
- lieferabrufInObj = LieferabrufInFactory.search2(manager,
- where,
- READ_LOCK,
- true);
- LieferabrufInUtil.unDispatchDeliverySchedule(lieferabrufInObj);
- LieferabrufInUtil.dispatchDeliverySchedule(lieferabrufInObj);
-
     } finally {
       manager.release();
     }

--------------------------------------------------

The code in the trunk looks slightly different there, so IMHO the merge
should result in a conflict (trying with GNU patch results in a failure).

But it doesn't. After the merge, the new block has just been added without
conflict and the old block has not been removed.

Before:
          if (vkRahmenObj != null) {
            vkRahmenObj.setGeliefert(vkRahmenObj.getGeliefert() -
lieferMenge);
            vkRahmenObj.update();

            where = "KARTIKEL = '" + vkRahmenObj.getKartikel()+ "' and " +
                    "EDIPARTNER = '" + vkRahmenObj.getEdipartner() + "' and
" +
                    "WERKKUNDE = '" + vkRahmenObj.getWerkkunde() + "' and "
+
                    "ABLADESTELLE = '" + vkRahmenObj.getAbladestelle() + "'
and " +
                    "STATUS = 1";
            lieferabrufInObj = LieferabrufInFactory.search2(manager,
                                                            where,
                                                            READ_LOCK,
                                                            false);
            if (lieferabrufInObj != null) {

LieferabrufInUtil.unDispatchDeliverySchedule(lieferabrufInObj);
              LieferabrufInUtil.dispatchDeliverySchedule(lieferabrufInObj);
            }

After the merge:

            where = "KARTIKEL = '" + vkRahmenObj.getKartikel()+ "' and " +
                    "EDIPARTNER = '" + vkRahmenObj.getEdipartner() + "' and
" +
                    "WERKKUNDE = '" + vkRahmenObj.getWerkkunde() + "' and "
+
                    "ABLADESTELLE = '" + vkRahmenObj.getAbladestelle() + "'
and " +
                    "STATUS = 1";
            lieferabrufInObj = LieferabrufInFactory.search2(manager,
                                                            where,
                                                            READ_LOCK,
                                                            false);
            if (lieferabrufInObj != null) {

LieferabrufInUtil.unDispatchDeliverySchedule(lieferabrufInObj);
              LieferabrufInUtil.dispatchDeliverySchedule(lieferabrufInObj);
            }
          }
        }

        where = "KARTIKEL = '" + vkRahmenObj.getKartikel()+ "' and " +
                "EDIPARTNER = '" + vkRahmenObj.getEdipartner() + "' and " +
                "WERKKUNDE = '" + vkRahmenObj.getWerkkunde() + "' and " +
                "ABLADESTELLE = '" + vkRahmenObj.getAbladestelle() + "' and
" +
                "STATUS = 1";
        lieferabrufInObj = LieferabrufInFactory.search2(manager,
                                                        where,
                                                        READ_LOCK,
                                                        true);
        LieferabrufInUtil.unDispatchDeliverySchedule(lieferabrufInObj);
        LieferabrufInUtil.dispatchDeliverySchedule(lieferabrufInObj);

Are we thinking wrong?

Thanks!

Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Received on Wed Feb 2 16:14:28 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.