git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Why "Updated upstream" block is so small?
@ 2019-06-29 10:05 Eugen Konkov
  2019-06-29 10:23 ` Eugen Konkov
  0 siblings, 1 reply; 2+ messages in thread
From: Eugen Konkov @ 2019-06-29 10:05 UTC (permalink / raw)
  To: Git Mailing List

Hello

I want to apply this patch from stage:

diff --git a/lib/App/Schema/Result/Invoice.pm b/lib/App/Schema/Result/Invoice.pm
index 0176916f..0ce2d698 100644
--- a/lib/App/Schema/Result/Invoice.pm
+++ b/lib/App/Schema/Result/Invoice.pm
@@ -219,14 +219,14 @@ sub new_package {
     # my $package_type =  $package->Invoice->Order->Tariff->type;
     my $pass =  $package->password;
     ($pass) =  (`smbencrypt $pass` =~ /([^\s]+)$/s);
-    $sth->execute( $package->login, 'NT-Password', ':=', $pass );
+    $sth->execute( $package->login, 'NT-Password', ':=', $pass //'');
     $sth->execute( $package->login, 'NAS-Identifier', '=~', 'ppp' );
 
     $sth =  $radius_dbh->prepare(
         "INSERT INTO radreply ( username, attribute, op, value, nasip) values ( ?, 'Framed-IP-Address', '=', ?, ? )"
     );
     my $ip =  $package->Ips->first;
-    $sth->execute( $package->login, $ip->ip, $ip->Listener->first->nas_ip );
+    # $sth->execute( $package->login, $ip->ip, $ip->Listener->first->nas_ip );
 
     $radius_dbh->commit;
     # NOTICE: This is a bit inconsistent


after applying I get merge conflict:


diff --cc lib/App/Schema/Result/Invoice.pm
index e3f55654,0ce2d698..00000000
--- a/lib/App/Schema/Result/Invoice.pm
+++ b/lib/App/Schema/Result/Invoice.pm
@@@ -211,33 -204,34 +211,87 @@@ sub new_package 
     }
  
     ## Create radius account
 +   eval{
         my $radius_dbh =  $self->result_source->storage->schema->{ _radius_dbh };
 -   if( !$radius_dbh->FETCH('AutoCommit') ) {
 +       $radius_dbh->begin_work;
 +       my $sth =  $radius_dbh->prepare(
 +           "INSERT INTO radusergroup ( username, groupname, priority ) values (?,'static',1)"
 +       );
 +       $sth->execute( $package->login );
 +
 +       $sth =  $radius_dbh->prepare(
 +           "INSERT INTO radcheck ( username, attribute, op, value ) values ( ?, ?, ?, ? )"
 +       );
 +       # my $package_type =  $package->Invoice->Order->Tariff->type;
 +       my $pass =  $package->password;
 +       ($pass) =  (`smbencrypt $pass` =~ /([^\s]+)$/s);
 +       $sth->execute( $package->login, 'NT-Password', ':=', $pass //'' );
 +       $sth->execute( $package->login, 'NAS-Identifier', '=~', 'ppp' );
 +
 +       $sth =  $radius_dbh->prepare(
 +           "INSERT INTO radreply ( username, attribute, op, value, nasip) values ( ?, 'Framed-IP-Address', '=', ?, ? )"
 +       );
 +       my $ip =  $package->Ips->first;
 +       $sth->execute( $package->login, $ip->ip, $ip->Listener->first->nas_ip );
 +
         $radius_dbh->commit;
++<<<<<<< Updated upstream
 +       # NOTICE: This is a bit inconsistent
 +       # if whole payment failed we will have radius account without payment
 +   };
++||||||| merged common ancestors
++   }
++   $radius_dbh->begin_work;
++   my $sth =  $radius_dbh->prepare(
++       "INSERT INTO radusergroup ( username, groupname, priority ) values (?,'static',1)"
++   );
++   $sth->execute( $package->login );
++
++   $sth =  $radius_dbh->prepare(
++       "INSERT INTO radcheck ( username, attribute, op, value ) values ( ?, ?, ?, ? )"
++   );
++   # my $package_type =  $package->Invoice->Order->Tariff->type;
++   my $pass =  $package->password;
++   ($pass) =  (`smbencrypt $pass` =~ /([^\s]+)$/s);
++   $sth->execute( $package->login, 'NT-Password', ':=', $pass );
++   $sth->execute( $package->login, 'NAS-Identifier', '=~', 'ppp' );
++
++   $sth =  $radius_dbh->prepare(
++       "INSERT INTO radreply ( username, attribute, op, value, nasip) values ( ?, 'Framed-IP-Address', '=', ?, ? )"
++   );
++   my $ip =  $package->Ips->first;
++   $sth->execute( $package->login, $ip->ip, $ip->Listener->first->nas_ip );
++
++   $radius_dbh->commit;
++   # NOTICE: This is a bit inconsistent
++   # if whole payment failed we will have radius account without payment
++=======
+    }
+    $radius_dbh->begin_work;
+    my $sth =  $radius_dbh->prepare(
+        "INSERT INTO radusergroup ( username, groupname, priority ) values (?,'static',1)"
+    );
+    $sth->execute( $package->login );
+ 
+    $sth =  $radius_dbh->prepare(
+        "INSERT INTO radcheck ( username, attribute, op, value ) values ( ?, ?, ?, ? )"
+    );
+    # my $package_type =  $package->Invoice->Order->Tariff->type;
+    my $pass =  $package->password;
+    ($pass) =  (`smbencrypt $pass` =~ /([^\s]+)$/s);
+    $sth->execute( $package->login, 'NT-Password', ':=', $pass //'');
+    $sth->execute( $package->login, 'NAS-Identifier', '=~', 'ppp' );
+ 
+    $sth =  $radius_dbh->prepare(
+        "INSERT INTO radreply ( username, attribute, op, value, nasip) values ( ?, 'Framed-IP-Address', '=', ?, ? )"
+    );
+    my $ip =  $package->Ips->first;
+    # $sth->execute( $package->login, $ip->ip, $ip->Listener->first->nas_ip );
+ 
+    $radius_dbh->commit;
+    # NOTICE: This is a bit inconsistent
+    # if whole payment failed we will have radius account without payment
++>>>>>>> Stashed changes
  
  
     return $package;



Why updated upstream block is so small?

++<<<<<<< Updated upstream
 +       # NOTICE: This is a bit inconsistent
 +       # if whole payment failed we will have radius account without payment
 +   };
++||||||| merged common ancestors

 
I suppose it should start from to line line:

     +       $radius_dbh->begin_work;
     ...
    +    # if whole payment failed we will have radius account without payment




-- 
Best regards,
Eugen Konkov


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: Why "Updated upstream" block is so small?
  2019-06-29 10:05 Why "Updated upstream" block is so small? Eugen Konkov
@ 2019-06-29 10:23 ` Eugen Konkov
  0 siblings, 0 replies; 2+ messages in thread
