mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2025-01-11 23:57:21 -08:00
Compare commits
1 commit
3a909e00a3
...
52a9d779d2
Author | SHA1 | Date | |
---|---|---|---|
|
52a9d779d2 |
8 changed files with 18 additions and 103 deletions
39
.github/workflows/publish-packages.yml
vendored
39
.github/workflows/publish-packages.yml
vendored
|
@ -1,39 +0,0 @@
|
||||||
name: Publish to Buildkite
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
secrets:
|
|
||||||
BUILDKITE_TOKEN:
|
|
||||||
required: true
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
name: Publish to Buildkite
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
runtime: [linux-x64, linux-arm64]
|
|
||||||
steps:
|
|
||||||
- name: Download package artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: package.${{ matrix.runtime }}
|
|
||||||
path: packages
|
|
||||||
|
|
||||||
- name: Publish DEB package
|
|
||||||
env:
|
|
||||||
BUILDKITE_TOKEN: ${{ secrets.BUILDKITE_TOKEN }}
|
|
||||||
run: |
|
|
||||||
FILE=$(echo packages/*.deb)
|
|
||||||
curl -X POST https://api.buildkite.com/v2/packages/organizations/sourcegit/registries/sourcegit-deb/packages \
|
|
||||||
-H "Authorization: Bearer $BUILDKITE_TOKEN" \
|
|
||||||
-F "file=@$FILE" \
|
|
||||||
--fail
|
|
||||||
|
|
||||||
- name: Publish RPM package
|
|
||||||
env:
|
|
||||||
BUILDKITE_TOKEN: ${{ secrets.BUILDKITE_TOKEN }}
|
|
||||||
run: |
|
|
||||||
FILE=$(echo packages/*.rpm)
|
|
||||||
curl -X POST https://api.buildkite.com/v2/packages/organizations/sourcegit/registries/sourcegit-rpm/packages \
|
|
||||||
-H "Authorization: Bearer $BUILDKITE_TOKEN" \
|
|
||||||
-F "file=@$FILE" \
|
|
||||||
--fail
|
|
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
|
@ -24,11 +24,6 @@ jobs:
|
||||||
uses: ./.github/workflows/package.yml
|
uses: ./.github/workflows/package.yml
|
||||||
with:
|
with:
|
||||||
version: ${{ needs.version.outputs.version }}
|
version: ${{ needs.version.outputs.version }}
|
||||||
publish-packages:
|
|
||||||
name: Publish Packages
|
|
||||||
uses: ./.github/workflows/publish-packages.yml
|
|
||||||
secrets:
|
|
||||||
BUILDKITE_TOKEN: ${{ secrets.BUILDKITE_TOKEN }}
|
|
||||||
release:
|
release:
|
||||||
needs: [package, version]
|
needs: [package, version]
|
||||||
name: Release
|
name: Release
|
||||||
|
|
|
@ -18,7 +18,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
|
||||||
.github\workflows\package.yml = .github\workflows\package.yml
|
.github\workflows\package.yml = .github\workflows\package.yml
|
||||||
.github\workflows\release.yml = .github\workflows\release.yml
|
.github\workflows\release.yml = .github\workflows\release.yml
|
||||||
.github\workflows\localization-check.yml = .github\workflows\localization-check.yml
|
.github\workflows\localization-check.yml = .github\workflows\localization-check.yml
|
||||||
.github\workflows\publish-packages.yml = .github\workflows\publish-packages.yml
|
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{49A7C2D6-558C-4FAA-8F5D-EEE81497AED7}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{49A7C2D6-558C-4FAA-8F5D-EEE81497AED7}"
|
||||||
|
|
|
@ -7,7 +7,6 @@ URL: https://sourcegit-scm.github.io/
|
||||||
Source: https://github.com/sourcegit-scm/sourcegit/archive/refs/tags/v%_version.tar.gz
|
Source: https://github.com/sourcegit-scm/sourcegit/archive/refs/tags/v%_version.tar.gz
|
||||||
Requires: libX11.so.6()(%{__isa_bits}bit)
|
Requires: libX11.so.6()(%{__isa_bits}bit)
|
||||||
Requires: libSM.so.6()(%{__isa_bits}bit)
|
Requires: libSM.so.6()(%{__isa_bits}bit)
|
||||||
Requires: libicu
|
|
||||||
|
|
||||||
%define _build_id_links none
|
%define _build_id_links none
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@ namespace SourceGit.Models
|
||||||
public List<string> Ahead { get; set; } = new List<string>();
|
public List<string> Ahead { get; set; } = new List<string>();
|
||||||
public List<string> Behind { get; set; } = new List<string>();
|
public List<string> Behind { get; set; } = new List<string>();
|
||||||
|
|
||||||
public bool IsVisible => Ahead.Count > 0 || Behind.Count > 0;
|
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
if (Ahead.Count == 0 && Behind.Count == 0)
|
if (Ahead.Count == 0 && Behind.Count == 0)
|
||||||
|
|
|
@ -16,18 +16,6 @@
|
||||||
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
|
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
|
||||||
<Path Width="14" Height="14" Margin="8,0" Data="{StaticResource Icons.Branch}"/>
|
<Path Width="14" Height="14" Margin="8,0" Data="{StaticResource Icons.Branch}"/>
|
||||||
<TextBlock Text="{Binding Target.FriendlyName}"/>
|
<TextBlock Text="{Binding Target.FriendlyName}"/>
|
||||||
<Border Height="18"
|
|
||||||
Margin="8,0,0,0"
|
|
||||||
Padding="8,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
CornerRadius="9"
|
|
||||||
Background="{DynamicResource Brush.Badge}"
|
|
||||||
IsVisible="{Binding Target.TrackStatus.IsVisible}">
|
|
||||||
<TextBlock Foreground="{DynamicResource Brush.BadgeFG}"
|
|
||||||
FontFamily="{DynamicResource Fonts.Monospace}"
|
|
||||||
FontSize="10"
|
|
||||||
Text="{Binding Target.TrackStatus}"/>
|
|
||||||
</Border>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<Border Grid.Row="1" Grid.Column="1" Height="32" IsVisible="{Binding !Target.IsLocal}">
|
<Border Grid.Row="1" Grid.Column="1" Height="32" IsVisible="{Binding !Target.IsLocal}">
|
||||||
|
|
|
@ -42,22 +42,9 @@
|
||||||
|
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate DataType="m:Branch">
|
<DataTemplate DataType="m:Branch">
|
||||||
<Grid Height="26" ColumnDefinitions="22,*,Auto">
|
<Grid Height="26" ColumnDefinitions="22,*">
|
||||||
<Path Grid.Column="0" Width="10" Height="10" Margin="4,0,8,0" Data="{StaticResource Icons.Branch}" />
|
<Path Grid.Column="0" Width="10" Height="10" Margin="4,0,8,0" Data="{StaticResource Icons.Branch}" />
|
||||||
<TextBlock Grid.Column="1" Text="{Binding FriendlyName}" Classes="primary" />
|
<TextBlock Grid.Column="1" Text="{Binding FriendlyName}" Classes="primary" />
|
||||||
<Border Grid.Column="2"
|
|
||||||
Height="18"
|
|
||||||
Margin="8,0"
|
|
||||||
Padding="8,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
CornerRadius="9"
|
|
||||||
Background="{DynamicResource Brush.Badge}"
|
|
||||||
IsVisible="{Binding TrackStatus.IsVisible}">
|
|
||||||
<TextBlock Foreground="{DynamicResource Brush.BadgeFG}"
|
|
||||||
FontFamily="{DynamicResource Fonts.Monospace}"
|
|
||||||
FontSize="10"
|
|
||||||
Text="{Binding TrackStatus}"/>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
|
|
|
@ -430,43 +430,31 @@ namespace SourceGit.Views
|
||||||
if (ShowAsDateTime)
|
if (ShowAsDateTime)
|
||||||
return DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime().ToString("yyyy/MM/dd HH:mm:ss");
|
return DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime().ToString("yyyy/MM/dd HH:mm:ss");
|
||||||
|
|
||||||
var now = DateTime.Now;
|
var today = DateTime.Today;
|
||||||
var localTime = DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime();
|
var localTime = DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime();
|
||||||
var span = now - localTime;
|
|
||||||
if (span.TotalMinutes < 1)
|
|
||||||
return App.Text("Period.JustNow");
|
|
||||||
|
|
||||||
if (span.TotalHours < 1)
|
if (localTime >= today)
|
||||||
return App.Text("Period.MinutesAgo", (int)span.TotalMinutes);
|
|
||||||
|
|
||||||
if (span.TotalDays < 1)
|
|
||||||
return App.Text("Period.HoursAgo", (int)span.TotalHours);
|
|
||||||
|
|
||||||
var lastDay = now.AddDays(-1).Date;
|
|
||||||
if (localTime >= lastDay)
|
|
||||||
return App.Text("Period.Yesterday");
|
|
||||||
|
|
||||||
if ((localTime.Year == now.Year && localTime.Month == now.Month) || span.TotalDays < 28)
|
|
||||||
{
|
{
|
||||||
var diffDay = now.Date - localTime.Date;
|
var now = DateTime.Now;
|
||||||
return App.Text("Period.DaysAgo", (int)diffDay.TotalDays);
|
var timespan = now - localTime;
|
||||||
|
if (timespan.TotalHours > 1)
|
||||||
|
return App.Text("Period.HoursAgo", (int)timespan.TotalHours);
|
||||||
|
|
||||||
|
return timespan.TotalMinutes < 1 ? App.Text("Period.JustNow") : App.Text("Period.MinutesAgo", (int)timespan.TotalMinutes);
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastMonth = now.AddMonths(-1).Date;
|
var diffYear = today.Year - localTime.Year;
|
||||||
if (localTime.Year == lastMonth.Year && localTime.Month == lastMonth.Month)
|
if (diffYear == 0)
|
||||||
return App.Text("Period.LastMonth");
|
|
||||||
|
|
||||||
if (localTime.Year == now.Year || localTime > now.AddMonths(-11))
|
|
||||||
{
|
{
|
||||||
var diffMonth = (12 + now.Month - localTime.Month) % 12;
|
var diffMonth = today.Month - localTime.Month;
|
||||||
return App.Text("Period.MonthsAgo", diffMonth);
|
if (diffMonth > 0)
|
||||||
|
return diffMonth == 1 ? App.Text("Period.LastMonth") : App.Text("Period.MonthsAgo", diffMonth);
|
||||||
|
|
||||||
|
var diffDay = today.Day - localTime.Day;
|
||||||
|
return diffDay == 1 ? App.Text("Period.Yesterday") : App.Text("Period.DaysAgo", diffDay);
|
||||||
}
|
}
|
||||||
|
|
||||||
var diffYear = now.Year - localTime.Year;
|
return diffYear == 1 ? App.Text("Period.LastYear") : App.Text("Period.YearsAgo", diffYear);
|
||||||
if (diffYear == 1)
|
|
||||||
return App.Text("Period.LastYear");
|
|
||||||
|
|
||||||
return App.Text("Period.YearsAgo", diffYear);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private IDisposable _refreshTimer = null;
|
private IDisposable _refreshTimer = null;
|
||||||
|
|
Loading…
Reference in a new issue