Why "Updated upstream" block is so small?
Hello
I want to apply this patch from stage:
lib/App/Schema/Result/Invoice.pm +2 -2
@@ -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:
lib/App/Schema/Result/Invoice.pm +0 -0
@@@ -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
Signature · 2 lines
Best regards, Eugen Konkov
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:
lib/App/Schema/Result/Invoice.pm +0 -0
@@@ -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?
lib/App/Schema/Result/Invoice.pm sub new_package { · line 221
Quoted 13 lines · you
Hello
I want to apply this patch from stage:
lib/App/Schema/Result/Invoice.pm +0
-0@@ -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 //'');
Quoted 7 lines
lib/App/Schema/Result/Invoice.pm +0
-0$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 );
Quoted 37 lines
$radius_dbh->commit;
# NOTICE: This is a bit inconsistentafter applying I get merge conflict:
lib/App/Schema/Result/Invoice.pm +0
-0@@@ -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', '=', ?, ? )"
Quoted 11 lines
+ );
+ 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;
Quoted 3 lines
++ my $sth = $radius_dbh->prepare(
++ "INSERT INTO radusergroup ( username, groupname, priority ) values (?,'static',1)"
++ );
++ $sth->>execute( $package->login );
Quoted 7 lines
++
++ $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' );
Quoted 6 lines
++
++ $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 );
Quoted 1 line
++
++ $radius_dbh->>commit;
Quoted 4 lines
++ # NOTICE: This is a bit inconsistent
++ # if whole payment failed we will have radius account without payment
++=======
+ }
+ $radius_dbh->>begin_work;
lib/App/Schema/Result/Invoice.pm
Quoted 3 lines
lib/App/Schema/Result/Invoice.pm +3
-0+ my $sth = $radius_dbh->prepare( + "INSERT INTO radusergroup ( username, groupname, priority ) values (?,'static',1)" + );
+ $sth->>execute( $package->login );
lib/App/Schema/Result/Invoice.pm
Quoted 7 lines
+
lib/App/Schema/Result/Invoice.pm +6
-0+ $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' );
lib/App/Schema/Result/Invoice.pm
Quoted 6 lines
+
lib/App/Schema/Result/Invoice.pm +2
-0+ $sth = $radius_dbh->prepare( + "INSERT INTO radreply ( username, attribute, op, value,nasip) values ( ?, 'Framed-IP-Address', '=', ?, ? )"
lib/App/Schema/Result/Invoice.pm +2
-0+ ); + my $ip = $package->Ips->first;
+ # $sth->>execute( $package->login, $ip->ip, $ip->Listener->first->nas_ip );
Quoted 1 line
+
+ $radius_dbh->>commit;
lib/App/Schema/Result/Invoice.pm
Quoted 2 lines
lib/App/Schema/Result/Invoice.pm +2
-0+ # NOTICE: This is a bit inconsistent + # if whole payment failed we will have radius account without payment
++>>>>>>>> Stashed changes
Quoted 20 lines
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 ancestorsI suppose it should start from to line line:
+ $radius_dbh->begin_work;
...
+ # if whole payment failed we will have radius account without payment
Signature · 2 lines
Best regards, Eugen Konkov