From: Eugen Konkov @ 2019-06-29 10:23 UTC (permalink / raw)
  To: Git Mailing List

Hello Eugen,

If I do space changes to lines as next:

        ## Create radius account
        eval{
        my $radius_dbh =  $self->result_source->storage->schema->{ _radius_dbh };
        $radius_dbh->begin_work;
        my $sth =  $radius_dbh->prepare(
                "INSERT INTO radusergroup ( username, groupname, priority ) values (?,'static',1)"
        );
        $sth->execute( $package->login );

        $sth =  $radius_dbh->prepare(
                "INSERT INTO radcheck ( username, attribute, op, value ) values ( ?, ?, ?, ? )"
        );
        # my $package_type =  $package->Invoice->Order->Tariff->type;
        my $pass =  $package->password;
        ($pass) =  (`smbencrypt $pass` =~ /([^\s]+)$/s);
        $sth->execute( $package->login, 'NT-Password', ':=', $pass //'' );
        $sth->execute( $package->login, 'NAS-Identifier', '=~', 'ppp' );

        $sth =  $radius_dbh->prepare(
                "INSERT INTO radreply ( username, attribute, op, value, nasip) values ( ?, 'Framed-IP-Address', '=', ?, ? )"
        );
        my $ip =  $package->Ips->first;
        $sth->execute( $package->login, $ip->ip, $ip->Listener->first->nas_ip );

        $radius_dbh->commit;
        # NOTICE: This is a bit inconsistent
        # if whole payment failed we will have radius account without payment
        };


and `git stash apply` then I get expected result:

diff --cc lib/App/Schema/Result/Invoice.pm
index 07e1b373,0ce2d698..00000000
--- a/lib/App/Schema/Result/Invoice.pm
+++ b/lib/App/Schema/Result/Invoice.pm
@@@ -223,23 -217,22 +223,29 @@@ sub new_package 
         "INSERT INTO radcheck ( username, attribute, op, value ) values ( ?, ?, ?, ? )"
     );
     # my $package_type =  $package->Invoice->Order->Tariff->type;
     my $pass =  $package->password;
     ($pass) =  (`smbencrypt $pass` =~ /([^\s]+)$/s);
