##// END OF EJS Templates
phabricator: fallback to reading metadata from diff for phabread...
Ian Moody -
r42442:a4f7dceb default
parent child Browse files
Show More
@@ -905,7 +905,8 b' def getdiffmeta(diff):'
905 """
905 """
906 props = diff.get(b'properties') or {}
906 props = diff.get(b'properties') or {}
907 meta = props.get(b'hg:meta')
907 meta = props.get(b'hg:meta')
908 if not meta and props.get(b'local:commits'):
908 if not meta:
909 if props.get(b'local:commits'):
909 commit = sorted(props[b'local:commits'].values())[0]
910 commit = sorted(props[b'local:commits'].values())[0]
910 meta = {}
911 meta = {}
911 if b'author' in commit and b'authorEmail' in commit:
912 if b'author' in commit and b'authorEmail' in commit:
@@ -920,7 +921,15 b' def getdiffmeta(diff):'
920 meta[b'node'] = node
921 meta[b'node'] = node
921 if len(commit.get(b'parents', ())) >= 1:
922 if len(commit.get(b'parents', ())) >= 1:
922 meta[b'parent'] = commit[b'parents'][0]
923 meta[b'parent'] = commit[b'parents'][0]
923 return meta or {}
924 else:
925 meta = {}
926 if b'date' not in meta and b'dateCreated' in diff:
927 meta[b'date'] = b'%s 0' % diff[b'dateCreated']
928 if b'branch' not in meta and diff.get(b'branch'):
929 meta[b'branch'] = diff[b'branch']
930 if b'parent' not in meta and diff.get(b'sourceControlBaseRevision'):
931 meta[b'parent'] = diff[b'sourceControlBaseRevision']
932 return meta
924
933
925 def readpatch(repo, drevs, write):
934 def readpatch(repo, drevs, write):
926 """generate plain-text patch readable by 'hg import'
935 """generate plain-text patch readable by 'hg import'
@@ -32,6 +32,8 b' this test.'
32 Basic phabread:
32 Basic phabread:
33 $ hg phabread --test-vcr "$VCR/phabread-4480.json" D4480 | head
33 $ hg phabread --test-vcr "$VCR/phabread-4480.json" D4480 | head
34 # HG changeset patch
34 # HG changeset patch
35 # Date 1536771503 0
36 # Parent a5de21c9e3703f8e8eb064bd7d893ff2f703c66a
35 exchangev2: start to implement pull with wire protocol v2
37 exchangev2: start to implement pull with wire protocol v2
36
38
37 Wire protocol version 2 will take a substantially different
39 Wire protocol version 2 will take a substantially different
@@ -39,8 +41,6 b' Basic phabread:'
39 is concerned).
41 is concerned).
40
42
41 This commit establishes a new exchangev2 module for holding
43 This commit establishes a new exchangev2 module for holding
42 code related to exchange using wire protocol v2. I could have
43 added things to the existing exchange module. But it is already
44
44
45 phabupdate with an accept:
45 phabupdate with an accept:
46 $ hg phabupdate --accept D4564 \
46 $ hg phabupdate --accept D4564 \
General Comments 0
You need to be logged in to leave comments. Login now