Move tag to other commit - pygit2

While I can imagine to e.g. delete the tag via Reference.delete and then to recreate it anew (on the other commit), I wonder what the "official" way of moving a tag in pygit2 is.

The race-free way to change that a reference points to is by setting its target field.
ref.target = tag.id
will make sure it updates the reference, removing a possible race condition with a cleanup process.

Related

How to run liquibase changelogSyncSQL or changelogSync up to a tag and/or labels?

I'm adding liquibase to an existing project where tables and data already exist. I would like to know how I might limit the scope of changelogSync[SQL] to a subset of available changes.
Background
I've run liquibase generateChangeLog to capture the current state and placed this into say src/main/resources/db/changelog/changes/V2021.04.13.00.00.00__init01.yaml.
I've also added another changeset to cover some new requirements in a new file. Let's call it src/main/resources/db/changelog/changes/V2021.04.13.00.00.00__new-feature.yaml.
I've added a main changelog file src/main/resources/db/changelog/db.changelog-master.yaml with the following contents:
databaseChangeLog:
- includeAll:
path: changes
relativeToChangelogFile: true
I now want to ensure that when I run liquibase changelogSync[SQL] against a particular version of the db that the scope is limited to the first changelog init01, thereby allowing from that point on a liquibase update or updateToTag et al, to continue with changes following init01.
I'm surprised to see that the changelogSync[SQL] commands don't seem to offer some way (that I can see from the docs for how to do this.
Besides printing the SQL and manually changing it, is there something I've missed? Any suggested approaches welcome. Thanks!
What about changelogSyncToTagSQL ?
Wouldn't it cover your needs?
Or maybe you could try changelogSyncSQL with additional parameters "label" or and "context" ?
changelogSyncToTagSQL
context
labels
As it stands, the only solution I've found is to generate the SQL and then manually edit its contents to filter the change sets which don't correspond to your current schema.
Then you can apply the sql to the db.

Is there any way to add multiple "Auto Number Prefix" in oracle ucm?

See, I have a requirement in which I am supposed to change the "Auto Number Prefix" for only one profile, I am wondering if there is any way to achieve that?
You should be able to set AutoNumberPrefix in a rule side effect and have it apply only to that rule/profile.
<$AutoNumberPrefix="profile1_"$>
For those who wants the answer for this, I found the method to provide the different prefix for different profile type. Go in Admin Server-> Configuration -> Paste this code;
AutoNumberPrefix=<$if dDocType like 'Profile_name'$>Prefix Name<$else$>another prefix name<$endif$>
Adding the code shown as "correct" is actually the more inflexible way to do this. Any changes require a restart of the Content Server.
Jonathan's answer was really close, but the syntax used ensures that the variable "AutoNumberPrefix" remains in the profile context. It needs to be placed into local data to be used. This is accomplished using the function "dpPromote".
<$dpPromote("AutoNumberPrefix","profile1_")$>

Ambiguous match, found 2 elements matching css, how to get to the second one?

I am having problems in Capybara with the Ambiguous match problem. And the page provides no 'ids" to identify which one is which.
I am using within function.
within('.tile.tile-animation.animation-left.animation-visible.animated') do
#some code in here
end
I've used the :match option which solved my first problem.
within('.tile.tile-animation.animation-left.animation-visible.animated', :match => :first) do
#some code in here
end
The question is how to get to the SECOND css '.tile.tile-animation.animation-left.animation-visible.animated' ?
It depends on the html -- a simple solutions is
within(all('.tile.tile-animated.animation-left.animation-visible.animated')[1]) do
# some code in here
end
which will scope to the second matching element on the page, but won't be able to auto-reload if the page changes, and won't wait for the elements to appear. If you need it to wait for at least two elements to appear you can do
within(all('.tile.tile-animated.animation-left.animation-visible.animated', minimum: 2)[1]) do
....
which will wait some time for at least the 2 elements to appear on the page, but still won't be able to auto-reload if the page changes. If you need the ability to auto-reload on a dynamically changing page it will need to be possible to write a unique selector for the element (rather than indexing into the results of #all.

Xcode4 target labelled as missing, but cannot delete it

I want to delete this red-marked target, but am unable to.
The "minus" button in the dialogue remains greyed-out, it doesn't respond to backspace or delete keys and right-clicking just brings up help options. I can drag the missing-red-marked target above or below the working black target, but it doesn't let me delete it.
This missing red target only seems to appear in this edit schemes dialogue.
In my main project/target window, I just have the one good target there.
Any ideas how to clean this up and delete this missing target?
What worked for me was to designate another executable (or none) in the existing scheme's various actions (run, test, etc.). It's the fact it's in use in the scheme's actions that prevents its deletion. I discovered this during my research for Mastering Xcode 4 (yes, shameless plug). :-)
Try creating a brand new scheme (via "New Scheme" or "Manage Schemes...") and start using that.
Once your new scheme is building properly and is set as a default, you should be able to delete the old scheme with the bogus "missing" target.
The real issue here is explained by Joar Wingfors in the Xcode-users mailing list (emphasis mine):
In the scheme sheet you cannot delete things from one tab that some
other tab depend on. In this case you probably have to delete the
target from the test tab before you can delete it from the build tab.
Or something along those lines.
I had the exact same problem. Solved by closing the xCode and externally editing the schema file to delete the bundlableResource section for the missing library. Not the safest of all methods but it works.
First delete all schemes and then generate the schemes again. Work for me .
What Joshua said, a bit tailored. Go through all various actions and change the missing executable to an existing one.
In your case, go to 'Profile' and switch to the new app. Same if you encounter this in 'Test' tab.