++<<<<<<< Updated upstream
     $sth->execute( $package->login, 'NT-Password', ':=', $pass //'' );
++||||||| merged common ancestors
++   $sth->execute( $package->login, 'NT-Password', ':=', $pass );
++=======
++   $sth->execute( $package->login, 'NT-Password', ':=', $pass //'');
++>>>>>>> Stashed changes
     $sth->execute( $package->login, 'NAS-Identifier', '=~', 'ppp' );
  
     $sth =  $radius_dbh->prepare(
         "INSERT INTO radreply ( username, attribute, op, value, nasip) values ( ?, 'Frame
     );
     my $ip =  $package->Ips->first;
-    $sth->execute( $package->login, $ip->ip, $ip->Listener->first->nas_ip );
+    # $sth->execute( $package->login, $ip->ip, $ip->Listener->first->nas_ip );
  
     $radius_dbh->commit;
     # NOTICE: This is a bit inconsistent
     # if whole payment failed we will have radius account without payment
 +   };
  
  
     return $package;
  }


Why before space change I get broken result?



Saturday, June 29, 2019, 1:05:45 PM, you wrote:

> Hello

> I want to apply this patch from stage:

> diff --git a/lib/App/Schema/Result/Invoice.pm
> b/lib/App/Schema/Result/Invoice.pm
> index 0176916f..0ce2d698 100644
> --- a/lib/App/Schema/Result/Invoice.pm
> +++ b/lib/App/Schema/Result/Invoice.pm
> @@ -219,14 +219,14 @@ sub new_package {
>      # my $package_type =  $package->Invoice->Order->Tariff->type;
>      my $pass =  $package->password;
>      ($pass) =  (`smbencrypt $pass` =~ /([^\s]+)$/s);
-    $sth->>execute( $package->login, 'NT-Password', ':=', $pass );
+    $sth->>execute( $package->login, 'NT-Password', ':=', $pass //'');
>      $sth->execute( $package->login, 'NAS-Identifier', '=~', 'ppp' );
>  
>      $sth =  $radius_dbh->prepare(
>          "INSERT INTO radreply ( username, attribute, op, value,
> nasip) values ( ?, 'Framed-IP-Address', '=', ?, ? )"
>      );
>      my $ip =  $package->Ips->first;
-    $sth->>execute( $package->login, $ip->ip, $ip->Listener->first->nas_ip );
+    # $sth->>execute( $package->login, $ip->ip, $ip->Listener->first->nas_ip );
>  
>      $radius_dbh->commit;
>      # NOTICE: This is a bit inconsistent


> after applying I get merge conflict:


> diff --cc lib/App/Schema/Result/Invoice.pm
> index e3f55654,0ce2d698..00000000
> --- a/lib/App/Schema/Result/Invoice.pm
> +++ b/lib/App/Schema/Result/Invoice.pm
> @@@ -211,33 -204,34 +211,87 @@@ sub new_package 
>      }
>   
>      ## Create radius account
>  +   eval{
>          my $radius_dbh =  $self->result_source->storage->schema->{ _radius_dbh };
>  -   if( !$radius_dbh->FETCH('AutoCommit') ) {
>  +       $radius_dbh->begin_work;
>  +       my $sth =  $radius_dbh->prepare(
>  +           "INSERT INTO radusergroup ( username, groupname, priority ) values (?,'static',1)"
>  +       );
>  +       $sth->execute( $package->login );
>  +
>  +       $sth =  $radius_dbh->prepare(
>  +           "INSERT INTO radcheck ( username, attribute, op, value ) values ( ?, ?, ?, ? )"
>  +       );
>  +       # my $package_type =  $package->Invoice->Order->Tariff->type;
>  +       my $pass =  $package->password;
>  +       ($pass) =  (`smbencrypt $pass` =~ /([^\s]+)$/s);
>  +       $sth->execute( $package->login, 'NT-Password', ':=', $pass //'' );
>  +       $sth->execute( $package->login, 'NAS-Identifier', '=~', 'ppp' );
>  +
>  +       $sth =  $radius_dbh->prepare(
>  +           "INSERT INTO radreply ( username, attribute, op,
> value, nasip) values ( ?, 'Framed-IP-Address', '=', ?, ? )"
>  +       );
>  +       my $ip =  $package->Ips->first;
>  +       $sth->execute( $package->login, $ip->ip, $ip->Listener->first->nas_ip );
>  +
>          $radius_dbh->commit;
> ++<<<<<<< Updated upstream
>  +       # NOTICE: This is a bit inconsistent
>  +       # if whole payment failed we will have radius account without payment
>  +   };
> ++||||||| merged common ancestors
> ++   }
++   $radius_dbh->>begin_work;
> ++   my $sth =  $radius_dbh->prepare(
> ++       "INSERT INTO radusergroup ( username, groupname, priority ) values (?,'static',1)"
> ++   );
++   $sth->>execute( $package->login );
> ++
> ++   $sth =  $radius_dbh->prepare(
> ++       "INSERT INTO radcheck ( username, attribute, op, value ) values ( ?, ?, ?, ? )"
> ++   );
> ++   # my $package_type =  $package->Invoice->Order->Tariff->type;
> ++   my $pass =  $package->password;
> ++   ($pass) =  (`smbencrypt $pass` =~ /([^\s]+)$/s);
++   $sth->>execute( $package->login, 'NT-Password', ':=', $pass );
++   $sth->>execute( $package->login, 'NAS-Identifier', '=~', 'ppp' );
> ++
> ++   $sth =  $radius_dbh->prepare(
> ++       "INSERT INTO radreply ( username, attribute, op, value,
> nasip) values ( ?, 'Framed-IP-Address', '=', ?, ? )"
> ++   );
> ++   my $ip =  $package->Ips->first;
++   $sth->>execute( $package->login, $ip->ip, $ip->Listener->first->nas_ip );
> ++
++   $radius_dbh->>commit;
> ++   # NOTICE: This is a bit inconsistent
> ++   # if whole payment failed we will have radius account without payment
> ++=======
> +    }
+    $radius_dbh->>begin_work;
> +    my $sth =  $radius_dbh->prepare(
> +        "INSERT INTO radusergroup ( username, groupname, priority ) values (?,'static',1)"
> +    );
+    $sth->>execute( $package->login );
> + 
> +    $sth =  $radius_dbh->prepare(
> +        "INSERT INTO radcheck ( username, attribute, op, value ) values ( ?, ?, ?, ? )"
> +    );
> +    # my $package_type =  $package->Invoice->Order->Tariff->type;
> +    my $pass =  $package->password;
> +    ($pass) =  (`smbencrypt $pass` =~ /([^\s]+)$/s);
+    $sth->>execute( $package->login, 'NT-Password', ':=', $pass //'');
+    $sth->>execute( $package->login, 'NAS-Identifier', '=~', 'ppp' );
> + 
> +    $sth =  $radius_dbh->prepare(
> +        "INSERT INTO radreply ( username, attribute, op, value,
> nasip) values ( ?, 'Framed-IP-Address', '=', ?, ? )"
> +    );
> +    my $ip =  $package->Ips->first;
+    # $sth->>execute( $package->login, $ip->ip, $ip->Listener->first->nas_ip );
> + 
+    $radius_dbh->>commit;
> +    # NOTICE: This is a bit inconsistent
> +    # if whole payment failed we will have radius account without payment
++>>>>>>>> Stashed changes
>   
>   
>      return $package;



> Why updated upstream block is so small?

> ++<<<<<<< Updated upstream
>  +       # NOTICE: This is a bit inconsistent
>  +       # if whole payment failed we will have radius account without payment
>  +   };
> ++||||||| merged common ancestors

>  
> I suppose it should start from to line line:

>      +       $radius_dbh->begin_work;
>      ...
>     +    # if whole payment failed we will have radius account without payment







-- 
Best regards,
Eugen Konkov


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-29 10:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-29 10:05 Why "Updated upstream" block is so small? Eugen Konkov
2019-06-29 10:23 ` Eugen Konkov

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).