How to find which menu a node belongs to in drupal

I currently have nodes setup on my site, and each node belongs to a particular menu (not primary or secondary prebuilt menues).
How can i find out which menu a node belongs to?
Maybe this is what you mean:
$trail = menu_get_active_trail();
$lastInTrail = end($trail);
$menu_name = $lastInTrail['menu_name'];
menu_get_active_trail() returns a breadcrumbs like array, the last breadcrumb represents the current node.
Cheers,
Laurens Meurs, Rotterdam
I'm a noob, so don't bash me if what I'm going to write is worthless babbling.
I think you can't do that directly, unless there's some smart module out there that would do all the nasty SQL queries necessary to check this.
Node info is stored in the SQL table "node", and is identified merely by NID (node ID, which is the node number that appears after /?q=node/ in the address). Their aliases, if any, are stored in "url_alias" table, where you can find columns "src" and "dst", identifying the original and the aliased path (for instance, src='node/123', dst='my/url/alias'). The menu links can be found in the table "menu_links", where you can find the columns "menu_name" (the machine-radable name of a menu) and "link_path" (either the node/... or the alias).
So, what you'd need to do is the following:
get the current node's NID
query "url_alias" if there's an alias for node/NID and retrieve it, otherwise leave node/NID
query the "menu_links" table for the path you've determined and retrieve "none" or the menu's machine-readable name
You could then also query the table "menu_custom" to check what's the human-readable name of the menu you've determined.
Anyway, that's a complicated query (several queries?) and I'm a MySQL ignorant, so I can't help you with the actual code you'll need to use to check all that :P.
This isn't a direct solution and I see from your reply to a previous answer that you didn't wanted the simplest solution possible, but I thought I'd mention this option. The Menu Node API module maintains a table which Drupal lacks, a node-menu relationship table.
The module does nothing on its own, but there seems to be contributed modules which build on this, so depending on how complex your problem is it might be a starting point.
http://drupal.org/node/584984
Updated: Sorry guys, didn't even realize I had posted this link. I think I intended it as a draft and simply posted it when closing tabs. That said, mingos (above) is right on.
My link is to a function menu_get_active_menu_name() that appears to provide you with an array containing the active menu for the current page. As I presume that is what you are using it for, it would be a nice way to abstract yourself away from the database calls that might cause problems down the line.
I myself have never tried it, which is probably why I didn't elaborate and post. well... at least didn't post on purpose.

Resources